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

Arguments | ||
---|---|---|
CU | BOOL | Counting input (counting when CU is TRUE) |
RESET | BOOL | Reset command (dominant) |
PV | DINT | Programmed maximum value |
Q | BOOL | Overflow: TRUE when CV >= PV |
CV | DINT | Counter result |
Example
(* FBD program using the CTU block *)

(* ST Equivalence: We suppose F_TRIG1 is an instance of F_TRIG block and CTU1 is an instance of CTU block*)
F_TRIG1(command); CTU1(F_TRIG1.Q,NOT(auto_mode),100); overflow := CTU1.Q; result := CTU1.CV;
Provide Feedback