<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Update Target Quantity in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515279#M27374</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;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 - &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OR&lt;/STRONG&gt; you can update the global table cell values in an assign structure and let handle updating a component list by the standard procedure. &lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 17 Dec 2022 08:39:49 GMT</pubDate>
    <dc:creator>joerg_vogel_HsH</dc:creator>
    <dc:date>2022-12-17T08:39:49Z</dc:date>
    <item>
      <title>Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515268#M27363</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 22.2.3 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;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.&lt;/P&gt;
 &lt;P&gt;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.&lt;/P&gt;
 &lt;P&gt;How to achieve this?&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/61506-target-quantity-update.fsm" target="_blank"&gt;target_quantity_update.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Nov 2022 18:42:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515268#M27363</guid>
      <dc:creator>michela_08</dc:creator>
      <dc:date>2022-11-29T18:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515269#M27364</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/42014/michela-08.html" nodeid="42014"&gt;@michela_08&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;In my attached model I have set up an "on reset" trigger on combiner 5. This trigger runs the following code block&lt;/P&gt;&lt;PRE&gt;treenode thelist = getvarnode(current,"componentlist");
treenode thesum = getvarnode(current,"targetcomponentsum");
setnodenum(thesum,Table("Combiner_Quantity")[current.name][1]);  
setnodenum(cellrowcolumn(thelist,1,1),Table("Combiner_Quantity")[current.name][1]);&lt;/PRE&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;The following link also explains more about this code.&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.flexsim.com/questions/70097/update-combiner-target-quantity-by-code-when-the-l.html"&gt;https://answers.flexsim.com/questions/70097/update-combiner-target-quantity-by-code-when-the-l.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/61515-target-quantity-update-jw.fsm" target="_blank"&gt;target-quantity-&lt;/A&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/61515-target-quantity-update-jw.fsm" target="_blank"&gt;update_JW.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Nov 2022 20:26:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515269#M27364</guid>
      <dc:creator>Jacob_White</dc:creator>
      <dc:date>2022-11-29T20:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515270#M27365</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you 
 &lt;A rel="user" href="https://answers.flexsim.com/users/34862/jacobw2.html" nodeid="34862"&gt;@Jacob W2&lt;/A&gt;, I have few doubts regarding the model.
 &lt;P&gt;In the model, the "Combiner 2" 's target quantity is not changing and is 0 even after running the model. For all other combiner's its updating.&lt;/P&gt;
 &lt;P&gt;What does the code in the script represent? is it only for specific combiner's? Can you please tell me what the code in the script is useful for target quantity?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 30 Nov 2022 06:46:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515270#M27365</guid>
      <dc:creator>michela_08</dc:creator>
      <dc:date>2022-11-30T06:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515271#M27366</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;None of the combiners in the attached model seem to actually have the reset code set. So none of the should be updating when you change the table values.&lt;/P&gt;&lt;P&gt;A combiner has two nodes in its attribute tree that govern how many items are received through each port (starting at rank 2, port 1 always only receives the container item) before the process starts.&lt;/P&gt;&lt;P&gt;Those are the "componentlist" and the "targetcomponentsum" (marked yellow in the screenshot below).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1669808798498.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514172iA445F2FA6C340BDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="1669808798498.png" alt="1669808798498.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The componentlist represents the list you see in the combiner's properties. The value is stored in the "Target Quantity" node (pink)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1669808828026.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514174i09AC1A933F0F4BF0/image-size/large?v=v2&amp;amp;px=999" role="button" title="1669808828026.png" alt="1669808828026.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As such it posesses a subnode structure that can be accessed as a table. The level below the main node represents the rows ("From Input Port 2") and the subnodes of those are the respective cell values (Target Quantity, Current Quantity (not shown in the properties)).&lt;/P&gt;&lt;P&gt;The "targetcomponentsum" is the total sum of items received through all ports. Since there is only one port (port 2) that will receive items, the value of the this node and the "Target Quantity" in the component list are the same.&lt;/P&gt;&lt;P&gt;The code first gets references to the these two nodes. It then assigns the value from the global table to "targetcomponentsum" and "Target Quantity", depending on the name of the object that is executing the code (the combiner).&lt;/P&gt;&lt;P&gt;The code to assign the values comes from older versions of FlexSim. The same can be done with the following using the newer dot-syntax.&lt;/P&gt;&lt;PRE&gt;// Read the target quantity from the global table
