Standard function blocks
320
Operation The counter output (CV) value is increased by 1 if the counter input (CU) value changes
from 0 -> 1 and the reset input (R) value is 0. If the counter output has reached its
maximum value 32767, the counter output remains unchanged.
The counter output (CV) is reset to 0 if the reset input (R) is 1.
The status output (Q) is 1 if the counter output (CV) value >
preset input (PV) value.
Example:
Inputs Counter input (CU): Boolean
Reset input (R): Boolean
Preset input (PV): INT
Outputs Status output (Q): Boolean
Counter output (CV): INT
CTU_DINT
(10048)
Illustration
Execution time 0.92 µs
Operation The counter output (CV) value is increased by 1 if the counter input (CU) value changes
from 0 -> 1 and the reset input (R) value is 0. If the counter output has reached its
maximum value 2147483647, the counter output remains unchanged.
The counter output (CV) is reset to 0 if the reset input (R) is 1.
The status output (Q) is 1 if the counter output (CV) value >
preset input (PV) value.
Example:
RCUPV QCV
prev
CV
0 1 -> 0 20 0 10 10
0 0 -> 1 11 1 10 10 + 1 = 11
11 -> 020 011 0
10 -> 15 00 0
0 0 -> 1 20 0 0 0 + 1 = 1
0 0 -> 1 30 1 32767 32767
CV
prev
is the previous cycle counter output value.
CTU_DINT
96
TLA1 1 msec (1)
>CU
R
PV
CV
CV(96)
Q
Q(96)
RCUPV QCV
prev
CV
0 1 -> 0 20 0 10 10
0 0 -> 1 11 1 10 10 + 1 = 11
11 -> 020 011 0
10 -> 15 00 0
0 0 -> 1 20 0 0 0 + 1 = 1
0 0 -> 1 30 1 2147483647 2147483647
CV
prev
is the previous cycle counter output value.