question

Cale H avatar image
0 Likes"
Cale H asked Cale H commented

Releasing single flow items from a queue or combiner

The model attached is an attempt to release a single flow item from a queue or a combiner as an upstream workstation to a conveyor decision point. It is shown in isolation from the decision point/conveyor for simplicity. When the flow item leaves the queue/combiner, the resource should only send the single flow item. We are attempting to do this via closing the output port of the upstream resource, however we have tried closing the input port of the downstream resource and run into the same issue. On a message from the downstream resource, the current resource should release another single flow item and then no more. We are attempting to do this via opening the output port of the current resource based on a message (no contents, just the presence of one), but have also tried using the input port of the downstream resource with the same result.

The issue we ran into is that when the current resource (combiner or queue) opens its output ports, it passes all of its current contents downstream, one item at a time. The problem with this is that it continues to pass items once its ports are closed. This defeats the logic of the operation sequence we are trying to model (i.e. pallet/assembly on the conveyor arrives and consumes one flow item and departs, flow items are consumed by a center port connected sink only when the pallet/assembly is present). We have tried using object.output.close() as well as closing the input ports of the downstream resource (both closeinput(object) and object.input.close()) but the same issue occurs. The upstream resource will send flow items until its original content quantity is exhausted, or the downstream resource is at its capacity, whichever comes first.

Is there a different function/method we can use to release only a single flow item or a way we can control the flow? I am sure it can be set up in process flow, however it will need to be portable and modular as we are developing standard building blocks for use in a number of simulations of conveyors.

Thanks

port-closure-control-queue-and-combiner.fsm
FlexSim 17.0.12
queuecombinerflowitemcloseinputopeninput
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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Cale H commented

The command combination holditem(..) and releaseitem(..) does what you want.

Holditem(obj. item) is equal to the return value in the Send To Port Function -1 or as a pick list template "Do Not Release Item". If you know the item by reference that you want to release you call on this item the function releaseitem(obj item, num output port number). Then the item will exit explicitly through the output port you set. If you don't use an output port port, the function "Send To Port" will be executed again with the item reference of the command.

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

Cale H avatar image Cale H commented ·

Jorg,

I was having trouble implementing the method you had suggested. I kept getting exceptions when trying to access the item in the on message trigger. However, I was able to solve the problem with a different method. In the flow tab of either the queue or combiner, the code was modified to close the output ports during its execution, which limits the exit to one. The evaluate on downstream availability was also checked to keep the flow normal.

0 Likes 0 ·