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;
Scope
Name
Type
Comment
Input
CU
BOOL
Rising edge: Incrementing CV by one
RESET
TRUE: Reset CV to 0
PV
WORD
Upper limit for incrementing
Output
Q
TRUE if CV >= PV
CV
Current counter value