question

Ankith T avatar image
0 Likes"
Ankith T asked Natalie White answered

How to know the output port number

In my project i would like to send the flow item to random ports. but i would like to know the port number where the flow item is going to.


Here i have a source as shown in picture below, with centerport connection to dispatcher which is connected to two forklifts. these forklift are used to transport material from source to queues.


here i would just like to know, which queue is getting the material now using custom code. the out can be as a integer or a object name.


1688591054322.png

FlexSim 21.1.5
queuesend to portrandom
1688591054322.png (89.3 KiB)
· 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.

Natalie White avatar image Natalie White commented ·

Hi @Ankith T,

To receive a more accurate solution, please post your model or a sample model that demonstrates your question.

Proprietary models can be posted as a private question visible only to FlexSim U.S. support staff. You can also contact your local FlexSim distributor for phone or email help.

Do you want the port number to be printed to the console?

0 Likes 0 ·
Ankith T avatar image Ankith T Natalie White commented ·

Thanks for the information. i would like to store the port number in global table.

0 Likes 0 ·

1 Answer

Natalie White avatar image
0 Likes"
Natalie White answered

You can do this by setting a trigger on your source that will set a label upon exit. The value of this label will be the port. Then, you can use a custom code activity to write the value of the label to your global table. An example is attached.

OutputPort.fsm


outputport.fsm (35.2 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.