question

Zhun Z avatar image
0 Likes"
Zhun Z asked Zhun Z commented

Monitoring model triggers OnRunStop

Monitor model OnRunStop.fsm1.gifExcuse me, i want to monitor the model OnRunStop, i build two same activity with the same PF, Why the no.1 cann't monitor the model OnRunStop, but no.2 can monitor sucessfully?Monitor model OnRunStop.fsm

FlexSim 21.2.4
monitoring model triggers onrunstop
1.gif (116.4 KiB)
5 |100000

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

1 Answer

Ben Wilson avatar image
1 Like"
Ben Wilson answered Zhun Z commented

This looks like some limitation in the current version of the software. As you found, one Process Flow Wait For Event activity can successfully detect the OnRunStop event. In addition to that, the OnRunStop Model Trigger found in the Toolbox will also run when you stop the model.

As a work around you can do something like the following with a single Wait For Event activity:

1639174218696.png

I tested this setup and found that it works properly - both Custom Code activities execute their behavior.


1639174218696.png (8.3 KiB)
· 3
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·
OnRunStop event is a final last single call before all activity ends. If there would be a multiple event detection a procedure of your model must run beyond the point of stop in an encapsulated environment. Only if these procedures stop by design, you can start your model again. Such an exclusion makes it difficult to run multiple scenarios in an experimenter. if you like to implement a pre-stop or a general trigger over your whole model you can change a watched and tracked variable in your model. Whenever you set a value of this variable somewhere in your model, you can detect it in a central logic.
0 Likes 0 ·
Zhun Z avatar image Zhun Z Joerg Vogel commented ·
Thanks, tracked variable is a new idea, i will try it.
0 Likes 0 ·
Zhun Z avatar image Zhun Z commented ·
Thank you ,I will try to follow your proposal.
0 Likes 0 ·