Standard function blocks
362
CTD_DINT
(10046)
Illustration
Execution time 0.92 µs
Operation The counter output (CV) value is decreased by 1 if the counter input (CD) value
changes from 0 -> 1 and the load input (LD) value is 0. If the load input (LD) value is 1,
the preset input (PV) value is stored as the counter output (CV) value. If the counter
output has reached its minimum value -2147483648, the counter output remains
unchanged.
The status output (Q) is 1 if the counter output (CV) value <
0.
Example:
Inputs Load input (LD): Boolean
Counter input (CD): Boolean
Preset input (PV): DINT
Outputs Counter output (CV): DINT
Status output (Q): Boolean
CTU
(10049)
Illustration
Execution time 0.92 µs
CTD_DINT
94
TLA1 1 msec (1)
LD
>CD
PV
CV
CV(94)
Q
Q(94)
LD CD PV Q CV
prev
CV
01 -> 010 05 5
0 0 -> 1 10 0 5 5 - 1 = 4
11 -> 0-2 14 -2
10 -> 11 0-2 1
0 0 -> 1 5 1 1 1 -1 = 0
1 1 -> 0 -2147483648 1 0 -2147483648
0 0 -> 1 10 1 -2147483648 -2147483648
CV
prev
is the previous cycle counter output value.
CTU
95
TLA1 1 msec (1)
>CU
R
PV
CV
CV(95)
Q
Q(95)