Syntax error when I use Port by case

Syntax error when I use Port by case

lehduc
Not applicable
12 Views
4 Replies
Message 1 of 5

Syntax error when I use Port by case

lehduc
Not applicable

[ FlexSim 24.0.1 ]

Q2P2.fsm

Hi everyone,


I tried to build a model in which 2 racks will send items by types to different ports and I used "or" but it keeps telling me syntax error.

1708706719434.png

1708706950121.png

0 Likes
Accepted solutions (1)
13 Views
4 Replies
Replies (4)
Message 2 of 5

Jeanette_Fullmer
Community Manager
Community Manager
Accepted solution

Hello @lehduc,

You can only put an integer in the Port field

To accomplish what you want you will need to implement in the code a combination of the Send item by label and random port or round robin option. Here is an example of implementing port by case and random port together. This would not work if the port numbers possible were 2 and 4 but you could use something similar to pick the port index of the options and then assign the corresponding port.

1708709605134.png

0 Likes
Message 3 of 5

lehduc
Not applicable

Hi thanks for your reply,


In fact I want to send items to port 2 or 3 for case 1 and 3, doesn't matter which one but the first available. I don't want it to be random or round robin. Can you give me more details? Thanks a lot for your help.

0 Likes
Message 4 of 5

lehduc
Not applicable
Hi @Jeanette F ,


Thanks for your help, in fact I want to send items type 1 and 3 to port 2 or 3, the first available. And item type 2 to port 1. I don't want it to be round robin or random. Thanks a lot if you could give me some more details.

0 Likes
Message 5 of 5

Jeanette_Fullmer
Community Manager
Community Manager

Hello @lehduc, with the first available logic it is not possible to limit port options. In this case I switched the Racks to be send to port first available and then on the processors placed a pull requirement that looks at the Type label.

q2p2_1.fsm