question

michela-08 avatar image
0 Likes"
michela-08 asked Jacob W2 edited

Update Target Quantity

In my model, I am using 5 combiners and 5 Queues. I am using the Join mode. In the combiner tab of each combiner, I want to update target quantity of each combiner using global table which is imported from excel sheet. There is an option in "combiner" tab where I am able to update the target quantity based on that specific combiner.

But in my case I want to update combiner target quantity for all the respective combiners using global table for that specific combiner's name from a single global table.

How to achieve this?

target_quantity_update.fsm

FlexSim 22.2.3
combinertarget quantity
· 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.

Jacob W2 avatar image
0 Likes"
Jacob W2 answered Jacob W2 edited

Hi @michela_08,

In my attached model I have set up an "on reset" trigger on combiner 5. This trigger runs the following code block

  1. treenode thelist = getvarnode(current,"componentlist");
  2. treenode thesum = getvarnode(current,"targetcomponentsum");
  3. setnodenum(thesum,Table("Combiner_Quantity")[current.name][1]);
  4. setnodenum(cellrowcolumn(thelist,1,1),Table("Combiner_Quantity")[current.name][1]);

This code finds the nodes for the combiners' target quantity, and then sets the value in the nodes to be whatever value that combiner should have according to the table value.

The following link also explains more about this code.

https://answers.flexsim.com/questions/70097/update-combiner-target-quantity-by-code-when-the-l.html

target-quantity-update_JW.fsm


· 9
5 |100000

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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

There is a standard procedure to update components lists in combiners. It is a template, which copies columns of a global table to nodes in the tree of a combiner to replace a component list, which you can also edit manually from properties panels.

You can adjust this code to update the involved tree nodes like it is suggested at many places here at this forum by label values -

OR you can update the global table cell values in an assign structure and let handle updating a component list by the standard procedure.

If you want to get the standard procedure work successfully you only have to update the involved global table cell values before an item is entering a combiner through input port number one.

5 |100000

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