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

Page 1012

Advertising
background image

L-force | PLC Designer

Programming Reference

1010

DMS 4.1 EN 03/2011 TD29

Attribute Symbol
The pragma {attribute 'symbol'} defines which variables are to be handled in the
Symbolconfiguration, which means that they will be exported as "symbols" into a
symbol list, exported to a XML-file in the project directory as well as to a file not visible
for the user and available on the target system for external access, e.g. by an OPC-
Server. Variables provided with that attribute will be downloaded to the PLC even if
they have not been configured or are not visible within the symbol configuration
editor.
Regard that the symbol configuration must be available as an object below the
respective application in the devices tree.
Syntax:
{attribute 'symbol’ := 'none’ | 'read’ | 'write’ | ‘readwrite’}
Regard that access is only allowed on symbols coming from programs or global
variable lists
. For accessing a symbol the symbol name must be specified completely.
The pragma definition can be assigned to particular variables or collectively to all
variables declared in a program:
• To be valid for a single variable the pragma has to be placed in the line before the

variables declaration.

• To be valid for all variables contained in the declaration part of a program the

pragma has to be placed in the first line of the declaration editor. Anyway also in
this case the settings for particular variables might be modified by an explicit
adding of a pragma.

The possible access on a symbol is defined by the pragma parameter 'none', 'read',
'write' or 'readwrite'. If no parameter is defined, the default 'readwrite' will be valid.

Example:
With the following configuration the variables A and B will be exported with read and
write access. Variable D will be exported with read access.

{attribute 'symbol' := 'readwrite'}
PROGRAM PLC_PRG
VAR
A : INT;
B : INT;
{attribute 'symbol' := 'none'}
C : INT;
{attribute 'symbol' := 'read'}
D : INT;
END_VAR

Advertising