question

Suné JVR2 avatar image
0 Likes"
Suné JVR2 asked Eric M commented

Output port by label?

Good Day

I have a scenario where a processor called a cooling station and it has four different products. I created a label of the flow item called "Type of Product" and the string values are "Bread", "Cakes", "Doughnuts" and "Muffins". From the cooling station the products should split into two queues. The "Bread" needs to go to one queue and the remaining three to another but the remaining three products goes to the same queue as the bread downstream after they went through other processes. The processes looks like this:

BREAD

- cooling station

- finished baked goods queue

CAKES, DOUGHNUTS AND MUFFINS

- cooling station

- icing station queue

- icing station

-finished baked goods queue

Is there a way to achieve this?

I attached my model and the accompanying OFD drawing.

Kind regards

Suné

Bakery Problem.fsmBakery Problem OFD.pdf

FlexSim 20.0.10
labelsflexsim 20.0.10ports by label
bakery-problem.fsm (218.4 KiB)
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

First of all, please replace string labels by numbers. This is much easier than strings to handle. Then you can divert items by case.

0 Likes 0 ·
Suné JVR2 avatar image Suné JVR2 Joerg Vogel commented ·

The unspoken assignment is that we need to use string labels specifically.

0 Likes 0 ·
Eric M avatar image Eric M commented ·

Hi @Suné JVR2, was Joerg Vogel's answer helpful? If so, please click the red "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 unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

If you must use string labels, then translate them by an index of a string array.

array myProducts = [“BREAD”,”CAKES”,”DOUGHNUTS”,”MUFFINS“];
int index = myProducts.indexOf(item.labels[“Type of Product”]);

Then you can parse index into port by case property.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.