question

Kauan santos avatar image
0 Likes"
Kauan santos asked Felix Möhlmann commented

How to copy a label from one item to another using the process flow

How to change the label of an item using the process flow. I have a simulation that contains 2 sources that create 3 different models, and they work by orders. When a model from my source 1 goes to processor 31, I would like to move the items from my source 4 from processor 51 to processor 48. I can do this easily. What I'm having trouble with is when my product from source 4 leaves processor 51, I want it to change color to match the color of my models from source 1. How can I do this?

versao42.fsm

FlexSim 23.1.0
proces flowlabeltokens
versao42.fsm (2.4 MiB)
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·
@Kauan santos, If you have a mutual reference then you can assign color reference of item to the other by obj.color property.
0 Likes 0 ·
Kauan santos avatar image Kauan santos Joerg Vogel commented ·

@Joerg Vogel I understand, but how can I make the trigger change color to the product in my source4 only when my product that comes out of my source1 is in processor31.

Can you give me an example of this?


0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

You can use a "Wait for Event" activity to wait until the item has finished processing on Processor51 before you change the color.

I adjusted your logic to be a bit more robust. It no checks if there is an item on Processor52 and if not, it waits until one is available.

versao42_1.fsm


versao42-1.fsm (2.3 MiB)
· 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.

Kauan santos avatar image Kauan santos commented ·

Hello ! @Felix Möhlmann

Thank you, One last question, how do I reference items with port by case with this logic of yours? In this case I created a queue that will separate the items into 3 queues for each type, I am trying to use port by case but without success, how do I manage to use it?

1716290225169.png1716290278315.png

I'm doing this because when the items intersect they need to be of the same type, but I can't separate the items here.

versao42-1.fsm

0 Likes 0 ·
1716290225169.png (21.6 KiB)
1716290278315.png (217.1 KiB)
versao42-1.fsm (2.4 MiB)
Felix Möhlmann avatar image Felix Möhlmann Kauan santos commented ·

The "Type" label does not exist on these items. And on the items from the other source "Type" is equal to the RGB color values of the item, which is probably not intented (?). In the "Set Label and Color" option, the value should be the intended label value. The color will be determined as if you used "Color.byNumber()".

capture1.png

You can then copy the type label to the other items in the Process Flow, so they can be sorted into the queues.

capture2.png

Other issues that I noticed:

- "token" is not a valid variable name outside of Process Flow activities. So the exit trigger of processor 51 produces an error.

- Station3 (the one after processor33) is set to open the output of its first centerobject, but it doesn't have such a connection.

0 Likes 0 ·
capture1.png (5.2 KiB)
capture2.png (23.1 KiB)