L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 143

Advertising
background image

L-force | PLC Designer

Quickstart

DMS 4.1 EN 03/2011 TD29

141

(4) Enter programming code in the body of PLC_PRG

ivar := ivar+1; // counter
fbinst(in:=11, out=>erg); // call function block of type FB1,
// with input parameter "in
// ouput is written to "erg"

Instead of steps (3) and (4) you can use the Auto Declaration feature: Without an
preceding declaration enter an instruction immediately in the body of the program,
then press the <Return>-key. For each not yet declared variable found in the
implementation line the Auto Declare dialog will open, where you now can carry out
the declaration settings:

The variables name and scope as well as the current POU (Object) will be filled in
automatically. Enter the desired type and initialization value according to the
declaration described in (3) and add a comment as shown in the dialog picture.
Confirm the dialog with OK. This will enter the declaration of erg in the declaration
part of the POU with the comments ahead:

Advertising