<?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: Can we create a background thread in FlexSim that do some tasks once a second? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543798#M49961</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/15277/yuey.html" nodeid="15277"&gt;@Yue Y&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Here is how I added a new node into the Tools folder (via right-click on the Tools node, but would work for any parent node):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19780-2019-06-10-16-16-21.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1499334i15F84EF4CD15CC31/image-size/large?v=v2&amp;amp;px=999" role="button" title="19780-2019-06-10-16-16-21.png" alt="19780-2019-06-10-16-16-21.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is how I added ability to add text to the node:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19781-2019-06-10-16-16-22.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1499336i58638341724B9D8B/image-size/large?v=v2&amp;amp;px=999" role="button" title="19781-2019-06-10-16-16-22.png" alt="19781-2019-06-10-16-16-22.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is how I toggled the node to be a FlexScript node:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19782-2019-06-10-16-18-57-flexsim-2019.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1499337i31BAC64A7444E48F/image-size/large?v=v2&amp;amp;px=999" role="button" title="19782-2019-06-10-16-18-57-flexsim-2019.png" alt="19782-2019-06-10-16-18-57-flexsim-2019.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2019 22:08:21 GMT</pubDate>
    <dc:creator>Ben_WilsonADSK</dc:creator>
    <dc:date>2019-06-10T22:08:21Z</dc:date>
    <item>
      <title>Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543783#M49946</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.1.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I want to create a thread and let FlexSim report some data to another server once a second. Is it possible to create a separate thread that does this job?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 20:38:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543783#M49946</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-04T20:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543784#M49947</link>
      <description>&lt;P&gt;To create a thread you would have to use C++. See &lt;A href="https://answers.flexsim.com/questions/67556/is-flexsim-thread-safe.html?childToView=67589#answer-67589"&gt;this answer&lt;/A&gt; for an example of using a thread.&lt;/P&gt;&lt;P&gt;You might be able to do this with the &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/19.1/Reference/CodingInFlexSim/CommandReference/Commands.html#setticker" target="_blank"&gt;setticker(node thenode[, num tickspersecond])&lt;/A&gt; command.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 21:45:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543784#M49947</guid>
      <dc:creator>Jacob_Gillespie</dc:creator>
      <dc:date>2019-06-04T21:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543785#M49948</link>
      <description>&lt;P&gt;Thank you Jacob, any tutorial on writing C++ in FlexSim?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 21:48:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543785#M49948</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-04T21:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543786#M49949</link>
      <description>&lt;P&gt;Also, I am not looking for the exact thread concept. Anything with the behavior that executes a FlexScript snippet once a second on the side is enough&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 21:52:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543786#M49949</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-04T21:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543787#M49950</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/15277/yuey.html" nodeid="15277"&gt;@Yue Y&lt;/A&gt; That's what setticker() does. It executes a flexscript / cpp node x times per second.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 21:55:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543787#M49950</guid>
      <dc:creator>Jacob_Gillespie</dc:creator>
      <dc:date>2019-06-04T21:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543788#M49951</link>
      <description>&lt;P&gt;Is this command executed separately from the the simulation process? Will it block the whole simulation?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 22:00:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543788#M49951</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-04T22:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543789#M49952</link>
      <description>&lt;P&gt;Yes it will block&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 22:03:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543789#M49952</guid>
      <dc:creator>Jacob_Gillespie</dc:creator>
      <dc:date>2019-06-04T22:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543790#M49953</link>
      <description>&lt;P&gt;Will it block between two execution or it will only block during execution?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 22:06:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543790#M49953</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-04T22:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543791#M49954</link>
      <description>&lt;P&gt;It will block only during execution, not between.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 22:08:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543791#M49954</guid>
      <dc:creator>Jacob_Gillespie</dc:creator>
      <dc:date>2019-06-04T22:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543792#M49955</link>
      <description>&lt;P&gt;Here are some links about using c++:&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/questions/36634/running-compiled-model-c-in-a-pc-without-visual-st.html" target="_blank"&gt;Running compiled model C++ in a pc without Visual Studio&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/questions/51710/how-to-get-started-with-c.html" target="_blank"&gt;How to get started with C++?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 22:20:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543792#M49955</guid>
      <dc:creator>Jacob_Gillespie</dc:creator>
      <dc:date>2019-06-04T22:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543793#M49956</link>
      <description>&lt;P&gt;Could you give an example of using setticker? Especially what does the first parameter look like?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 17:31:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543793#M49956</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-10T17:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543794#M49957</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/15277/yuey.html" nodeid="15277"&gt;@Yue Y&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Please find attached a sample model showing usage for setticker(). In my testing, it appears that the tickspersecond parameter must be &amp;gt;=1.&lt;/P&gt;&lt;P&gt;Call setticker() after the model run has started - for instance on some object or model trigger, or on a scheduled user event.&lt;/P&gt;&lt;P&gt;&lt;A id="19779" href="https://answers.flexsim.com/storage/temp/19779-setticker-example.fsm"&gt;setticker-example.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 20:03:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543794#M49957</guid>
      <dc:creator>Ben_WilsonADSK</dc:creator>
      <dc:date>2019-06-10T20:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543795#M49958</link>
      <description>&lt;P&gt;Thank you Ben! I am running the example you provided, is there a way to stop this script programmably or manually? &lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 20:14:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543795#M49958</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-10T20:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543796#M49959</link>
      <description>&lt;P&gt;I found it in the user manual: &lt;/P&gt;
