Trigger PLC multiple times with delays
Traditionally we use a shift register to track parts through a machine. This works well for discrete moves but is more problematic for continuous motion such as on a conveyor.

If, for example, your product is 200 mm long then I would index the shift register every 50 mm or so and that way you're guaranteed that each product will be seen at least once and tracked in the shift register. The number of stages required will be the distance between sensors divided by the step. So, for a 1500 mm conveyor you would need 1500 / 50 = 30 stages. 







simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. Pseudo ladder logic code for a 30-bit shift register.

In the pseudo code above a 30-bit shift register has been set up starting at F200 (F for 'flag'). If the photoeye is on during a rising edge of the CLK then a '1' is loaded into the shift register at F200 after the existing data has been moved up one position. Any time a '1' reaches F229 the ejector output will turn on.

The 50 mm pulse would ideally be triggered by sensing the rotation of a shaft on the conveyor but if the speed does not change it could be done on a timer.



From the comments:


  The important part of the question is the concern that there will be several items on the conveyor at a time in between the sensor and the ejector, will the logic still work as is?


Yes.

         | sensor                                           | ejector
     _______         ________        ________        ________
    |_______|       |________|      |________|      |________|   &gt;&gt;&gt;     
 ___________________________________________________________
(___________________________________________________________)
                        Conveyor

         1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1    0 mm
         1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 1   50 mm
         1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1  100 mm


Figure 2. Shift register contents.