<?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: How to identify a flow items label in a tote in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525826#M35686</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/8187/joshuas.html" nodeid="8187"&gt;@Joshua S&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Thanks for the code. What does this part of the code do?&lt;/P&gt;
&lt;PRE&gt;Array Types= Array(3);
for (int I=1;I&amp;lt;=3;I++)
{
	Types&lt;I&gt;=Array(0);
}&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;Does this Code means to return the first, second and third value of the Array(3) in the Array Types [1]?&lt;/P&gt;
&lt;PRE&gt;return token.Types[1][creationRank];
&lt;/PRE&gt;
&lt;P&gt;Yes, this is exactly what I want to do. When the 2 object find each other both should move to the combiner. After this the combiner joint them to one object. When one tote is empty, it should be delete so that a new and full tote can arrive. &lt;/P&gt;</description>
    <pubDate>Tue, 12 Jun 2018 06:33:10 GMT</pubDate>
    <dc:creator>sven_e2</dc:creator>
    <dc:date>2018-06-12T06:33:10Z</dc:date>
    <item>
      <title>How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525817#M35677</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.0.3 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&lt;A id="12309" href="https://answers.flexsim.com/storage/attachments/12309-assemblypull.fsm"&gt;assemblypull.fsm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm trying to build an assembly line with several processes. First I give you an overview about my model:&lt;/P&gt;
&lt;P&gt;First of all, orders are generated with individual order numbers and individual types of items/products (this is not part of the example model below).&lt;/P&gt;
&lt;P&gt;Each order has two components which should be assembled. Different types of ComponentTwo are delivered in a tote to the assembly station (every ComponentTwo has an individual OrderNo and Type according to the generated orders). As soon as they arrive at the assembly station, they should trigger the process to produce the corresponding ComponentOne. If ComponentOne is finished it should get labels with the type and orderNo. After this, ComponentOne has to be transported to the assembly station. Now an Operator must search for the ComponentTwo in the tote matching the ComponentOne which has just arrived in that moment. The last step is to join them together and send them to the next process.&lt;/P&gt;
&lt;P&gt;Now my Question(s):&lt;/P&gt;
&lt;P&gt;How can I get the values from the labels of ComponentTwo in the tote? I don´t know how to reference ComponentTwo both for triggering the production of ComponentOne and for finding it once ComponentOne is finished.&lt;/P&gt;
&lt;P&gt;How can I manipulate the Combiner (assembly station) that it is looking for matches of the OrderNo and Types from both Components?&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;A rel="nofollow" href="https://answers.flexsim.com/storage/attachments/12309-assemblypull.fsm"&gt;assemblypull.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 14:12:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525817#M35677</guid>
      <dc:creator>sven_e2</dc:creator>
      <dc:date>2018-06-07T14:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525818#M35678</link>
      <description>&lt;P&gt;I've attached a model that incorporates Process Flow to trigger the creation of ComponentOne objects according to ComponentTwo product types. Let us know if this works. If so, we can find a way to combine both components.&lt;/P&gt;&lt;P&gt;&lt;A id="12316" href="https://answers.flexsim.com/storage/temp/12316-assemblypull-with-new-logic.fsm"&gt;assemblypull-with-new-logic.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jun 2018 19:43:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525818#M35678</guid>
      <dc:creator>tanner_p</dc:creator>
      <dc:date>2018-06-07T19:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525819#M35679</link>
      <description>&lt;P&gt;Thanks, your model works well. Before we will do the next step, I want to get a deeper understanding how the model works. Can you give me a few explanations how the custom code works? Following I try to explain it with my own words.&lt;/P&gt; 
