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

Page 961

Advertising
background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

959

Identifier: The identifier is the name of a variable. The items listed in the following in
each case must be regarded when defining an identifier.
• It must not contain spaces or special characters.
• It is not case-sensitive, which means that for example "VAR1", "Var1" and "var1"

are all the same variable.

• The underscore character is recognized in identifiers (for example, "A_BCD" and

"AB_CD" are considered two different identifiers), but an identifier must not have
more than one underscore character in a row.

• The length of the identifier as well as the meaningful part of it, are unlimited.
• The rules listed in the following text box concerning multiple use must be

regarded:

Multiple use of identifiers (namespaces):
• An identifier must not be used duplicate locally.
• An identifier must not be identical to any keyword.
• Globally an identifier can be used plurally, thus a local variable can have the same

name as a global one. Within a POU in this case the local variable will have priority.

• A variable defined in a Global Variables List can have the same name as a variable

defined in another Global Variables List. In this context notice the following IEC
61131-3 extending features, which have not been available in »PLC Designer« V2.3:

1.

Global scope Operator: An instance path starting with "." opens a global scope. So,
if there is a local variable, for example "ivar", with the same name as a global
variable, ".ivar" refers to the global variable.

2.

The name of a Global Variables List can be used as a namespace for the included
variables. So variables can be declared with the same name in different Global
Variable Lists and can be accessed specifically by preceding the variable name with
the list name.
Example:
globlist1.ivar := globlist2.ivar; (* ivar from globlist2 is copied to ivar in globlist1 *)

3.

Variables defined in a Global Variables List of an included library can be accessed
according to syntax <library namespace>.<name of Global Variables
List>.<variable>". See below for namespaces of libraries.
Example:
globlist1.ivar := lib1.globlist1.ivar (* ivar from globlist1 in library lib1 is copied to
ivar in globlist1 *)

• For a library also a namespace is defined, when it gets included via the Library

Advertising