LCTD (FB)ΒΆ
FUNCTION_BLOCK PUBLIC LCTD
Decrements a given value
(* Example declaration *)
LCTDInst : LCTD ;
(* Example in ST *)
LCTDInst(CD:= VarBOOL1, LOAD:=VarBOOL2 , PV:= VarLWORD1);
VarBOOL3 := CTDInst.Q ;
VarLWORD2 := CTDInst.CV;
- InOut:
Scope
Name
Type
Comment
Input
CD
BOOL
Rising edge: Decrementing
CV
by oneLOAD
BOOL
TRUE
: SetCV
to the start valuePV
PV
LWORD
Start value for decrementing
Output
Q
BOOL
TRUE
ifCV = 0
CV
LWORD
Current counter value