OnStateChange in Event Log

OnStateChange in Event Log

sebastien_b49
Advocate Advocate
25 Views
4 Replies
Message 1 of 5

OnStateChange in Event Log

sebastien_b49
Advocate
Advocate

[ FlexSim 19.1.0 ]

Hi all !


I am looking for a way to have a change of state of several Fixes Resources (whatever the state) in the event log. The OnStateChange event is not in the available log events. Does anybody know how to add it ?

0 Likes
Accepted solutions (1)
26 Views
4 Replies
Replies (4)
Message 2 of 5

tanner_p
Not applicable

Hi @Sebastian,

There are other things you can do to listen to the OnStateChange trigger. For example, you could write to the Output Console or change a Global Variable. Is there a reason why you need this trigger to show up in the Event Log?

0 Likes
Message 3 of 5

sebastien_b49
Advocate
Advocate

Hi @tanner.p,

I was thinking that listening to OnStateChange in the Event Log would reduce the load on the simulation in comparison with writing a new script for each Fixed Resource on the "OnStateCHange" trigger.

The Event Log appeared to me as the simplest solution as I also want to listen to other event such as "Simulation starts, OnExit" or others.

However the console would be an option if it does not add too much load. I will test it.

Than is there a way to avoid the 0 second state (like setup each time a flowitem enters a Fixed Resource) ? I could try storing timestamps of state change for each machine and if they are equal I would delete the previous one. But may be there is a simplest solution ?

I have attached a small test model.

0 Likes
Message 4 of 5

Brandon_Peterson
Autodesk
Autodesk
Accepted solution

@Sebastian Here is a modified version of your model with a simple process flow that listens to the state on the processor and only prints the change if it takes more than a single event. You could set the time in "Breathe2" to be some small fraction longer than "0" if you are seeing changes that are still in zero time but separated by more than 1 event. You could also modify the flow to skip changes to the same state value if you wanted.

I hope this gets you what you want, Brandon

statelogtest-pf.fsm

img src="https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgbblack-small_forum.png" >

Brandon Peterson
Principal Technology Consultant
>
Message 5 of 5

sebastien_b49
Advocate
Advocate

Thank you @Brandon Peterson

This is indeed helpful for the demo process i uploaded but for my general model where machines are added dynamically it is more tricky. I'll try to adapt your solution. Thanks !

0 Likes