question

Lilian Fonseca avatar image
0 Likes"
Lilian Fonseca asked Sam Stubbs commented

How to avoid overlapping using a photo eye set up to stop and release the output of the source?

I would like to control my line so that when the photo eye is blocked by a flowitem, it should stop the source output and just reopen it as soon as the flowitem leaves the photo eye. This way my model will not face overlapping of products anymore.

FlexSim 16.0.1
photo eyeoverlapping
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

Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered Sam Stubbs commented

You can do this by going into the Photo Eye properties and under the On Block trigger, you can add a Code Snippet and call the stopoutput() method. Just reference the Source object as the parameter. Then under the On Clear trigger just add a Code Snippet with the resumeoutput() method using the same object as the parameter.


photoeyestop.png (23.4 KiB)
· 5
5 |100000

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

Sam Stubbs avatar image Sam Stubbs ♦ commented ·

The methods will look something like this:

stopoutput(node("Source1", model()));
resumeoutput(node("Source1", model()));
0 Likes 0 ·
Lilian Fonseca avatar image Lilian Fonseca Sam Stubbs ♦ commented ·

Would you mind to send me a complete default code for doing this? I am still not used to FlexSim code language. I have just copied and pasted what you said but it doesn't seem to be working yet.

0 Likes 0 ·
Sam Stubbs avatar image Sam Stubbs ♦ Lilian Fonseca commented ·

Where it says "Source1" you'll have to reference the name of your own source in your model.

And make sure the stopoutput code is in the On Blocked trigger, and the resumeoutput code is in the On Clear trigger.

-1 Like -1 ·
Show more comments