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 one |
RESET |
BOOL |
TRUE: Reset CV to 0 |
|
PV |
WORD |
Upper limit for incrementing |
|
Output |
Q |
BOOL |
TRUE if CV >= PV |
CV |
WORD |
Current counter value |