question

lehduc avatar image
0 Likes"
lehduc asked Jeanette F commented

Syntax error when I use Port by case

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

FlexSim 24.0.1
syntax error
1708706719434.png (10.0 KiB)
1708706950121.png (15.6 KiB)
q2p2.fsm (118.0 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

Jeanette F avatar image
0 Likes"
Jeanette F answered Jeanette F commented

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


1708709605134.png (13.1 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.

lehduc avatar image lehduc commented ·
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 0 ·
Jeanette F avatar image Jeanette F ♦♦ lehduc commented ·

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

1 Like 1 ·
q2p2-1.fsm (116.4 KiB)