Change status from PF!

Change status from PF!

omar_aguilera_rico
Not applicable
29 Views
4 Replies
Message 1 of 5

Change status from PF!

omar_aguilera_rico
Not applicable

[ FlexSim 18.0.3 ]

I am trying to change the state of a processor when the operator downloads an object on it but the status shows me blocked. How can I make this change from PF? state.fsm

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

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

You're fighting with the Processor's internal management of its own states. If you open the event list and step through what happens when the operator drops off the box, you'll see that the token in Process Flow goes to the custom code that sets the state and then the Processor fires both its End Setup and Process Finish Events. One or both of these events is setting the state of the Processor after you've manually set it.

One way to fix this would be to wait until these events fire to set the state. In this model I added a Wait For Event activity that waits for the Processor's Process Finish event before setting the state.

state-mg.fsm



Matthew Gillespie
FlexSim Software Developer

Message 3 of 5

jeff_nordgren
Not applicable

@Omar Aguilera Rico,

That is a good explanation by @Matthew Gillespie on what PF is doing. His way is certainly one way to fix your problem. Another way, see attached, is I just put a .01 delay after the unload to the Processor so that all the internal code can complete before your Custom Code to change the state. One of these two way should be useful for your situation.

Thanks.

state-jn1.fsm

Message 4 of 5

omar_aguilera_rico
Not applicable

Boys, thanks for the support! Both are very good ideas.

0 Likes
Message 5 of 5

omar_aguilera_rico
Not applicable

Boys, thanks for the support! Both are very good ideas.

0 Likes