question

Raashid Mohammed avatar image
0 Likes"
Raashid Mohammed asked Matthew Gillespie answered

How to make 6 wait events and assign label to One Wait Event instead

attached is the model

I have arrival schedule from Source 2 with labels F01,F02,F03,S01,S02,S03 with value

I want the only One wait until to activate instead of 6 at Processor3 Onentry, to check for all 6 labels and their values if its 0 then delete and if greater than 0 then assign (F01,F02,F03,S01,S02,S03) label name to "Chute" label and its value to count label

Please help

Thanks model1.fsm

FlexSim 16.1.1
wait for event
model1.fsm (23.3 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.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

I'm just trying to clarify what you want.

So you want the Count label to be the sum of the F01-S03 labels on the item?

And the Chute label should have the label names concatenated together?

0 Likes 0 ·
Raashid Mohammed avatar image Raashid Mohammed Matthew Gillespie ♦♦ commented ·

No I am not summing the value of ( F01 - S03)

Each label value is a unique Count value

If you look at my 6 assignlabels

You will see Chute value which is unique "F01" or F02 etc..

And the Count label is the value of F01 or F02 etc..

So the Assign label is the token will have

Chute = "F01"

Count = getlabel(token,"F01")

then I have a decide to see if the count value is zero then delete token

instead of having six different waitforevents and Assign label

I want one Wait for event which tiggers during procressor Onentry and creates 6 unique token which will split the label column on arrival schedule into Chute as name and Count as its value

for example

In Arrival Schedule

F01 F02

Type A 0 2

the Waitevent once triggers

creates two tokens because we have two columns

and Assigns token 1 with labels Chute = Labelname(ieF01) and Count = value of F01 ( ie 0)

and Assigns Token 2 with labels Chute = Labelname(ieF02) and Count = value of F02 ( ie 2)

and deletes the token with Count value is zero

Sorry for lengthy message

0 Likes 0 ·

1 Answer

·
Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered

Check out the attached model.

I converted the 6 Event Triggered Sources into a single Source that then uses a Create Tokens activity to make a token for each of the labels.

On the Create Tokens activity I set the Quantity field to be the number of labels on the item minus 2 (ignoring the first 2 labels):

content(labels(getlabel(token, "item"))) - 2

I also assigned a Chute label with this value:

getname(label(getlabel(token, "item"), creationRank + 2))

And a Count value with this value:

getlabel(getlabel(token, "item"), creationRank + 2)

These tokens are then sent to a decide where any tokens with a count of 0 are destroyed.


5 |100000

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

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.