Modern warehouses use conveyors, sensors, and programmable logic controllers to move thousands of packages with very little human handling. A PLC counter is a logic instruction that counts events, such as boxes passing a photoelectric sensor or totes entering a sorting lane. Counting accurately matters because inventory totals, batching, lane balancing, and jam detection all depend on reliable event data.
In a logistics system, one missed or extra count can send a package to the wrong place or trigger the wrong machine action.
A PLC counter usually increases or decreases when it sees a clean change in a digital input signal, such as a sensor changing from OFF to ON. The PLC compares the accumulated count to a preset value, then turns on an output bit when the target is reached. This output can stop a conveyor, open a diverter gate, reset a batch, or alert an operator.
Good counter design includes proper sensor placement, debounce filtering, reset logic, and timing checks so that fast-moving packages are counted once and only once.
Key Facts
- A count-up counter increases its accumulated value by 1 for each valid input pulse.
- Counter done condition: ACC >= PRE, where ACC is the accumulated count and PRE is the preset count.
- Count rate can be estimated by f = N / t, where f is counts per second, N is number of packages, and t is time in seconds.
- Package spacing can be estimated by d = v / f, where d is spacing, v is conveyor speed, and f is package rate.
- A reset signal clears the accumulated count, usually setting ACC = 0 before a new batch begins.
- A photoelectric sensor must produce one clean pulse per package for the PLC counter to match the physical package count.
Vocabulary
- PLC
- A programmable logic controller is an industrial computer that reads inputs, runs logic, and controls outputs such as motors, lights, and diverters.
- Counter instruction
- A counter instruction is a PLC logic block that tracks how many times a selected input event has occurred.
- Preset value
- The preset value is the target count that the counter compares against its accumulated value.
- Accumulated value
- The accumulated value is the current number stored by the counter since the last reset.
- Photoelectric sensor
- A photoelectric sensor detects objects by using a beam of light that is blocked or reflected by passing packages.
Common Mistakes to Avoid
- Counting the sensor state instead of the sensor edge is wrong because a long package may keep the input ON for many PLC scans and be counted multiple times.
- Forgetting to reset the counter between batches is wrong because the accumulated value carries over and makes the next batch appear larger than it really is.
- Placing the sensor too close to a diverter is wrong because packages may be counted before the system has enough time to route them safely.
- Ignoring sensor bounce or noisy signals is wrong because false pulses can add extra counts and cause incorrect inventory or sorting decisions.
Practice Questions
- 1 A conveyor sensor counts 240 packages in 6 minutes. What is the package rate in packages per minute and in packages per second?
- 2 A PLC counter has PRE = 50. It starts at ACC = 0 and receives 37 valid pulses, then 18 more valid pulses. What is ACC, and is the counter done condition true?
- 3 A photoelectric sensor sometimes stays ON for several PLC scans while one large box passes. Explain why edge detection is needed for accurate counting.