question

Andre T6 avatar image
0 Likes"
Andre T6 asked Andre T6 commented

FIFO order with custom code and process flow

Hi everyone,
In my model, i want to make my crane to move item from the cluster to Queue2 in FIFO order with custom code in process flow, but it seems like there is something i miss in the code so that the model didn't work properly and the crane didn't move at all. I tried recreate the process flow but the crane still didn't move.

Can someone check where did i go wrong in the model?
FIFO Model.fsm

FlexSim 21.2.2
process flowcustom codecrane
fifo-model.fsm (56.6 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.

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Andre T6 commented

The queues are not set to push the items to the list, so the token can't pull anything from it. Change the "Use Transport" option from using the "STRE" object (which doesn't actually exist in the model as far as I can tell) to pushing the items to the list. This will also automatically write the priority and destination label to the item.

1633328675594.png

The "priority" label written to the item is not capitalized, but the list currently expects it to be. You also don't need an "Expression" field, a simple "Label" field will do. The capitalization of "priority" will also have to be removed from the query in the "Pull from List" activity.

1633328580123.png

In the unload activity the destination is given by "token.destination" (the default value), but the label is actually present on the item, so you have to use "token.item.destination".

Finally, there are some minor errors in your custom code.

- The names of the cluster queues contain a space in front if the number. In the find-commands, this space is missing.
- In line 11 you are trying to get the property "MaxContent2" of one of the queues. This doesn't exist. You surely mean to determine the "MaxContent" as in the line above.

(Note that currently "Queue1" is set to a higher priority than the cluster. I don't know if this is correct.)

fifo-model_1.fsm


1633328580123.png (15.4 KiB)
1633328675594.png (10.2 KiB)
fifo-model-1.fsm (58.0 KiB)
· 6
5 |100000

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