question

Axel Kohonen avatar image
0 Likes"
Axel Kohonen asked Jason Lightfoot commented

How to match label on token - Wait for event

Hi,

I want to do a simple wait for token so that I release the token when a token with the matching label value exits a later activity in process flow. For some reason this does not work as I believed it to work. I want have multiple tokens wait for a certain place in the model and only allow one at once (for each different place in the model, that is why I use the partition). See the attached simple model where I have tried it.

There is this post about using synchronize instead and it seems that one cannot use match between two different tokens. Is this so, and if so, then how is one supposed to use match?

Anyone that can explain?

Thank you!

Kind regards,

Axel

matchlabelvalue.fsm

FlexSim 18.2.3
wait for eventmatch labelmatch
matchlabelvalue.fsm (26.3 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.

Axel Kohonen avatar image
1 Like"
Axel Kohonen answered Jordan Johnson commented

Hi,

I managed to solve my problem with the attached more simple flow, which I did not think about at first. But still, I am interested in how the label match is supposed to be used as it seems counter-intuitive.

Axel


· 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.

Sebastian Hemmann avatar image Sebastian Hemmann commented ·

Hi Axel, I assume I had a similar question/ issue. Please see the answer.

https://answers.flexsim.com/idea/61844/match-label-values-in-wait-for-event.html

2 Likes 2 ·
Jordan Johnson avatar image Jordan Johnson ♦♦ commented ·

In the event parameters window, you are being shown a list of values available from the event. In the Label/Value column, you can specify a literal value, or a label name. When you choose match, you are matching the event value with the value of a label, or with the literal value.

For example, you could listen to the OnExit of a processor. One of the parameters in that event is the item that exited. If the token that is on the WaitForEvent has a label pointing to a flowitem, you can use Match on that label. That way, only the tokens that reference the item that exited will move on from the activity.

In the Event Triggered Source, you should only match literal values. For example, you might only want to listen to items that enter a specific port. So if you listen to OnEntry, you can match the Port parameter to a value like 1 or 2 or something.

1 Like 1 ·
christian.n avatar image
0 Likes"
christian.n answered Jason Lightfoot commented

I second this.

I also have a hard time figuring out exactly how to use the whole label matching thing. Is there a good guide somewhere?

@jason.lightfoot

· 1
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Just saw this post - sorry.

There are two related texts in the manual which go some way to explain the matching.

Label Matching

Label Matching/Assignment

The first link doesn't cover "MatchValue" since it's mostly about labels, and the second doesn't detail what are valid parameter entries - ie. whether they need to be literals or can be flexscript expressions that evaluate to the required value. I'll ask that we improve this documentation.

0 Likes 0 ·