318
Counters
CTD
(10047)
Illustration
Execution time
Operation
Inputs
Outputs
CTD_DINT
(10046)
Illustration
Execution time
Standard function blocks
TLA1 1 msec
LD
>CD
PV
0.92 µs
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 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 -32768, the counter output remains unchanged.
The status output (Q) is 1 if the counter output (CV) value < 0.
Example:
LD
CD
0
1 -> 0
0
0 -> 1
1
1 -> 0
1
0 -> 1
0
0 -> 1
1
1 -> 0
0
0 -> 1
CV
is the previous cycle counter output value.
prev
Counter input (CD): Boolean
Load input (LD): Boolean
Preset input (PV): INT
Status output (Q): Boolean
Counter output (CV): INT
CTD_DINT
TLA1 1 msec
LD
>CD
PV
0.92 µs
CTD
93
(1)
CV(93)
CV
Q(93)
Q
PV
Q
10
0
10
0
-2
1
1
0
5
1
-32768
1
10
1
94
(1)
CV(94)
CV
Q(94)
Q
CV
CV
prev
5
5
5
5 - 1 = 4
4
-2
-2
1
1
1 -1 = 0
0
-32768
-32768
-32768