question

Sebastien avatar image
0 Likes"
Sebastien asked Sebastien commented

OnStateChange in Event Log

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 ?

FlexSim 19.1.0
event logonstatechange
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

tannerp avatar image tannerp commented ·

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 0 ·
Sebastien avatar image Sebastien tannerp commented ·

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 0 ·
statelogtest.fsm (18.4 KiB)

1 Answer

Brandon Peterson avatar image
1 Like"
Brandon Peterson answered Sebastien commented

@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


statelogtest-pf.fsm (24.3 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Sebastien avatar image Sebastien commented ·

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 0 ·