<?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 Which are the commands to update the start/warm up/stop time? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534790#M42864</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;In the past, I tried to update the values directly from the tree by code, but it didn't work as I expected. &lt;/P&gt;
&lt;P&gt;I want that a user can choose some values and based on them, update all those times. &lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2020 15:00:59 GMT</pubDate>
    <dc:creator>manuel_s4</dc:creator>
    <dc:date>2020-02-18T15:00:59Z</dc:date>
    <item>
      <title>Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534790#M42864</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;In the past, I tried to update the values directly from the tree by code, but it didn't work as I expected. &lt;/P&gt;
&lt;P&gt;I want that a user can choose some values and based on them, update all those times. &lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 15:00:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534790#M42864</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2020-02-18T15:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534791#M42865</link>
      <description>&lt;P&gt;Do you have a model that you are working on that would demonstrate what you are trying to achieve?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 17:43:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534791#M42865</guid>
      <dc:creator>zac_h_adsk</dc:creator>
      <dc:date>2020-02-18T17:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534792#M42866</link>
      <description>&lt;P&gt;I don't have any, those are specification to modules that I develop, but let me develop one. and I'll upload it.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 20:17:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534792#M42866</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2020-02-18T20:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534793#M42867</link>
      <description>&lt;P&gt;I'm attaching you an example of what I want to do, basically I want the commands that will update the start, stop time in simulation.Thanks.&lt;/P&gt;
&lt;P&gt;&lt;A id="25751" href="https://answers.flexsim.com/storage/temp/25751-update-start-stop-warm-up-time.fsm"&gt;update-start-stop-warm-up-time.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 20:35:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534793#M42867</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2020-02-18T20:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534794#M42868</link>
      <description>&lt;P&gt;&lt;STRONG&gt;20.0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This is much easier to do in version 20.0 since we added the DateTime.compose() method:&lt;/P&gt;&lt;PRE&gt;Table times = Table("GlobalTable1");
int row = 1;

int hour = times[row][4];
int day = times[row][1];
int month = times[row][2];
int year = times[row][3];

double startTime = DateTime.compose(year, month, day, hour, 0, 0, 0);
getmodelunit(START_TIME_NODE).value = startTime;
&lt;/PRE&gt;&lt;P&gt;&lt;B&gt;Before version 20.0&lt;/B&gt;&lt;/P&gt;&lt;P&gt;You can use the convert command to do this . *Note that this method uses the time formats defined in model settings. &lt;/P&gt;&lt;P&gt;&lt;A id="25753" href="https://answers.flexsim.com/storage/attachments/25753-starttimedashboard.fsm"&gt;starttimedashboard.fsm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For the &lt;STRONG&gt;Start Time&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;Table times = Table("GlobalTable1");
int row = 1;

int hour = times[row][4];
int day = times[row][1];
int month = times[row][2];
int year = times[row][3];

string timeString =  (hour &amp;lt; 10 ? "0" : "") + string.fromNum(hour) + ":00:00 ";
string dateString = (day &amp;lt; 10 ? "0" : "") + string.fromNum(day) + "/" + (month &amp;lt; 10 ? "0" : "") + string.fromNum(month) + "/" + string.fromNum(year);

treenode startTime = getmodelunit(START_TIME_NODE);
startTime.value = convert(timeString + dateString, DATETIME_STR, FS_DATETIME);
&lt;/PRE&gt;&lt;P&gt;For the &lt;STRONG&gt;Stop Time&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;Table times = Table("GlobalTable1");
int row = 2;

int hour = times[row][4];
int day = times[row][1];
int month = times[row][2];
int year = times[row][3];

string timeString =  (hour &amp;lt; 10 ? "0" : "") + string.fromNum(hour) + ":00:00 ";
string dateString = (day &amp;lt; 10 ? "0" : "") + string.fromNum(day) + "/" + (month &amp;lt; 10 ? "0" : "") + string.fromNum(month) + "/" + string.fromNum(year);

treenode stopTimeNode = getmodelunit(STOP_TIME_NODE);
stopTimeNode.value = convert(timeString + dateString, DATETIME_STR, FS_DATETIME);

double duration = (getmodelunit(STOP_TIME) - getmodelunit(START_TIME)) / getmodelunit(TIME_MULTIPLE);
stoptime(duration);
&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Feb 2020 21:52:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534794#M42868</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2020-02-18T21:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534795#M42869</link>
      <description>&lt;P&gt;Thank you Matt, as you suggested it's easier in version 20.0. I appreciate your help, thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 13:52:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534795#M42869</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2020-02-19T13:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534796#M42870</link>
      <description>&lt;P&gt;Hello &lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thanks for your answer, now I want to ask about how to change the warm up time. I saw that there's no similar command as stoptime().&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2020 21:29:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534796#M42870</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2020-03-06T21:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534797#M42871</link>
      <description>&lt;P&gt;Here's an example of how to set the warm up time to time 1000:&lt;/P&gt;&lt;PRE&gt;double warmupDuration = 1000;

node("MAIN:/project/exec/warmup").value = warmupDuration;

double warmupT = convert(warmupDuration, MODEL_TIME, FS_DATETIME);
treenode warmupTime = getmodelunit(WARMUP_TIME_NODE);
warmupTime.value = warmupT;
applicationcommand("convertunixtime", warmupTime, warmupTime.value);&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Mar 2020 22:55:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534797#M42871</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2020-03-06T22:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Which are the commands to update the start/warm up/stop time?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534798#M42872</link>
      <description>&lt;P&gt;Thanks, &lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html" nodeid="87"&gt;@Matthew Gillespie&lt;/A&gt;, It's really useful. &lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 20:53:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/which-are-the-commands-to-update-the-start-warm-up-stop-time/m-p/13534798#M42872</guid>
      <dc:creator>manuel_s4</dc:creator>
      <dc:date>2020-03-09T20:53:18Z</dc:date>
    </item>
  </channel>
</rss>

