question

Jonathan avatar image
0 Likes"
Jonathan asked Jonathan commented

How to I change the 'processdispatcher' variable of a processor with code?

I have a Separator. I want to change the process operator on a trigger, then back on another trigger. I see that 'processdispatcher' is the variable in the tree I need to change.How do I do that?


Reason: In my model, my operator uses downtime behaviour to go on bathroom and lunch breaks. During that time I have a Utility Operator that I want to take over and run the machines.

Is there a better way?

FlexSim 22.0.1
operator
· 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.

Regan Blackett avatar image
0 Likes"
Regan Blackett answered Jonathan commented

If you are using center port connections for the primary task executer an easy approach would be to have a label on the separator with a default value of 1 to represent needing the primary operator. Then in your trigger set the value of that label to say 2 to represent needing the utility operator. Then set the expression for using an operator to current.centerObjects[current.YourLabelName]. Then make sure your primary operator is connected to the first center port and the utility operator to the second center port.

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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jonathan commented

If you connect your operator to his replacement by an object connection “a” type, he becomes himself a dispatcher. And when he is going to lunch by an preempting tasksequence his previous interrupted tasksequence will be dispatched by him to his replacement. Standard functionality of FlexSim.

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