question

JoseVM avatar image
0 Likes"
JoseVM asked Regan Blackett edited

How to assign a label from an item of a batch to a Token?

Hello,

I am working with a batch that comes out from a combiner. I would like to assign to a token a label of one of the objects in the batch.

Specifically the label is "Doblemec". As you can see in the picture, every item of the batch has the same value for this label.

First thing I do is to create a triggered source in the combiner in when "Send To Port" is ready. Then, I use token.item.Doblemec in "Assign Label" activity, but as in this case "item" is refering to the batch, the label is assigned as NULL.

What I would like to achive is to get a token with the label "Doblemec" with the value of a item of the batch. It is the same for me which item, as every item of a single batch has the same value for this label.

Thanks for your time,

Martin

FlexSim 19.1.0
labelstokensflexsim 19.1.0
token-batch.png (379.0 KiB)
token-batch-2.png (366.7 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

·
Regan Blackett avatar image
0 Likes"
Regan Blackett answered Regan Blackett edited

The item reference provided by the event triggered source points to the pallet as you’ve pointed out so in order to get a label value on an flowitem inside the pallet you need to use the subnodes array property of the pallet.

token.item[1].Doblemec
token.item.first.DobleMec

Would let you access the Doblemec label on the first of the subnodes (or contents) of the pallet. As long as all the subnodes have the same Doblemec value this should work fine.

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

JoseVM avatar image JoseVM commented ·

Hello Regan,

First of all thanks for your comment. I write that on the Assing Label Activity but I do not know why it is not working. I better attach the .fsm in order to show you the problem (you can see how in the PF the token has the DobleMec NULL value, meanwhile the flowitem has a number).

Do you know why this is happening?

Thanks a lot.

motores eléctricos.fsm

0 Likes 0 ·
Regan Blackett avatar image Regan Blackett ♦ JoseVM commented ·

@IgMartin

Sorry for the confusion, I actually mis-typed the expression you need to use for the assign label. This is what you need:

token.item.first.DobleMec


0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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