60
In this example, the storage location has 150 spaces. When
the accumulated count reaches 150, the counter bit turns
on, contact C48 closes, and output Q0.1 turns on. This could
trigger other logic in the program to divert new items to
another location until such time as an item is removed from this
location.
IEC 1131-3 Counters The counters previously discussed were SIMATIC counters. The
IEC 1131-3 instruction set also includes three counters. These
counters are similar to the SIMATIC counters, but there are a
few differences.
Each IEC 1131-3 counter has an output (Q) and cumulative value
(CV) in the counter box.
Count Up Counter (CTU) stops counting when CV equals the
preset value (PV), and turns on output Q.
Except for the CV and Q values, the IEC 1131-3
Count Down
Counter (CTD) functions like the SIMATIC version. When CV
equals zero, it stops counting, and output Q turns on.
Count Up/Down Counter (CTUD) stops counting up when CV
equals PV and turns on output QU. CTUD stops counting down
when CV equals zero and turns on output QD.
IEC 1131-3 Counters
Timer Number (C0 to C255)
PV
LD
PV
CD
CU
CD
LD
CTD
CTUD
Count Up Counter Count Down Counter Count Up/Down Counter
CU
CTU
Cxxx
R
Cxxx Cxxx
Q
CV
PV Q
CV CV
QD
QU
R