question

Juliette avatar image
0 Likes"
Juliette asked Juliette commented

How can I set an unload destination for an operator depending a string label?

capture-decran-2024-03-14-135347.pngHi Flexsim team,

How can I set an unload destination for an operator depending a string label? I have two machines and two queues. When the number of boxes in queues is below 300 a token is created in process flow with a task sequence. The name of Queue is assigned to a label QueueID. If QueueID is /Queue1 I would like to send a box to Machine1 with an operator. If QueueID is /Queue2 i will send a box to Machine2. I've tried to assign the value /Machine1 or /Machine2 to another label with conditional value. I have also tried to assign destination in Unload menu with Object by case, conditional object , object by global table lookup. It seems that nothing works with the QueueID label which is a string. Any ideas what I am doing wrong? Thanks!

FlexSim 24.0.1
label valuedestination
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Juliette , was Jason Lightfoot'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 ·
Juliette avatar image Juliette Jeanette F ♦♦ commented ·

Hi @Jeanette F and @Jason Lightfoot thank you four your answer. I understand the output logic in 3D. But, here I would like to learn how to use the information (for instance take a decision, find a value in a table etc.) that I collect by listening an event in process flow for more complex models. The unload model was just an illustration for me.

I would like to ask the same question using a more basic model: MODEL Example simple.fsm

I would like to observe the queues and detect the queue who has 10 items and then use this infotmation in a decide. Here is my decide block:

1711537959829.png

All of the tokens are sent to Delay2 even the token whose label is Queue1:1711538151444.png

Apparently decide block doesnt work with labels in string. How can I use the information stocked in lables as string? Thank you.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

You can use the standard sendtoport logic of Queue5 to decide which machine to feed, and then the standard transport logic.

If you post the model we can better understand what you are trying and where you've placed your conditional logic, and why your object references are not being relayed through to your tasks. Or you can debug the logic yourself by placing breakpoints in the code.
· 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.

Juliette avatar image Juliette commented ·

Thank you Jason for your answer! Here is my model MODEL Example.fsm
I would like to feed my machine via the operators and, only when I get a signal from the queues. I am searching for a way to connect label QueueID and machines.

0 Likes 0 ·
model-example.fsm (290.5 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Juliette commented ·

You need to first clean up the exceptions printed in the compiler and system consoles.

At reset your decide has an invalid expression in the condition:

token.QueueID == /Queue1

is not valid - and since you're comparing strings you need to put the string in quotes:

token.QueueID == "/Queue1"

Next, this source is not configured correctly:

1710504811249.pngThe label token.BacID points to the item in the queue and so can no be used to rename the token.

Then in your machine1 sendto port you're using the label Type to send to a port but:

1) The Type label doesn't exist on the item

2) You only have one output port so don't need to choose a port - you can just use first available.

You should go through the tutorials to learn some of the basic operations of FlexSim, then revisit my first reply which should at that point make sense to you.


0 Likes 0 ·
1710504811249.png (25.1 KiB)