<?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: Custom state in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580007#M78281</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/75064-try-3.fsm" target="_blank"&gt;try 3.fsm&lt;/A&gt;Check this model. This will solve your problem.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Pls, go through the model and understand the changes I made to your original model&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Sun, 22 Oct 2023 16:39:39 GMT</pubDate>
    <dc:creator>shivanna_vinay4</dc:creator>
    <dc:date>2023-10-22T16:39:39Z</dc:date>
    <item>
      <title>Custom state</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580001#M78275</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 23.2.1 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hi all,&lt;/P&gt;
 &lt;P&gt;I am using process flow and dashboards to indicate when my two processors are faulty and when they are being repaired (I have attached my model). I have two questions in this regard:&lt;BR /&gt;1) the state of my machine doesn't change after the process time changes. I want this event to be shown in my states bar and state Gantt in some type of way like "faulty process". I read many sources to see if I can define a new state myself but apparently it is not possible. An easy way to do so is to use a default state and just rename it for the dashboards. In my case I chose "off-shift" state and changed it to "faulty processing" but it is still not showing anything. Am I doing this the right way?&lt;BR /&gt;2) The logic I had in mind was that once the machine is repaired, the process time reverts back to normal right away. However, in my model processing with longer process time continues until the product leaves the machine and then it resets the process time. Is there a way I can prevent this from happening?&lt;/P&gt;
 &lt;P&gt;Thank you!&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1695942120967.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520310i9E5E65E3CF7F965A/image-size/large?v=v2&amp;amp;px=999" role="button" title="1695942120967.png" alt="1695942120967.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/74270-processs-flow-faults-autosave.fsm" target="_blank"&gt;processs flow faults_autosave.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 28 Sep 2023 23:02:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580001#M78275</guid>
      <dc:creator>arn-k</dc:creator>
      <dc:date>2023-09-28T23:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom state</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580002#M78276</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;When items are processed by the processor it will by default be in STATE_PROCESSING. This is set for each item that enters - your setting the state once at the time of the fault will be overridden by the next item's process start (actually as soon as an item enters or finsihes setup, processing or exits).&lt;/P&gt;&lt;P&gt;You can investigate use a custom state profile to record parallel states to indicate normal processing or processing with a fault.  &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/questions/151400/what-is-the-difference-between-people-settings-and.html#comment-151414" target="_blank"&gt;Here's a comment on another post &lt;/A&gt;describing this a little more.&lt;/P&gt;&lt;P&gt;Also - rather than have 3 (or more) process flows - one for each fault, and parameterise those, I would create a fault table on the object and have a single object process flow that reads and processes the fault information. This then is much more scalable and manageable.&lt;/P&gt;&lt;P&gt;Also note that by modelling the fault generation in this way you're unable to say that the time between faults is based on the time in processing state (the MTBF/MTTR object has this) and so they can happen while idle - at any time. It also means that two faults can occur at the same time and I then wonder if that would result in another slower process time than the 60 you have for Processor 2.&lt;/P&gt;&lt;P&gt;For example the label on processor 2 could contain this fault table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1695970272892.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520302i6F6FB74C36CA9E0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="1695970272892.png" alt="1695970272892.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Sep 2023 06:51:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580002#M78276</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-09-29T06:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Custom state</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580003#M78277</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Thank you so much &lt;A rel="user" href="https://answers.flexsim.com/users/226/jason.l.html" nodeid="226"&gt;@Jason Lightfoot&lt;/A&gt; for your help,&lt;/P&gt;
 &lt;P&gt;can you please attach this FlexSim file containing the table as well? thanks&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Sep 2023 17:50:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580003#M78277</guid>
      <dc:creator>arn-k</dc:creator>
      <dc:date>2023-09-29T17:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Custom state</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580004#M78278</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Attached is the model with the table on Processor 2. I've also added that processor to an &lt;A rel="noopener noreferrer" href="https://docs.flexsim.com/en/23.2/ModelLogic/AdditionalConcepts/ProcessFlowInstances/ProcessFlowInstances.html" target="_blank"&gt;Object Process Flow &lt;/A&gt;called "Processor Faults" so that I could show you how to set that up to create a token for each fault for each processor and read the information from the table.&lt;/P&gt;&lt;P&gt;The big difference you will see is that instead of &lt;EM&gt;getstream(activity) &lt;/EM&gt;I'm using &lt;EM&gt;labelStream(c)&lt;/EM&gt; which is a user command I created. The reason is that when the expression to be samples is stored on a token's label (toggled as Flexscript) it doesn't know what &lt;EM&gt;activity &lt;/EM&gt;means so instead I've added commands to use the label to find the activity and processor and create a stream based on that combination. It's related to overriding the getstream() function which I describe &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/articles/148584/getstream-override-to-accept-variants-fsl-autoinst.html" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The table data is stored in a processor label called FaultDefinitions. You can right click this label and choose 'Explore as Table' to view and edit it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1696084481852.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520304i513977A38F39A700/image-size/large?v=v2&amp;amp;px=999" role="button" title="1696084481852.png" alt="1696084481852.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In the process flow we access that (more easily) using another label on the processor called faultTable that points to it - for example the source quantity is the number of rows in the table:&lt;/P&gt;&lt;PRE&gt;Table(current.faultTable).numRows&lt;/PRE&gt;&lt;P&gt;where 'current' refers to the processor, and we read the expressions for interval and repairTime into labels using:&lt;/P&gt;&lt;PRE&gt;Table(current.faultTable)[tokenIndex]["interval"]&lt;/PRE&gt;&lt;P&gt;Then to sample the interval the syntax is simply&lt;/P&gt;&lt;PRE&gt;token.interval &lt;/PRE&gt;&lt;P&gt;which will yield a different value each time using the correct* stream setup.&lt;/P&gt;&lt;P&gt;I've also added pTime label to each processor so that you know to what value it should be restored when the fault is cleared. You access that value using current.pTime since current refers to the processor.&lt;/P&gt;&lt;P&gt;I've just set up delays to test the sampling:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1696085458355.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520303iCD185DA2B090E5AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="1696085458355.png" alt="1696085458355.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but you should insert the rest of your logic and change the values to use those of the token or processor (current).&lt;/P&gt;&lt;P&gt;Note that the token should be retained since it has the information from which to sample the interarrival times. If you want that to be independant from the other activities that just have a simple loop for the interval delay that creates a token for the rest of the process&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1696085445204.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1520306iC3FCCF5481784AA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="1696085445204.png" alt="1696085445204.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/74314-processs-flow-faults-autosave-jl.fsm" target="_blank"&gt;processs-flow-faults-autosave_jl.fsm&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 30 Sep 2023 14:47:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580004#M78278</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-09-30T14:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Custom state</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580005#M78279</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;I've not added Processor1 to the object flow, I've left that for you to do and become familiar with.&lt;/DIV&gt;</description>
      <pubDate>Sat, 30 Sep 2023 14:58:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580005#M78279</guid>
      <dc:creator>jason_lightfoot_adsk</dc:creator>
      <dc:date>2023-09-30T14:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Custom state</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580006#M78280</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/43006/arn-k.html" nodeid="43006"&gt;@arn-k&lt;/A&gt;, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 04 Oct 2023 17:21:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580006#M78280</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2023-10-04T17:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Custom state</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580007#M78281</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/75064-try-3.fsm" target="_blank"&gt;try 3.fsm&lt;/A&gt;Check this model. This will solve your problem.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;Pls, go through the model and understand the changes I made to your original model&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 22 Oct 2023 16:39:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580007#M78281</guid>
      <dc:creator>shivanna_vinay4</dc:creator>
      <dc:date>2023-10-22T16:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Custom state</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580008#M78282</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Thank you so much. This works perfectly. 
&lt;/DIV&gt;</description>
      <pubDate>Sun, 22 Oct 2023 17:55:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/custom-state/m-p/13580008#M78282</guid>
      <dc:creator>arn-k</dc:creator>
      <dc:date>2023-10-22T17:55:28Z</dc:date>
    </item>
  </channel>
</rss>

