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 Mia commented ·

Thanks.That's make sense. I'm really interested in "use the push/pull mechanism of lists",can you tell me more about it ? how can I use a pull-list to stop and resume items?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Mia commented ·
Here are some links. You can just have one token pull from a list (checking for a value or partition if needed) and another event pushing to the list.
Lists functional reference.
Shared Assets.
0 Likes 0 ·
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.

Mia avatar image Mia commented ·
I want to use Decision point instead of photoeye but still thank you very much for your code I figured out my mistake.
0 Likes 0 ·