question

Telmo_Silva avatar image
0 Likes"
Telmo_Silva asked Telmo_Silva commented

Pick item from queue after determined event

Hi there,


I have been designing a production line. I created a label that every time an item comes out a processor (AF), it increments. When this label is 50, I want to take an item from a queue (Gri) and take it to a Sink (Sink3). I can make the whole ProcessFlow but I don't know how to say last item in the "Item" slot at a "Load" process.


How can I make this?


image-2023-05-28-125941936.pngCenário1.fsm

FlexSim 22.2.0
loadconditional decideevent trigger
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
0 Likes"
Felix Möhlmann answered Telmo_Silva commented

Items inside a queue (or other fixed resource) are subnodes of that object. You access them through "object.subnodes[N]" where N is the rank of the item. The total number of subnodes can be obtained with "object.subnodes.length", so "object.subnodes[object.subnodes.length]" would refer to the last item in the queue.

That said, you can also use the properties "first" and "last" to access the first and last subnode respectively ("object.last").

In any case, you should check if there actually are items in the queue before you attempt to load one.

1685427844084.png

cenario1_1.fsm


1685427844084.png (11.6 KiB)
cenario1-1.fsm (256.3 KiB)
· 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.

Telmo_Silva avatar image Telmo_Silva commented ·
Great answer. Solved the problem. Thank you.
0 Likes 0 ·