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

Page 39

Advertising
background image

L-force | PLC Designer

What is What in PLC Designer



DMS 3.2 EN 02/2011 TD29

37

4.1.4

Function Block

A function block is a POU which provides one or more values during the procedure.

As opposed to a function, a function block provides no return value.

A function block declaration begins with the keyword FUNCTION_BLOCK. Regard the
Recommendations on the naming.

Reproductions or instances (copies) of a function block can be created.

The call of a function block is done via a function block instance.

Example in IL of a function block with two input variables and two output variables:

One output (iMulErg) is the product of the two inputs, the other (xVergl) is a
comparison for equality:

Declaration part:

FUNCTION_BLOCK FUB

VAR_INPUT

iPar1:INT;
iPar2:INT;

END_VAR

VAR_OUTPUT

iMulErg:INT;
xVergl:BOOL;

END_VAR

Implementation part in IL:

LD iPar1
MUL iPar2
ST iMulErg

LD iPar1
EQ iPar2
ST xVergl

Advertising