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
CUBOOLRising edge: Incrementing
CVby oneRESETBOOLTRUE: ResetCVto 0PVWORDUpper limit for incrementing
Output
QBOOLTRUEifCV >= PVCVWORDCurrent counter value