question

Rambabu avatar image
0 Likes"
Rambabu asked Jason Lightfoot edited

How to get the different recipes output from mixer.

Hi flexsimers,

I have a query on mixing the ingredient in different proportions to make different recipes using mixer. In my model I am using mixer to mix four ingredients and make four different recipes. The ratio of ingredients to be mixed are taken in the global table. Is there any solution?

I am attaching the model here: mixing ingredients.fsm

Thankyou.


FlexSim 23.1.3
fluid mixerrecipe tablemixer recipe
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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

Just write to the table which is found at:

  1. Table recipetable = getvarnode(current,"recipetable");

Then read the values from the global table with your format you'll need something like:

  1. Table recipeTable=getvarnode(Model.find("FluidMixer1"),"recipetable");
  2. Table globRecipes=Table("RecipesTable");
  3. string newRecipe="Recipe2";
  4. for (int n=globRecipes.numCols;n>0;n--){
  5.     string ingredient=globRecipes.getColHeader(n);
  6.     int row=recipeTable.getRowByKey(ingredient,1);
  7.     recipeTable[row]["Amount"]=globRecipes[newRecipe][n];
  8. }

But you need to change the ingredient names to match those of the mixer. Example attached.

Note you can also choose the option to update from a global table on the triggers, but that relies on your table format matching what the trigger expects.

mixing-ingredients_jl.fsm



· 4
5 |100000

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