CTD
Counts (integers) from a given value down to 0 in increments of 1.
IMPORTANT:
The CTD block does not detect the rising edges or
falling edges of the counting input (CD). The block must be associated with an "R_TRIG" or
"F_TRIG" block to create a pulse counter.

Arguments | ||
---|---|---|
CD | BOOL | Counting input (down-counting when CD is TRUE) |
LOAD | BOOL | Load command (dominant) (CV = PV when LOAD is TRUE) |
PV | DINT | Programmed initial value |
Q | BOOL | Underflow: TRUE when CV <= 0 |
CV | DINT | Counter result |
Example
(* FBD program using the CTD block *)

(* ST Equivalence: We suppose F_TRIG1 is an instance of F_TRIG block and CTD1 is an instance of CTD block*)
F_TRIG1(command); CTD1(F_TRIG1.Q,load_cmd,100); underflow := CTD1.Q; result := CTD1.CV;
Provide Feedback