question

Daniel C avatar image
0 Likes"
Daniel C asked Ben Wilson commented

OnModelReset

Is it possible to, in the OnModelReset, write a code that control a trigger on different processors? For example, I have 10 processor that have the same code in the OnExit trigger, but I want to know if there's a way to write on OnModelReset something that rewrites all the OnExit triggers of those processors? Thinking that in the near future I may want to modify the code for that source.

I know I can use the Edit Selected Objects and copy that trigger, but specificly, can it be done with the OnModelReset?

FlexSim 18.2.2
triggercontrolonmodelreset
· 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.

tannerp avatar image tannerp commented ·

You could try using global variables in the OnExit trigger, then use the OnModelReset to change the global variables. Could you maybe give an example of what the triggers are currently doing and what you're contemplating having them do?

0 Likes 0 ·

1 Answer

Ben Wilson avatar image
3 Likes"
Ben Wilson answered Ben Wilson commented

@Daniel C, have you ever used User Commands? You've outlined a use case where user commands are a perfect fit. You would define a User Command, then each of your processors calls that command. If you ever need to change the logic in the future, you just change it in that one place - the User Command.

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

Daniel C avatar image Daniel C commented ·

No, I have never used the Users Command, now that I now this is the way I will learn how to do it, hopefully with a little help

0 Likes 0 ·
Ben Wilson avatar image Ben Wilson ♦♦ Daniel C commented ·

@Daniel C,

You add a new user command to your model from the Toolbox:

Once you have one added, you can use the User Manual to learn how to populate and use it. Find the User Manual entry on User Commands here:

Open the User Manual from FlexSim's main menu > Help > User Manual

In the Contents panel, navigate to Reference > Tools > User Commands.

Comment back if you have any questions!

0 Likes 0 ·