&lt;DIV style="display: inline !important;"&gt;
 setticker(0) can be used to turn off the execution
&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Jun 2019 20:17:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543796#M49959</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-10T20:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543797#M49960</link>
      <description>&lt;P&gt;Hi Ben &lt;A rel="user" href="https://answers.flexsim.com/users/9/benjaminwilson.html" nodeid="9"&gt;@Ben Wilson&lt;/A&gt;, how did you add the ticketLogic in Tools folder?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 20:37:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543797#M49960</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-10T20:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543798#M49961</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/15277/yuey.html" nodeid="15277"&gt;@Yue Y&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Here is how I added a new node into the Tools folder (via right-click on the Tools node, but would work for any parent node):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19780-2019-06-10-16-16-21.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1499334i15F84EF4CD15CC31/image-size/large?v=v2&amp;amp;px=999" role="button" title="19780-2019-06-10-16-16-21.png" alt="19780-2019-06-10-16-16-21.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is how I added ability to add text to the node:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19781-2019-06-10-16-16-22.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1499336i58638341724B9D8B/image-size/large?v=v2&amp;amp;px=999" role="button" title="19781-2019-06-10-16-16-22.png" alt="19781-2019-06-10-16-16-22.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is how I toggled the node to be a FlexScript node:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19782-2019-06-10-16-18-57-flexsim-2019.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1499337i31BAC64A7444E48F/image-size/large?v=v2&amp;amp;px=999" role="button" title="19782-2019-06-10-16-18-57-flexsim-2019.png" alt="19782-2019-06-10-16-18-57-flexsim-2019.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 22:08:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543798#M49961</guid>
      <dc:creator>Ben_WilsonADSK</dc:creator>
      <dc:date>2019-06-10T22:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543799#M49962</link>
      <description>&lt;P&gt;The command executes the node for "tickspersecond" times every second of physical time. Is there any similar function that works for simulation time(eg. execute once every 5 simulation time units)? I am considering using physical time x speed in this function but if the simulation is stopped or blocked, this function will still be executed. Any other command that I can use?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 12:48:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543799#M49962</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-11T12:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543800#M49963</link>
      <description>&lt;P&gt;If you want to repeatedly execute a function in simulation time, use a repeating User Event:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="19801-userevent-repeat.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1499338iFE183ABCC522AEF2/image-size/large?v=v2&amp;amp;px=999" role="button" title="19801-userevent-repeat.png" alt="19801-userevent-repeat.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 14:22:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543800#M49963</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2019-06-11T14:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543801#M49964</link>
      <description>&lt;P&gt;Could you please give an example of creating an user event that can execute custom code repeatedly in FlexScript? Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 14:39:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543801#M49964</guid>
      <dc:creator>yue_y</dc:creator>
      <dc:date>2019-06-11T14:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can we create a background thread in FlexSim that do some tasks once a second?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543802#M49965</link>
      <description>&lt;P&gt;I did in the screenshot above. It executes the Event Code repeatedly.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a user event&lt;/LI&gt;&lt;LI&gt;Check the "Repeat event" box&lt;/LI&gt;&lt;LI&gt;Specify the Repeat Event Time&lt;/LI&gt;&lt;LI&gt;Edit the Event Code&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This is a standard toolbox item. You just use it. No example is needed.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 14:57:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/can-we-create-a-background-thread-in-flexsim-that-do-some-tasks/m-p/13543802#M49965</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2019-06-11T14:57:16Z</dc:date>
    </item>
  </channel>
</rss>