int qty = Table("Combiner_Quantity")[current.name][1];
// Get reference to the "componentlist" node as a table class variable
Table thelist = getvarnode(current,"componentlist");
// Get reference to the "targetcomponentsum" node
treenode thesum = getvarnode(current,"targetcomponentsum");
// Set the "Target Quantity" through port 2 (first row, first column) to be equal to the table value
thelist[1][1] = qty;
// Set the value of "targetcomponentsum" to be equal to the table value
thesum.value = qty;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 30 Nov 2022 12:01:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515271#M27366</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2022-11-30T12:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515272#M27367</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Hi 
 &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; 
 &lt;P&gt;A model with the code you stated would be really helpful. It is being difficult for me to understand where to add the code so as to achieve the combiner target quantity.&lt;/P&gt;
 &lt;P&gt;Can you please attach a sample model so as to understand clearly?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Dec 2022 18:11:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515272#M27367</guid>
      <dc:creator>michela_08</dc:creator>
      <dc:date>2022-12-07T18:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515273#M27368</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;As Jacob suggested in his answer, a good place to put the code, if it only has to run once ahead of each simulation run, is the "On Reset" trigger of the combiners.&lt;/P&gt;&lt;P&gt;See Combiner1 in the attached model. I also modified the global table to use the combiner names as row headers, so it is easier to access the correct row from the trigger.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/61892-target-quantity-update-1.fsm" target="_blank"&gt;target-quantity-update_1.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Dec 2022 20:05:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515273#M27368</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2022-12-07T20:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515274#M27369</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you 
 &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; , model is really helpful.
 &lt;P&gt;I have one more doubt, If i had to set combiner target quantity by matching a label?&lt;/P&gt;
 &lt;P&gt;For example, the boxes entering the Queue will have Item_type label as "L" and "H". Suppose the combiner target quantity for "L" is 5 and for "H" is 2. I want the combiner target quantity to be updated based on this item_type label and take the items from the queue based on the item_type label.&lt;/P&gt;
 &lt;P&gt;For item_type = L : Target quantity should be 5&lt;/P&gt;
 &lt;P&gt;For item_type = H : Target quantity should be 2&lt;/P&gt;
 &lt;P&gt;How to do this for the same model?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Dec 2022 07:43:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515274#M27369</guid>
      <dc:creator>michela_08</dc:creator>
      <dc:date>2022-12-08T07:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515275#M27370</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You use the "On Entry" trigger instead. You can actually find the pre-defined option "Update Combiner Component List With Labels" for that trigger, which Jabob's and my code are based on.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1670488021290.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514175iF42E97B5A6B5FA35/image-size/large?v=v2&amp;amp;px=999" role="button" title="1670488021290.png" alt="1670488021290.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The difference is that the code first checks if the item entered through port 1 (so it is the container/main item).&lt;/P&gt;&lt;P&gt;It then sets the component quantity depending on a global table, where each column represents a label value and the rows represent the quantity received through the other ports (rank 2+).&lt;/P&gt;&lt;P&gt;Since the combiners in your model only have two ports, that code can be simplified to what you see below and the rows of the global table can instead be used to refer to the different combiners.&lt;/P&gt;&lt;PRE&gt;if(port == 1)
{
&amp;nbsp; &amp;nbsp; //Determine column based on label
&amp;nbsp; &amp;nbsp; int column = 1;
&amp;nbsp; &amp;nbsp; if(item.Type == "H")
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; column = 2;
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; // Read the target quantity from the global table
&amp;nbsp; &amp;nbsp; int qty = Table("Combiner_Quantity")[current.name][column];
&amp;nbsp; &amp;nbsp; // Get reference to the "componentlist" node as a table class variable
&amp;nbsp; &amp;nbsp; Table thelist = getvarnode(current,"componentlist");
&amp;nbsp; &amp;nbsp; // Get reference to the "targetcomponentsum" node
&amp;nbsp; &amp;nbsp; treenode thesum = getvarnode(current,"targetcomponentsum");
&amp;nbsp; &amp;nbsp; // Set the "Target Quantity" through port 2 (first row, first column) to be equal to the table value
&amp;nbsp; &amp;nbsp; thelist[1][1] = qty;
&amp;nbsp; &amp;nbsp; // Set the value of "targetcomponentsum" to be equal to the table value &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; thesum.value = qty;
}&lt;/PRE&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/61911-target-quantity-update-2.fsm" target="_blank"&gt;target-quantity-update-2.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Dec 2022 08:28:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515275#M27370</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2022-12-08T08:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515276#M27371</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Hi 
 &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; 
 &lt;P&gt;Thank you for the model and explanation. I have one more scenario&lt;/P&gt;
 &lt;P&gt;For one combiner there are 3 input ports.&lt;/P&gt;
 &lt;P&gt;Input port 1 : source &lt;/P&gt;
 &lt;P&gt;Input port 2 : target qty = 2( fixed)&lt;/P&gt;
 &lt;P&gt;Input port 3 : based on the code you have provided above.&lt;/P&gt;
 &lt;P&gt;Note : items coming from port 2 will have Item_type label = L or H.&lt;/P&gt;
 &lt;P&gt;For example, the target qty and targetcomponent sum will be different here. If target qty from port 3 will be 9. Then targetcomponentsum = 12 [ port 1 (1 qty), port 2 (2 qty) , port 3( 9 qty) ]&lt;/P&gt;
 &lt;P&gt;How to do this?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Dec 2022 03:52:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515276#M27371</guid>
      <dc:creator>michela_08</dc:creator>
      <dc:date>2022-12-13T03:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515277#M27372</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Updating the component list when the first item enters through port 2 should work, though you should close the output of the object connected to port 3 until the target was updated.&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/62167-combinertargetport2.fsm" target="_blank"&gt;combinerTargetPort2.fsm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Note that the container item is not part of the targetcomponentsum.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Dec 2022 07:06:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515277#M27372</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2022-12-13T07:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515278#M27373</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/42014/michela-08.html" nodeid="42014"&gt;@michela-08&lt;/A&gt;, was Jacob W2's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 16 Dec 2022 15:48:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515278#M27373</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2022-12-16T15:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515279#M27374</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;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 - &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;OR&lt;/STRONG&gt; you can update the global table cell values in an assign structure and let handle updating a component list by the standard procedure. &lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 17 Dec 2022 08:39:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515279#M27374</guid>
      <dc:creator>joerg_vogel_HsH</dc:creator>
      <dc:date>2022-12-17T08:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update Target Quantity</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515280#M27375</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you 
 &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; 
&lt;/DIV&gt;</description>
      <pubDate>Sat, 17 Dec 2022 10:06:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/update-target-quantity/m-p/13515280#M27375</guid>
      <dc:creator>michela_08</dc:creator>
      <dc:date>2022-12-17T10:06:23Z</dc:date>
    </item>
  </channel>
</rss>

