Glossary · PLC and control programming
Counter
Also known as: CTU/CTD counter, Up/down counter
German: Zähler
In IEC 61131-3 programming, a counter is a standard function block that increments or decrements a count value on the rising edge of an input and signals when a preset value is reached; the standard defines up (CTU), down (CTD) and up/down (CTUD) counters.
- PLC programming
- Standards
In one sentence
A PLC counter is a standard function block (CTU, CTD, CTUD) that counts rising edges and signals when a preset value is reached.
Example
A CTU counter counts bottles passing a photoelectric sensor and sets its output when 24 bottles have entered the case packer.
How it applies
- Engineering: Counters count parts, cycles, strokes or events. The count input reacts to a Rising edge, so a signal that stays TRUE is counted only once. Fast signals may need a high-speed counter module, because a normal program cycle can miss pulses shorter than the scan time.
- Commissioning: Bouncing contacts can produce multiple counts per event; Debounce filtering in hardware or software prevents this. Test the counter at maximum machine speed.
- Maintenance: Operating counters (strokes, running hours, switching cycles) are a common basis for maintenance intervals and for Diagnostics.
- Documentation: State what is counted, when the counter resets and whether the value survives a power cycle (Retain variable). Maintenance tables that refer to counted cycles should name the HMI screen where the value can be read.
Counter vs. timer
A counter reacts to events and ignores how much time passes between them. A Timer measures elapsed time. Both are standard function blocks in IEC 61131-3 and often work together, for example to count parts per minute.