L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 655

Advertising
background image

L-force | PLC Designer

PLC Designer Libraries



DMS 3.2 EN 02/2011 TD29

653

Declaration example:

CTDInst : CTD ;

Example in IL:

CAL CTDInst(CD := VarBOOL1, LOAD := VarBOOL2, PV :=
VarINT1)

LD CTDInst.Q

ST VarBOOL3

LD CTDInst.CV

ST VarINT2

Example in FBD:

Example in ST:

CTDInst(CD:= VarBOOL1, LOAD:=VarBOOL2 , PV:= VarINT1);

VarBOOL3 := CTDInst.Q ;

VarINT2 := CTDInst.CV;

CTUD

Provided by standard.lib.

Function Block Incrementer/Decrementer

The input variables CU, CD, RESET, LOAD as well as the output variables QU and QD
are type BOOL, PV and CV are type WORD.

If RESET is valid, the counter variable CV will be initialized with 0. If LOAD is valid, CV
will be initialized with PV.

If CU has a rising edge from FALSE to TRUE, CV will be raised by 1. If CD has a rising
edge from FALSE to TRUE, CV will be lowered by 1 provided this does not cause the
value to fall below 0.

QU returns TRUE when CV has become greater than or equal to PV.

Advertising