question

William A4 avatar image
0 Likes"
William A4 asked tannerp answered

Creating If statement in labelling

For part of my senior design project, I am trying to build a system for detecting defects in an assembly line. At the moment I have a label "Defect" that is 1 base or 2 defective. I want my processors on entry to check defective items. If the processor would catch the defect, I want it to go to a caught scrap queue, and if not I want it to go to an uncaught scrap queue. But I don't want non-defective materials to be run through this check. Is there any way to have an on entry check based on the label value? Example,

If Defect == 2:
set value by percent: Defect
(% detection) = 2
(1-%detection) = 3
Else pass:


That way the program isn't checking non-defective items and calling them defective, and it is determining whether the defect would be detected or not for purposes of my simulation calculation.


I attached a photo of the simulation if that helps. For record's sake, I am on an educational key.

FlexSim 19.2.4
flexsim 19.2.4
· 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.

tannerp avatar image tannerp commented ·

@William A4,

Could you attach the model you're working with? It might help us get a better idea of what's going on so we can provide the best solution.

That said, I suggest either using a label on the processor or a Tracked Variable to track the number of defects. These can be incremented conditionally when the item's "Defect" label is "2".

0 Likes 0 ·
William A4 avatar image William A4 commented ·

DIS Simulation.fsm

The percents for my failure rates and the like are wrong right now, so ignore them

0 Likes 0 ·
dis-simulation.fsm (34.8 KiB)

1 Answer

·
tannerp avatar image
1 Like"
tannerp answered

Hi @William A4,

This is an interesting model - I don't think I've seen the entry trigger used this way before. I think it can work, though. I added an On Entry trigger on the WS4_SP Assmebly__1 Processor that sets a label called "Port" to the value of the "Defect" label. This way, if Defect == 2, the Port is also set to 2 when the item enters so that when the item leaves, it's sent to the Defect Queue even if the Defect label changes because of the On Exit trigger you have set up.

Hopefully this works. Let me know if I misunderstood what you wanted to have happen.

dis simulation updated.fsm


5 |100000

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

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.