question

Kamil P avatar image
0 Likes"
Kamil P asked Kamil P commented

Change color by percentage in processor

Hello,

i have a problem, with change a color box in procesor 3. Processor 3 have a flow by Percentage 50 % by port 1 and 50% by port 2. I would like that boxes which connect to port 2 change a color on blue and boxes which connect to port 1 will not change.

Thank you

problem.png

wersja-wstepna.fsm

FlexSim 17.2.5
processortriggersflowboxeschange color
problem.png (347.2 KiB)
wersja-wstepna.fsm (29.8 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.

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Kamil P commented

You want set the color conditionally by Port. There is the option from the picklist Set Color By Case .

The color of the item entering the processor is

item.color // you assign this color for the items leaving the processor by port 1 or on default.


color-by-port.jpg (27.0 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.

Joerg Vogel avatar image Joerg Vogel commented ·

It is a function of the OnExit Trigger.

0 Likes 0 ·
Kamil P avatar image Kamil P commented ·

Thank You

@Jörg Vogel

0 Likes 0 ·
asb.p avatar image
0 Likes"
asb.p answered

Please add semi-column(;) at the end of line 5 in send to port trigger

5 |100000

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

asb.p avatar image
0 Likes"
asb.p answered Kamil P commented

Hello Kamil,

You can add the following line in the send to port trigger under the if condition if port = 2.

item.color = Color.blue;

and remove the exit trigger. You can see the item coming out of the processor are blue in color.

I didn't have flexsim17 so I cannot send the final model. please change the last code in send to port trigger as given in the below figure then the model should work as you want.

correction.png


correction.png (103.7 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.

Kamil P avatar image Kamil P commented ·

Hello @asb.praneeth,

i use your proposition, but unfortunelly the model does't work as i want. I see a problem which i see you.

problem1.png

please see this model and check it

wersja-wstepna.fsm

Thank you

0 Likes 0 ·
wersja-wstepna.fsm (32.0 KiB)
problem1.png (391.5 KiB)

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.