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

Page 40

Advertising
background image

L-force | PLC Designer

What is What in PLC Designer

38

DMS 3.2 EN 02/2011 TD29



4.1.5

Function Block Instances

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

Each instance possesses its own identifier (the Instance name), and a data structure
which contains its inputs, outputs, and internal variables. Instances are declared
locally or globally as variables, whereas the name of the function block is indicated as
the type of an identifier.

Regard the Recommendations on the naming.

Example of an instance with the name INSTANCE of the FUB function block:

fubInstance: FUB;

Function blocks are always called through the instances described above.

Only the input and output parameters can be accessed from outside of an function
block instance, not its internal variables.

Example for accessing an input variable

The function block FB has an input variable in1 of the type INT.

PROGRAM prog

VAR
fbinst1:fb;
END_VAR

LD 17
ST fbinst1.in1
CAL fbinst1

END_PROGRAM

Advertising