question

Adrian M avatar image
0 Likes"
Adrian M asked Adrian M commented

How to Release Item to Multiple Ports using Process Flow

Hello,

I understand how to release an item to one port that is defined using the Custom Code activity and selecting Control>BasicFR>Release Item and defining which port to release the item to, but I'm wondering if it is possible to release to one port or another port if they are available. I tried to define the port by using the OR statement; however, it did not work.

Essentially, the red processors perform the same process, and we can work on a unit in either of those processors. Although it is the same process, the two red processors are two separate workbenches which is the reason for this effort. I want to have the opportunity to work on the second red processor if the first processor is being utilized since it's the same process.

1719514954592.png

Please see attached model.

Software Version: 23.0.2

Thank you,

Example - Release Item to Multiple Ports.fsm

---

Side note: I was able to duplicate the logic to use the secondary port if available, but there's more effort doing that than just inputting an OR statement, or there must be an easier way to define this modularity.

FlexSim 23.0.15
tracked variablesportsitem release
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Adrian M, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Adrian M commented

Initially I thought that using port number 0 would work, but that doesn't seem to be the case. So I utilize the fact that calling "releaseitem()" with specifying a port number re-evaluates the Send to Port code of the object the item is in.

In that code I use a Map label to keep track if the code was already run for the item or not. The first time (when the item enters) the code returns -1 (Do Not Release). The second time (triggered by Process Flow) it returns 0 (First Available).

example-release-item-to-multiple-ports_1.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.

Adrian M avatar image Adrian M commented ·
Thank you Felix! It works.
0 Likes 0 ·