question

Juan S4 avatar image
0 Likes"
Juan S4 asked Juan S4 commented

Adding 2 labels to a flow item

In my complicated circular conveyor system, in my sources I have set labels by percentage at creation of my flow items. These percentages are very important and I would prefer not manipulate them within this source. Each label corresponds to a destination to where the flow item will eventually need to arrive on the conveyor system. After flow item creation I want to send a certain percentage of these flow items to an audit line. After audit the flow item needs to still have it's original label so that when the flow item is re-introduced onto the conveyor that it will then still end up at its correct destination as originally intended. Because the conveyor system is complicated and circular, I do not want this same item to go to audit twice. I am not sure if one can add 2 labels to a flow item in Flexsim then after audit to remove the 2nd label that is the "go to audit label".

FlexSim 20.0.10
labellabelname
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 Juan S4 commented

You can add as many labels as you want, as long as they have different names and also later remove them. If no pickoption is available to remove the label then use the expression below in a code snippet.

item.labels["labelName"].destroy()

Though generally it might be better to only change the value instead of removing the label. Because checking a value is slightly easier than checking if a label exists.

Here is an example model. 10% of items get a value of 1 in the "Audit" label. They are routed to Processor3. In its Process Finish trigger, the label is set to 0, so they are not routed to Processor3 again.

item-routing.fsm


item-routing.fsm (25.8 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.

Juan S4 avatar image Juan S4 commented ·
Thank you Felix. This worked well now after I implemented your suggestions & code snippet.
0 Likes 0 ·