Discuss your PLC and automation problems for Allen Bradley, GE, Omron, Mitsubishi, Modicon, Panel Views, RS View, ABB, Adept Robots, Cognex etc. You can also submit and download sample PLC code.

If our forums and knowledge base still hasn't got your PLC operational, we recommend contacting PDF Supply and Electric for PLC repair and replacement parts.

Email to friend
Multiple emails allowed. Separate with commas

Confirmation code image

Type the characters in the image above exactly as you see them

Programming Application - Photoeye Make and Break Logic (Debounce)

How many times have you seen your photoeye lens get dirty and think there was a part to sense but really it was just a false input? Hopefully in this example I can explain to you how to implement make / break into your control logic.

Let's say that you have a photoeye that makes sure your part is present before it fires a pusher cylinder that moves your part down stream 90 degrees. See the example logic below.

Most everyday, the photoeye will function properly by seeing your part on the conveyor, sending a signal to the PLC, and then the PLC will tell the pusher to push the part to the other side. However, let's say one day the photoeye lens gets dirty. Now no matter if you have a part in front of the sensor or not, the input to the PLC is still going to be true. So when it comes time to evaluate this rung again, your pusher would function just like normal even with no part present and the maintenance guys are going to give you a goofy look because your pusher has just cycled with not part on the conveyor.

Designing make / break logic for devices such as a pusher to verify the part has indeed left the automated area is a common practice easy to implement. The concept is to use an internal latch bit in conjunction with a single shot bit. Once your pusher has retracted it will unlatch the "make" bit. See example logic below.

So now the next time the rung is evaluated, the one shot will fail to set the "make" bit again, because your photoeye never turned off. Your photoeye must turn off, then turn back on again to set the "make" bit and allow your pusher to cycle once again.

Some other situations that arise when make / break logic would come in handy:

  1. Cable cut and photoeye shorted to a high signal for PNP or shorted to a low signal for NPN.
  2. Using photoeye in a gravity application and the part does not drop, but hangs in the automation and does not drop down.
  3. Photoeye lens gets dirty or sees dirt from common industrial exposure.
  4. Person standing by the photoeye anf "flags" the eye with their white shirt.

Download the Photoeye Make and Break RS LOGIX example, PDF included. Winzip Required.