question

Simon S5 avatar image
0 Likes"
Simon S5 asked Simon S5 commented

Decide by label

Hello,

I have trouble on the last decide step in process flow and would appreciate your help.
After a grey box has stopped and the delay has finished I want to stop a brown box (Label "Type" 0).
For some reason it does not work and a error message appears.

Besides that, could you tell me how to simplify the process flow without "decide"?
How can I add a if-condition to stop a box with a certain label? Mabye with custom code?

Thank you!

decide.fsm





FlexSim 21.0.10
conditional decideif
decide.fsm (58.5 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.

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Simon S5 commented

What you're describing doesn't need a process flow - you can set that behaviour on the station process condition:

1670693710889.png

decide_jl.fsm

If you intend to only process unprocessed boxes then you can record that on the box during the process finish trigger and include that test in the process condition.

You can do the same seem in a very simple object process flow with both stations as members:

1670694711603.png

decide_jl2.fsm


1670693710889.png (4.4 KiB)
· 6
5 |100000

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

Jonah K avatar image
1 Like"
Jonah K answered Jason Lightfoot converted comment to answer



You can simplify the process by using a variable. If you want to alternate which box you stop on the conveyor, you can use the process flow in the attached model, shown here: 1670372294449.png


This still uses a decide activity, but in a much more effective way. If token.type==token.variable (i.e. the last token type that was stopped), then it will throw away the token, and the items will keep flowing. Once you get a token.type that doesn't equal the previous token.variable, it will Stop the item, Delay, Resume, then set the variable to equal the current token.type.

1670372613665.png


AlternatingStopping.fsm




· 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.

Kavika F avatar image
1 Like"
Kavika F answered

Hey @Simon S5, from what I understand, you want gray boxes to stop at the first Station and brown boxes to stop at the second Station? If so, then here's an example of what you could do.

1670367186541.png

I have an Event Triggered Source that makes a token when a box appears at Station1. I decide whether or not it's a Gray box. If so, then I run a subflow (if you're familiar with programming, it's like a function or method) that stops the box, delays a certain amount of time, and then resumes the box. I then check to see when the box reaches the second station. If that box is brown, then perform the stop, otherwise we're done!

Hope this helps.

decide_1.fsm


1670367186541.png (40.5 KiB)
decide-1.fsm (54.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.