CTD (FB)¶
FUNCTION_BLOCK CTD
Decrements a given value
(* Example declaration *)
CTDInst : CTD ;
(* Example in ST *)
CTDInst(CD:= VarBOOL1, LOAD:=VarBOOL2 , PV:= VarWORD1);
VarBOOL3 := CTDInst.Q ;
VarWORD2 := CTDInst.CV;
- InOut:
Scope
Name
Type
Comment
Input
CDBOOLRising edge: Decrementing
CVby oneLOADBOOLTRUE: SetCVto the start valuePVPVWORDStart value for decrementing
Output
QBOOLTRUEifCV = 0CVWORDCurrent counter value