question

Anutt K avatar image
0 Likes"
Anutt K asked Anutt K commented

Set Object State by Custom code but State not change

Hello. In this case I want to use 2 Operators start travel together but once of Operator will arrive first at the destination.

1673315831474.png


In case of need to use Spilt and Joint in 2D logic from this picture, Operator2 will arrive the destination before Operator1. So Operator2 will be Idel state.

Then I use custom code for try to Set State of Operator2, It should be Waiting state.

How can I set object state in this case at use Split and Joint.

I has attached model here. Thank You.

Test Set State Object in Split.fsm

FlexSim 22.2.2
custom codesplitcustomecodejointset object state
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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Anutt K commented

When overwriting states of an object, timing is important. In this case, when the travel operation ends, the Process Flow token moves to the next activity and executes it before the state change back to "idle" happens. Because the custom change happens first, it is then immediately overwritten again by the pending change back to "idle".

By placing a 0s delay after the travel activity, you can make sure that the default state change has happened before the custom one is executed.

1673339525623.png

test-set-state-object-in-split_1.fsm


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

Anutt K avatar image Anutt K commented ·
Ok. I get it from your explain. Thank You so much.
0 Likes 0 ·