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
CD
BOOL
Rising edge: Decrementing
CV
by oneLOAD
BOOL
TRUE
: SetCV
to the start valuePV
PV
WORD
Start value for decrementing
Output
Q
BOOL
TRUE
ifCV = 0
CV
WORD
Current counter value