<?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 get process time of an instance from its tree ? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511109#M24175</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;BR /&gt;&lt;BR /&gt;You said "If the processing time is constantly changing, then in the code for the processing time, tell it to change a label on the processor"&lt;BR /&gt;&lt;BR /&gt;How would I do that? &lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2019 18:45:19 GMT</pubDate>
    <dc:creator>gabriel_dom2</dc:creator>
    <dc:date>2019-05-02T18:45:19Z</dc:date>
    <item>
      <title>How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511104#M24170</link>
      <description>&lt;P&gt;Hello !&lt;/P&gt;
&lt;P&gt;I would like to store the total processing time of each instance of my machines. &lt;/P&gt;
&lt;P&gt;I used to do it with a statistics collector but all the state times are already registered in each instance's tree under the path: "instance/stats/state_current/profile".&lt;/P&gt;
&lt;P&gt;Is it possible to access the processíng time stored in the instance's tree from the model, for instance from the instance's Exit trigger ?&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 11:56:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511104#M24170</guid>
      <dc:creator>sebastien_b49</dc:creator>
      <dc:date>2019-03-05T11:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511105#M24171</link>
      <description>&lt;P&gt;You can use this code&lt;/P&gt;
&lt;PRE&gt;executefsnode(getvarnode(Model.find("Processor1"), "cycletime"),0);&lt;/PRE&gt;
&lt;P&gt;The node for processing time is a script node, so this executes the script in that node and returns the processing time, but only if the processing time was a set number, not based off the item's type or such. If the processing time is constantly changing, then in the code for the processing time, tell it to change a label on the processor and read that label on the instances exit trigger.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 22:37:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511105#M24171</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2019-03-05T22:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511106#M24172</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;I actually meant the processing time in the stats node.&lt;/P&gt;
&lt;P&gt;Can it also be retrieved ?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="17712-processingtime.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1498725iA3681F72F865677A/image-size/large?v=v2&amp;amp;px=999" role="button" title="17712-processingtime.png" alt="17712-processingtime.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 07:55:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511106#M24172</guid>
      <dc:creator>sebastien_b49</dc:creator>
      <dc:date>2019-03-06T07:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511107#M24173</link>
      <description>&lt;PRE&gt;Object processor = Model.find("Processor1");
return processor.stats.state().getTotalTimeAt("processing");
&lt;/PRE&gt;From the On Exit trigger:
&lt;PRE&gt;current.stats.state().getTotalTimeAt("processing")
&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Mar 2019 21:50:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511107#M24173</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2019-03-07T21:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511108#M24174</link>
      <description>&lt;P&gt;Great ! Thank you phil ! I did not know of the method.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 08:07:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511108#M24174</guid>
      <dc:creator>sebastien_b49</dc:creator>
      <dc:date>2019-03-08T08:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511109#M24175</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;BR /&gt;&lt;BR /&gt;You said "If the processing time is constantly changing, then in the code for the processing time, tell it to change a label on the processor"&lt;BR /&gt;&lt;BR /&gt;How would I do that? &lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 18:45:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511109#M24175</guid>
      <dc:creator>gabriel_dom2</dc:creator>
      <dc:date>2019-05-02T18:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511110#M24176</link>
      <description>&lt;P&gt;This picture illustrates what I was referencing. In this case an item coming in already has a label on it that is changing the Process time, but in the code for the Process Time, you can add a line, in this case &lt;/P&gt;
&lt;PRE&gt;current.ProcessTime=item.ProcessTime;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="18912-capture.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1498728iA30640BCCB1B35CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="18912-capture.png" alt="18912-capture.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 19:14:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511110#M24176</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2019-05-02T19:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511111#M24177</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;BR /&gt;&lt;BR /&gt;Thanks for the quick answer!&lt;BR /&gt;&lt;BR /&gt;What if I have a situation of 'process time by case' where for every case I have a statistical distribution? &lt;BR /&gt;What I want is to get the process time value generated by the distribution so I can use it to change a keyframe variable for the animation of the processor. &lt;BR /&gt;&lt;BR /&gt;In the end what I'm trying to accomplish is to make a progress bar that works for any time generated by the process time distribution... &lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 19:20:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511111#M24177</guid>
      <dc:creator>gabriel_dom2</dc:creator>
      <dc:date>2019-05-02T19:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511112#M24178</link>
      <description>&lt;P&gt;If I use 'getvarstr(current, "cycletime")' it gives me the actual code that generates the value I want... Since I'm not a coder I don't know how to get it lol&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 19:23:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511112#M24178</guid>
      <dc:creator>gabriel_dom2</dc:creator>
      <dc:date>2019-05-02T19:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511113#M24179</link>
      <description>&lt;P&gt;
	The item itself stores its processing time. You don't need to store it manually on a label as Joshua suggested. You can get it with the command getitemvar(item, 2).&lt;/P&gt;&lt;P&gt;
	You can use the following code snippet to calculate a percentage of how complete a flowitem's processing time is:&lt;/P&gt;
&lt;PRE&gt;treenode item = Model.find("Processor1").first;

double startTime = getitemvar(item, 1);
double totalProcessingTime = getitemvar(item, 2);
return (time() - startTime) / totalProcessingTime;
&lt;/PRE&gt;&lt;P&gt;
	Also, going forward, please post new questions as a new question instead of a comment to an existing question that has an accepted answer. See &lt;A href="https://answers.flexsim.com/articles/22192/best-practices-for-using-this-answers-site.html"&gt;Best practices for using this Answers site&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 19:28:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511113#M24179</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2019-05-02T19:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to get process time of an instance from its tree ?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511114#M24180</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/206/phil.b.html" nodeid="206"&gt;@phil.bobo&lt;/A&gt;,&lt;/P&gt;
 &lt;P&gt;I tried using this code also for getting the "scheduled down" time of a Sink, but it does not work, although the arborescence in the tree is the same. Is there any reason ?&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Apr 2020 07:33:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-get-process-time-of-an-instance-from-its-tree/m-p/13511114#M24180</guid>
      <dc:creator>sebastien_b49</dc:creator>
      <dc:date>2020-04-28T07:33:38Z</dc:date>
    </item>
  </channel>
</rss>

