A cyclic controller can miss a valid photoelectric sensor pulse if the input returns low between two observations. To assess a product counter, compare the shortest pulse at the fastest line speed with the longest interval between effective input updates. Check the input filter as well. A display showing an average PLC scan time describes only part of the signal path.
Model a carton crossing the beam
Imagine an indexing conveyor running at 1 m/s. A 30 mm feature interrupts a beam for about 30 milliseconds if it passes squarely through the sensing region. This is a geometry estimate. Sensor response time, alignment and the particular point on the carton can shorten the actual electrical pulse. Measure its minimum width at the input during a representative production trial.
Suppose a controller reads the input image periodically, every 100 milliseconds. A pulse that starts 15 ms after a read and ends at 45 ms is invisible at both 0 and 100 ms. A pulse that starts at 90 ms and ends at 120 ms is high at the 100 ms read. Both electrical pulses are 30 ms long. Only their phase relative to the sampling instant changes.

Understand what a detection percentage means
For an ideal point sample once every T seconds and one isolated pulse of width w no longer than T, a uniformly random start phase gives an illustrative probability of w ÷ T that one read sees it. With w = 30 ms and T = 100 ms that is 30%. It does not predict that an actual installation will correctly count exactly three in every ten cartons. A conveyor and controller operating at related periods may repeatedly line up or repeatedly miss. Network update jitter and a sensor’s input filter can change the result again.
A 20 ms periodic observation interval gives at least one observation during an ideal 30 ms pulse. To count separate items, the signal must also return low long enough for the chosen detection method to recognise the separation. Two adjacent pulses can otherwise appear as one sustained high. Base the production specification on both minimum high time and minimum low time, plus timing tolerances.
Choose a capture method that matches the counter
An input that latches a short pulse can give the normal scan an opportunity to read it. A latch that merely remembers that at least one transition happened cannot distinguish several events before it is serviced. A hardware counter or a timestamped event input can be more appropriate where several products may pass during one scan. Check the exact model’s documented minimum input times, filter behaviour, maximum rate, and how software retrieves or clears captured events.
For an Australian carton line, validate the counting channel with an agreed independent reference over a defined run. Include the fastest product, shortest visible feature, narrowest gap and expected load on remote I/O. Compare per-item timestamps or counts at each layer when available. If a sensor LED flashes but the historian counter stays still, test the input and controller counts before attributing the loss to the reporting system.
Worked data
Observation interval (ms) | Input high time (ms) | Ideal random-phase detection (%) |
|---|---|---|
20 | 30 | 100 |
30 | 30 | 100 |
40 | 30 | 75 |
50 | 30 | 60 |
60 | 30 | 50 |
100 | 30 | 30 |
The worked data compare ideal polling intervals for one 30 ms pulse. Download the detection examples. Siemens explains pulse catch and input filtering in the S7-1200 documentation. A product tally is the application considered here. Follow the documentation for the actual input module and its configured update path.
Diagrams, chart and worked data by Industry Applied.
