CTU
(FB)
FUNCTION_BLOCK CTU
Increments a given value
(* Example declaration *)
CTUInst : CTU ;
(* Example in ST *)
CTUInst(CU:= VarBOOL1, RESET:=VarBOOL2 , PV:= VarWORD1);
VarBOOL3 := CTUInst.Q ;
VarWORD2 := CTUInst.CV;
- InOut:
Scope
Name
Type
Comment
Input
CU
BOOL
Rising edge: Incrementing
CV
by oneRESET
BOOL
TRUE
: ResetCV
to 0PV
WORD
Upper limit for incrementing
Output
Q
BOOL
TRUE
ifCV >= PV
CV
WORD
Current counter value