16 programming reference, Declaration, Variables declaration – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 960: Programming reference, L-force | plc designer

Advertising
background image

L-force | PLC Designer

Programming Reference

958

DMS 4.1 EN 03/2011 TD29

16

Programming Reference

16.1

Declaration
The variables of a project are to be declared manually in the declaration editor or via
the Auto Declare dialog. See the further related help pages referring for example on
the various categories of variables (local, global, input, output etc.), the initialization,
the use of pragmas, init method etc.

16.1.1

Variables Declaration
The declaration of a variable can be done in the declaration part of a POU or via the
Auto Declare dialog, as well as in a DUT or GVL editor.
The "sort" (in the declaration dialog it is named "scope") of the variable(s) to be
declared is specified by the keywords embracing the declaration of one or several
variables. The common variable declaration for example is embraced by "VAR" and
"END_VAR".
The variable type keywords may be supplemented by attribute keywords, like for
example "RETAIN" (VAR_INPUT RETAIN).
The declaration of a variable must match the following rules:
Syntax:
<Identifier> {AT <address>}:<Type> {:=<initialization>};
The parts in braces {} are optional.

Advertising