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

Page 1001

Advertising
background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

999

Hint: The length of a string variable may be arbitrarily defined (even >255), however be
aware that the string will be cut (from its back end) if it gets assigned to a variable of a
too short data type.

Attribute linkalways
The pragma {attribute 'linkalways'} allows to mark POUs for the compiler in a way so
that they are always included into the compile information. As a result, objects with
this option will be always compiled and downloaded to the PLC. This option only
affects POUs and GVLs that are located below an application or in libraries which are
inserted below an application. The compiler option Link always does the same.
Syntax:
{attribute 'linkalways’}

When using the symbol configuration editor the marked POUs are used as basis for
the selectable variables for the symbol configuration.
Example:
The global variable list GVLMoreSymbols is implemented making use of the attribute:

{attribute 'linkalways'}
VAR_GLOBAS
g_iVar1: INT;
g_iVar2: INT;
END_VAR

With this code the symbols of GVLMoreSymbols get selectable in the symbol
configuration.

Abb. 538 Symbol configuration editor

Advertising