&lt;P&gt;First the default part:&lt;/P&gt; 
&lt;PRE&gt;/**Custom Code*/
Object current = param(1);		
//The current Object is the tote, right?
treenode activity = param(2);
//The treenode activity is the Custom Code? 
Token token = param(3);
//token is the entering token?
treenode processFlow = ownerobject(activity);
// owenerobject(activity) means to get the object which is entering the custom code(activity). In this case the tote?
Array Types= makearray(3);
// This define an array with 3 variables in it?&lt;/PRE&gt; 
&lt;P&gt;I hope this is right so far.&lt;/P&gt; 
&lt;P&gt;Now the for loop. I guess I understand the basically function of the loop. At each loop the expression "I&amp;lt;=&lt;A rel="nofollow noopener noreferrer" href="http://token.Crate.as" target="_blank"&gt;token.Crate.as&lt;/A&gt;(Object).subnodes.length" is executed which controls if the variable "I" is higher than the content in the tote.&lt;/P&gt; 
&lt;P&gt;But I don´t understand how you reference "subnodes.length" and "ComponentTwo" in the if statement. &lt;/P&gt; 
&lt;P&gt;"token.Crate": Crate is the label which was added to the entering item&lt;/P&gt; 
&lt;P&gt;"as(Object)": as access a label from object, which is the tote? The called label is "subnodes&lt;I&gt;"?&lt;/I&gt;&lt;/P&gt; 
&lt;P&gt;"subnodes&lt;I&gt;": subnodes reference the lower ranked object from the tote, which is ComponentTwo with index "I"?&lt;/I&gt;&lt;/P&gt; 
&lt;P&gt;"as(Object)": as access a label from object, which should be ComponentTwo. But variable Object is set to current? At this point I am confused! &lt;/P&gt; 
&lt;P&gt;label["Type"]: is the called label from the as() statement?&lt;/P&gt; 
&lt;PRE&gt;for (int I=1;I&amp;lt;=token.Crate.as(Object).subnodes.length;I++)
{
	if (token.Crate.as(Object).subnodes&lt;I&gt;.as(Object).labels["Type"].value==1)
	{
		Types[1]++;
	}
	if (token.Crate.as(Object).subnodes&lt;I&gt;.as(Object).labels["Type"].value==2)
	{
		Types[2]++;
	}
	if (token.Crate.as(Object).subnodes&lt;I&gt;.as(Object).labels["Type"].value==3)
	{
		Types[3]++;
	}
}
token.Types=Types;

&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt; 
&lt;P&gt;One finally question, so far &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;When the code can gets the label "Type". Is it possible to extend the code that it get also the label "OrderNo"? &lt;/P&gt; 
&lt;P&gt;&lt;/P&gt; 
&lt;PRE&gt; if (token.Crate.as(Object).subnodes&lt;I&gt;.as(Object).labels["Type"].value==1)	
	{
		Types[1]++;
	object involved = token;
	string labelname = OrderNo;
	Variant value = token.Crate.as(Object).subnodes&lt;I&gt;.as(Object).la	bels["orderNo"];
	involved.labels.asser(labelname).value = value;
	}&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt; 
&lt;P&gt;I´m sorry for being so confused. Thanks for your support. &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 10:16:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525819#M35679</guid>
      <dc:creator>sven_e2</dc:creator>
      <dc:date>2018-06-08T10:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525820#M35680</link>
      <description>&lt;P&gt;According to your Code I fund a solution to get access to the label "OrderNo". I created a activity "assign label" with the following code.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;PRE&gt;/**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
Variant assignTo = param(4);
string labelName = param(5);
treenode processFlow = ownerobject(activity);
Variant OrderNo = 0;
for (int I=1;I&amp;lt;=token.Crate.as(Object).subnodes.length;I++)
OrderNo = token.Crate.as(Object).subnodes&lt;I&gt;.as(Object).labels["OrderNo"].value;
return OrderNo;&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;But now every token has the same OrderNo.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 13:34:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525820#M35680</guid>
      <dc:creator>sven_e2</dc:creator>
      <dc:date>2018-06-08T13:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525821#M35681</link>
      <description>&lt;A rel="user" href="https://answers.flexsim.com/users/8689/svene2.html" nodeid="8689"&gt;@Sven E2&lt;/A&gt;
&lt;P&gt;You have the first part of the code figured out. You have most of the other parts figured out to.&lt;/P&gt;
&lt;P&gt;This code is a rather long reference. &lt;/P&gt;
&lt;PRE&gt;token.Crate.as(Object).subnodes&lt;I&gt;.as(Object).labels["Type"].value&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;token.Crate= grab the Crate that is referenced by the label on the token.&lt;/P&gt;
&lt;P&gt;as(Object)= this is used so the code recognizes that the object I want to reference is referenced as an "Object" class and allows me to access "Object" values such as location, size, subnodes, and other values.&lt;/P&gt;
&lt;P&gt;subnodes&lt;I&gt;= references the Ith Product inside the Tote.&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;as(Object)= does as mentioned above&lt;/P&gt;
&lt;P&gt;label["Type"].value= is referencing the value of the label "Type" on the Product.&lt;/P&gt;
&lt;P&gt;You can definitely get the label "OrderNo", my question is what do you want to do with that label?&lt;/P&gt;
&lt;P&gt;If you want to assign it to a token ,you just have to use this line.&lt;/P&gt;
&lt;PRE&gt;token.OderNo=token.Crate.as(Object).subnodes&lt;I&gt;.as(Object).labels["OrderNo"].value&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;But there are 3 OrderNo's for 1 token, do you want them assigned to the objects created at the processors? &lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 14:39:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525821#M35681</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2018-06-08T14:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525822#M35682</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/8187/joshuas.html" nodeid="8187"&gt;@Joshua S&lt;/A&gt;, You don't actually need the casts to Object in this example. The subnodes and labels properties are on the treenode class.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 15:49:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525822#M35682</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-06-08T15:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525823#M35683</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/8689/svene2.html" nodeid="8689"&gt;@Sven E2&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;With &lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt;'s advice, you can shorten a lot of your references to &lt;/P&gt;
&lt;PRE&gt;token.Crate.subnodes&lt;I&gt;.labels["Type"].value&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;rather then the much longer reference.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 16:01:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525823#M35683</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2018-06-08T16:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525824#M35684</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;A rel="nofollow" href="https://answers.flexsim.com/questions/51830/how-to-identify-a-flow-items-label-in-a-tote.html#"&gt;@Joshua S&lt;/A&gt; and &lt;A rel="nofollow" href="https://answers.flexsim.com/questions/51830/how-to-identify-a-flow-items-label-in-a-tote.html#"&gt;@Matthew Gillespie&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks for the explanations. &lt;/P&gt;
&lt;P&gt;Yes, I want to assign the label "OrderNo" to the object created at the processor. I tried to solve the Problem with the multiple OrderNo´s for 1 token with the following code. But I failed.&lt;/P&gt;
&lt;PRE&gt;Array OrderNo= makearray(4);
for (int I=1;I&amp;lt;=token.Crate.subnodes.length;I++)
{
OrderNo&lt;I&gt; = token.Crate.subnodes&lt;I&gt;.labels["OrderNo"].value;
}
token.OrderNo=OrderNo;
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;It´s necessary for the original model to assign the label OrderNo to the created objects (ComponentOne). The first reason is, that not every "ComponentOne Type 1" has the same properties. But I don´t want to build this complexity in my model. The second reason is, that there are several assembly stations in my model, as you can see I the extended version I attached. It´s quite enough that the right ComponentOne Type 1 finds the right ComponentTwo Type1, which I want to mange with the OrderNo.&lt;/P&gt;
&lt;P&gt;Do you have an idea how to solve this?&lt;/P&gt;
&lt;P&gt;assemblypullextended.fsm &lt;/P&gt;</description>
      <pubDate>Sat, 09 Jun 2018 15:55:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525824#M35684</guid>
      <dc:creator>sven_e2</dc:creator>
      <dc:date>2018-06-09T15:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525825#M35685</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/8689/svene2.html" nodeid="8689"&gt;@Sven E2&lt;/A&gt; Made some changes to the code so now all the token have the OrderNo assigned to them and the created items have the right OrderNo assigned to the them as well&lt;A id="12379" href="https://answers.flexsim.com/storage/temp/12379-12340-assemblypullextended.fsm"&gt;12340-assemblypullextended.fsm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;So for the Combiner logic, you want the 2 objects to find each other, one from the Buffer assembly Queue, and one from the Component Queues?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 16:36:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525825#M35685</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2018-06-11T16:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525826#M35686</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/8187/joshuas.html" nodeid="8187"&gt;@Joshua S&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Thanks for the code. What does this part of the code do?&lt;/P&gt;
&lt;PRE&gt;Array Types= Array(3);
for (int I=1;I&amp;lt;=3;I++)
{
	Types&lt;I&gt;=Array(0);
}&lt;/I&gt;&lt;/PRE&gt;
&lt;P&gt;Does this Code means to return the first, second and third value of the Array(3) in the Array Types [1]?&lt;/P&gt;
&lt;PRE&gt;return token.Types[1][creationRank];
&lt;/PRE&gt;
&lt;P&gt;Yes, this is exactly what I want to do. When the 2 object find each other both should move to the combiner. After this the combiner joint them to one object. When one tote is empty, it should be delete so that a new and full tote can arrive. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 06:33:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525826#M35686</guid>
      <dc:creator>sven_e2</dc:creator>
      <dc:date>2018-06-12T06:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525827#M35687</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://answers.flexsim.com/users/8187/joshuas.html" nodeid="8187"&gt;@Joshua S&lt;/A&gt; Maybe I found a solution to combine the 2 objects and destroy the tote &lt;A id="12404" href="https://answers.flexsim.com/storage/temp/12404-assemblycombinerlogic.fsm"&gt;assemblycombinerlogic.fsm&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;How you can see, the push to list logic looks a bit messy. But it works. If you have a better idea or know how to improve the model/logic please let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 10:16:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525827#M35687</guid>
      <dc:creator>sven_e2</dc:creator>
      <dc:date>2018-06-12T10:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to identify a flow items label in a tote</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525828#M35688</link>
      <description>&lt;P&gt;The first section of the code creates an array of arrays, so that each item type that is in the tote pushes the OrderNo to an array. The second code snippet does exactly what you think it does. the only suggestion I have is to fix are the exceptions that occur at your "Decide Crate 1 or Crate 2" activity. I believe an exception is being raised because you are trying to access a second node but that node doesn't exist yet.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 14:37:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-identify-a-flow-items-label-in-a-tote/m-p/13525828#M35688</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2018-06-12T14:37:38Z</dc:date>
    </item>
  </channel>
</rss>

