question

Liam Chiu avatar image
0 Likes"
Liam Chiu asked Liam Chiu commented

Assign label

Hi

I would like to know how to give different number of labels. When the items enter the processor, it produces 20 items with the label "1", and then produces 30 items with the label "2"....


I have attached my model. Thank you very much in advance. :)


Assign label.fsm


1667371255162.png

1667371277004.png

FlexSim 20.1.3
labels
1667371255162.png (14.6 KiB)
1667371277004.png (44.4 KiB)
assign-label.fsm (26.6 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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Liam Chiu commented

I would use two labels on the processor, one to note which row we're currently in and one to denote how many items were already assigned the value from that row.

1667373607621.png

In the "On Process Finish" trigger, the processor first assigns the corresponding color value to the item. It then increments the "Counter" label by one. In the code snippet, it checks whether the counter has reached the given limit of the row. If so, the row is incremented (looping back to 1 at the end of the table) and the counter label is reset to 0.

1667373652570.png

assign-label_1.fsm


1667373607621.png (4.0 KiB)
1667373652570.png (44.8 KiB)
assign-label-1.fsm (198.4 KiB)
· 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.

Liam Chiu avatar image Liam Chiu commented ·

Thank you very much for the answer :)

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.