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

Page 654

Advertising
background image

L-force | PLC Designer

PLC Designer Libraries

652

DMS 3.2 EN 02/2011 TD29



Declaration example:

CTUInst : CTU ;

Example in IL:

CAL CTUInst(CU := VarBOOL1, RESET := VarBOOL2, PV :=
VarINT1)

LD CTUInst.Q

ST VarBOOL3

LD CTUInst.CV

ST VarINT2

Example in FBD:

Example in ST:

CTUInst(CU:= VarBOOL1, RESET:=VarBOOL2 , PV:= VarINT1);

VarBOOL3 := CTUInst.Q ;

VarINT2 := CTUInst.CV;

CTD

Provided by standard.lib.

Function Block Decrementer:

The input variables CD and LOAD as well as the output variable Q are type BOOL, the
input variable PV and the output variable CV are type WORD.

When LOAD_ is TRUE, the counter variable CV will be initialized with the upper limit

PV. If CD has a rising edge from FALSE to TRUE, CV will be lowered by 1 provided CV is
greater than 0 (i.e., it doesn't cause the value to fall below 0).

Q returns TRUE when CVis equal 0.

Advertising