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 one

LOAD

BOOL

TRUE: Set CV to the start value PV

PV

LWORD

Start value for decrementing

Output

Q

BOOL

TRUE if CV = 0

CV

LWORD

Current counter value