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