CTUD

Counts (integer) from 0 up to a given value 1 by 1 or from a given value down to 0 1 by 1
lrsb_ctud1_aadvance
Arguments
CU
BOOL
Up-counting (when CU is a rising edge)
CD
BOOL
Down-counting (when CD is a rising edge)
RESE
BOOL
Reset command (dominant)
(CV = 0 when RESET is TRUE)
LOAD
BOOL
Load command (CV = PV when LOAD is TRUE)
PV
DINT
Programmed maximum value
QU
BOOL
Overflow: TRUE when CV >= PV
QD
BOOL
Underflow: TRUE when CV <= 0
CV
DINT
Counter result
Example
(* FBD program using the CTUD block *)
lrsb_ctud2_aadvance
(* ST Equivalence: We suppose CTUD1 is an instance of block*)
CTUD1(trigger1, trigger2, reset_cmd, load_cmd,100); full := CTUD1.QU; empty := CTUD1.QD; nb_elt := CTUD1.CV;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal