question

Zach B3 avatar image
0 Likes"
Zach B3 asked Zach B3 commented

Delay Fluid Mixer Batch Creation Process

When my model runs, a fluid mixer automatically immediately starts at step 1 of the current mixer recipe #1. What I am trying to accomplish is to create a delay in starting the fluid mixer's initial recipe #1, because I do not want the mixer to operate under recipe #1 ever. I want to have a pause in the production in the beginning, then I currently have a recipe #2 updating to the fluid mixer according to the system's requirements (this recipe #2 requirements fluctuate on each model run) on the fluid mixer after a certain time. The issue is that the fluid mixer is still operating under the initial recipe #1 from when the model first started and the fluid mixer is not using my updated recipe #2 on the first batch.

I know that once a batch step process on a fluid mixer has been started with recipe #1, if the recipe updates to recipe #2, this update will only take into effect when the initial batch recipe #1 has fully created a batch. Is there a way to have a fluid mixer not automatically start requesting materials based on the initial recipe?

Thanks!

FlexSim 20.0.0
batchdelayupdatefluid mixerrecipe
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

tannerp avatar image tannerp commented ·

Hi @Zach B3,

If you don't ever want the fluid mixer to operate under recipe #1, why are you using recipe #1? Is it simply being used as a place-holder so you can update the recipe as you go? Either way, I would try closing the input on the mixer On Model Reset and see if that stops the input initially. Then, after a delay period, you can re-open the input. That's just my initial thought. Do you have a working model or a small example you could post?

0 Likes 0 ·
Zach B3 avatar image Zach B3 tannerp commented ·

@tanner.p, There is just an initial recipe loaded into the mixer from the previous model run, but these numbers do not matter. The recipe change will be requested to the mixer a few minutes into the model, and that's when I need the first batch to start accepting material through the input. But even if I close the input or stop the input on reset, the batch still uses the initial recipe (it looks like it uses the initial recipe step 1 values, then uses the new recipe for the rest of the steps), which I do not want. But I cannot stop the mixer from starting to request the initial batch right when the model first starts. fluid-mixer-recipe-issue-sample.fsm

0 Likes 0 ·

1 Answer

·
Benjamin W2 avatar image
1 Like"
Benjamin W2 answered Zach B3 commented

Hi @Zach B3,

I think that the fluid mixer still has events stored from it's initial loading of recipe 1. Simply add a command to destroy the events of the object, then empty the object. See the following code in your "Change Recipe" activity:

/**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);

destroyeventsofobject(Model.find("FluidMixer1"));
emptyfluidobject(Model.find("FluidMixer1"));

getvarnode(Model.find("FluidMixer1"), "recipetable").as(Table)[1][3] = normal(500,2);
getvarnode(Model.find("FluidMixer1"), "recipetable").as(Table)[2][3] = normal(600,2);
getvarnode(Model.find("FluidMixer1"), "recipetable").as(Table)[3][3] = normal(700,2);
getvarnode(Model.find("FluidMixer1"), "recipetable").as(Table)[4][3] = normal(800,2);
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Zach B3 avatar image Zach B3 commented ·

Thank you so much! This is what I have been trying to figure out for a while now. I had no idea about that destroyeventsofeobject script.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.