question

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

Problem updating recipe table on fluidmixer

Hello,

I have been trying to use the "update recipe table" trigger on the fluid mixer but it doesn´t seem to be working.

First, when select the table using the drop menu inside the trigger, it deletes it as soon as I close that trigger, making an empty camp and deleting the table as soon as the command is triggered.

When I force the name of the table inside the code editor, it works, but only if the original table and the next one have the same amount of product in the recipe, so you can change the amount of each ingredient but they have to add up or be more than the same amount as the sum of the original ingredients. If it´s not the case the fluid mixer and the new recipe needs less amount of product then it will be blocked and in an estate of starvation, although the tank that feed it are full.

Here is an example:

dudafluidmixer.fsm

FlexSim 19.1.0
triggersfluid mixer
dudafluidmixer.fsm (27.2 KiB)
5 |100000

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

1 Answer

Logan Gold avatar image
0 Likes"
Logan Gold answered Zach B3 commented

@Julio R

The dropdown for picking the name of the table is not working correctly and I will pass it along to the developers. The workaround is to do what you've already indicated and manually input the name of the Global Table using the Code Editor.

For the bigger issue, the problem is a timing issue with when the recipe table is updated internally in the FluidMixer. The problem is the FluidMixer has already set some data for the first step of a recipe by the time the OnEmpty trigger fires, so the next batch is using old data for its first step.

The solution is to either create a dummy Step 1 in the Mixer Steps, or send the message before the last step has finished its delay time. Both of these solutions are done in the Steps tab of the FluidMixer.

For the first solution, just add a dummy Step 1 in the Mixer Steps table with a Delay of 0. Then set up steps 1 through 4 as steps 2 through 5 instead. And in the Mixer Recipe table, add 1 to each ingredients Step column, so they use steps 2 through 4 instead.

The other solution would be to go into the Code Editor for the Before Step Delay trigger and add this code:

// If the delay for the last step is starting, send the message.
if (getvarnum(current, "curstep") == getvarnode(current, "currentsteptable").as(Table).numRows)
	sendmessage(current, current);

Be sure to add any parameters you want to use in the OnMessage trigger as part of the sendmessage() command. For instance, in your model you are sending a 1 as the first message parameter, so something similar would be:

sendmessage(current, current, 1);

You'll also want to remove the OnEmpty trigger so it doesn't send another message after the mixer is emptied.

· 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 ·

Has there been any update on the Update Recipe Table dropdown menu? I cannot get this entry to stay filled in, no matter if I hard code the table or not. Are there any workarounds? Is there a line of code to manually set the recipe table? Thanks!

0 Likes 0 ·