LCTU (FB)ΒΆ

FUNCTION_BLOCK PUBLIC LCTU

Increments a given value

(* Example declaration *)
LCTUInst : LCTU ;

(* Example in ST *)
LCTUInst(CU:= VarBOOL1, RESET:=VarBOOL2 , PV:= VarLWORD1);
VarBOOL3 := CTUInst.Q ;
VarLWORD2 := CTUInst.CV;
InOut:

Scope

Name

Type

Comment

Input

CU

BOOL

Rising edge: Incrementing CV by one

RESET

BOOL

TRUE: Reset CV to 0

PV

LWORD

Upper limit for incrementing

Output

Q

BOOL

TRUE if CV >= PV

CV

LWORD

Current counter value