<?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 Creating a timer to show cycle time in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/creating-a-timer-to-show-cycle-time/m-p/13500149#M15574</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 17.0.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a visual timer that will show the amount of time it takes for a robot to load, unload and load another item. As it stands, I have set up a number label ("Cycle Time Start") on the robot that gets set to the current simulation time when it loads an itemtype 1, and then another label ("Cycle Time End") that gets set when a robot loads an itemtype 2. I then reference and subtract these times using the getlabelnum() command to get a number for the robots cycle time. This method is capable of calculating cycle time, however, I thought it would be more visual for a timer to start when a robot loads an itemtype 1 and end when it loads an itemtype 2. Does anyone know how to do this? I will attach a model of what I currently have now. &lt;/P&gt;
&lt;P&gt;&lt;A rel="nofollow" href="https://answers.flexsim.com/storage/attachments/5892-cycle-time-example.fsm"&gt;cycle-time-example.fsm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2017 17:57:34 GMT</pubDate>
    <dc:creator>jacob_leto1</dc:creator>
    <dc:date>2017-03-22T17:57:34Z</dc:date>
    <item>
      <title>Creating a timer to show cycle time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/creating-a-timer-to-show-cycle-time/m-p/13500149#M15574</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 17.0.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a visual timer that will show the amount of time it takes for a robot to load, unload and load another item. As it stands, I have set up a number label ("Cycle Time Start") on the robot that gets set to the current simulation time when it loads an itemtype 1, and then another label ("Cycle Time End") that gets set when a robot loads an itemtype 2. I then reference and subtract these times using the getlabelnum() command to get a number for the robots cycle time. This method is capable of calculating cycle time, however, I thought it would be more visual for a timer to start when a robot loads an itemtype 1 and end when it loads an itemtype 2. Does anyone know how to do this? I will attach a model of what I currently have now. &lt;/P&gt;
&lt;P&gt;&lt;A rel="nofollow" href="https://answers.flexsim.com/storage/attachments/5892-cycle-time-example.fsm"&gt;cycle-time-example.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 17:57:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/creating-a-timer-to-show-cycle-time/m-p/13500149#M15574</guid>
      <dc:creator>jacob_leto1</dc:creator>
      <dc:date>2017-03-22T17:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a timer to show cycle time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/creating-a-timer-to-show-cycle-time/m-p/13500150#M15575</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/187/jeff.n.html" nodeid="187"&gt;@Jeff Nordgren&lt;/A&gt; any ideas on how to do this? I'm basically trying to create a timer that is started when a robot loads a part of type 1 and then stopped when it loads a part of type 2. &lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 12:22:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/creating-a-timer-to-show-cycle-time/m-p/13500150#M15575</guid>
      <dc:creator>jacob_leto1</dc:creator>
      <dc:date>2017-03-28T12:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a timer to show cycle time</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/creating-a-timer-to-show-cycle-time/m-p/13500151#M15576</link>
      <description>&lt;P&gt;Sorry it took us a while to respond.   So here's what we did to get your label to visually increment during the run time.  (So far it works really with just item 1 but you can tweak it as you need for the rest of your model.)&lt;/P&gt;&lt;P&gt;First we created a label on the Robot called "starttimer" which is set at 0, and we make sure that the Reset labels box is checked.&lt;/P&gt;&lt;P&gt;Then we added a set label command inside your if statements in the OnLoad trigger of the robot.  We set the number of the label to 1 and 2 respectively.&lt;/P&gt;&lt;P&gt;Then in the Cycle Time text display we added this code at the end of your Text Display code&lt;/P&gt;&lt;PRE&gt;double displaytime = 0;


if (involved.labels["starttimer"].value==1)  {
	displaytime = time() - involved.labels["ProcessStartTime"].value;
}
else if (involved.labels["starttimer"].value==2)  {
	displaytime = involved.labels[labelname].value;
}


setnodestr(textnode, concat(starttext, numtostring(displaytime,0,1)));
&lt;/PRE&gt;&lt;P&gt;As you can see it's just a matter of displaying the time() command in the model subtracted by the process time labels you already have created previously.&lt;/P&gt;&lt;P&gt;I've attached the model below for you to see:&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.flexsim.com/storage/attachments/5990-5892-cycle-time-example.fsm"&gt;5892-cycle-time-example.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:32:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/creating-a-timer-to-show-cycle-time/m-p/13500151#M15576</guid>
      <dc:creator>sam_stubbsYXX86</dc:creator>
      <dc:date>2017-03-28T18:32:54Z</dc:date>
    </item>
  </channel>
</rss>

