question

Brad Champeau avatar image
0 Likes"
Brad Champeau asked Sam Stubbs answered

How do I control a decision point with a photo eye?

I have a photoeye located on a downstream conveyor. I have an upstream conveyor with a decision point on it. If the photoeye is not blocked, I want flow items to continue down the conveying system. If the photoeye is blocked I want the flow item to exit the side of the conveyor and enter a queue.

FlexSim 17.1.0
photo eye
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

I would use the message triggers again. Have the photo eye, On Block, send a message with the first parameter as 1 to the Decision point. Have the decision point On Message set a label on itself called "reroute" (or something) and set its value equal to the first message parameter (1) Then in the On Arrival trigger of the Decision point, put a conditional statement or code in there.

Something like:

if (current.reroute == 1)  {
	conveyorsenditem(item,SideExitTransfer)
}

Then you'll need to set some logic in your On Clear code in your photo eye, that sends another message with the parameter as 0. If you set up your On Message trigger correctly for the Decision Point, this means that any time the Photo Eye is blocked the message trigger will set the "reroute" label to 1, and every time it clears it is set back to 0. That way anytime an item hits the DP while the label is 1, the items are rerouted, otherwise they continue as normal.

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.