question

Mia avatar image
0 Likes"
Mia asked Jason Lightfoot commented

stop/resume item on message

微信图片-20231127194711.pngstop_resume_item_onmessage.fsm2.fsmI tried to stop a item on arrival by processflow, but when I tried to resume , it failed to.

There are two methods I used:

first model I used wait-event until DP1 receive message , it not work

second model I used custom coder such as

if (objectexists(current.stoppedItem)) {

conveyor.itemData[current.stoppedItem].resume();

current.stoppedItem=NULL;

},it still not work.

Can you help me find why my model not work?

FlexSim 22.0.16
itemstop and resumeonmessage
5 |100000

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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot commented

You're reassigning item with a value that is not the item from your user event. Remove the item reference from your WaitForEvent and it will work.

(The user event is currently sending itself as the sending object, which you're then assigning to the token's item label).

For synchronization it might be better to use the push/pull mechanism of lists rather than messages which can result in extensive case statements within a single on message code and is not as state/memory aware.

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

Mia avatar image
0 Likes"
Mia answered

new.fsmI modified the wait-event,this is the new model that works.


new.fsm (45.7 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.

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

A photoeye sends delayed messages to stop and resume items on involved conveyor On Message trigger.

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