On State Change - Processor

On State Change - Processor

AMITKUMAR
Not applicable
30 Views
7 Replies
Message 1 of 8

On State Change - Processor

AMITKUMAR
Not applicable

[ FlexSim 20.0.10 ]

In processor while working with trigger on state change i am not getting the option to write on global table which is there for other options like On Entry or On Exit

1681471179242.png

0 Likes
Accepted solutions (1)
31 Views
7 Replies
Replies (7)
Message 2 of 8

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

Then you can try to copy the template source code from a trigger that supports this picklist item.

0 Likes
Message 3 of 8

AMITKUMAR
Not applicable

How should we do that? I want all the options which are available for On Entry trigger or specific one like add row column and add data to global table


Thanks

0 Likes
Message 4 of 8

jason_lightfootVL7B4
Autodesk
Autodesk

How to reference tables and write to their cells. The syntax is :

Table(<tablename>)[<row>][<col>]=<value>

//example:
Table("MyGlobalTable")[1][4]=10;   //writes the value 10 into row 1 column 4 of the global table "MyGlobalTable"

Be careful with onStateChange as you may get many different values being written at the same time. If you're overwriting a cell each time then it should not matter.

0 Likes
Message 5 of 8

jason_lightfootVL7B4
Autodesk
Autodesk

Use a code snippet and refer to the methods and examples of the Table class - it's much simpler than you might think.

0 Likes
Message 6 of 8

AMITKUMAR
Not applicable

I want to write down every time a processor goes into breakdown or blocked mode also want to capture the start time & end time of that state for the machine in a global table

e.g

machin name col1.

state col2

start time col3

end time col4


and number of rows will be added every time the machine goes to blocked or breakdown row is added to global table

0 Likes
Message 7 of 8

joerg_vogel_HsH
Mentor
Mentor
@AMIT KUMAR, You add this picklist option to the on entry trigger. You open the parchment roll icon to open the source code editor. You copy the source code. Then you add an On State Change trigger. You open the source code editor for this trigger by the parchment roll icon. You paste the copied source code.
0 Likes
Message 8 of 8

Jeanette_Fullmer
Community Manager
Community Manager

Hi @AMIT KUMAR, was one of Jason Lightfoot's or Joerg Vogel's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes