5. CONFIGURATION
Figure 87: Selecting Variables on the Symbol Configuration
After this procedure, the project must be loaded into a PLC so the variables will be available for communication with
the OPC DA Server. If the object Symbol Configuration screen is open and any of the variables, POUs or GVLs selected is
changed, its name will appear with the red color. The situations in which this may happen is when a variable is deleted or the
attribute value is modified.
It’s also possible to set which variables will be available on the OPC DA Server through an attribute inserted directly on
the POUs or GVLs where the variables are declared. When the attribute ’symbol’ is present on the variable declaration, and it
may be before the definition of the POU or GVL name, or to each variable individually, these variables are sent directly to the
object Symbol Configuration, with a symbol in the Attribute column. In this case it’s necessary, before loading the project into
the CPU, to run the command Build from within the object Symbol Configuration.
The valid syntaxes to use the attribute are:
attribute ’symbol’ := ’none’ – when the attribute value is ’none’, the variables won’t be available to the OPC DA Server
and won’t be shown in the object Symbol Configuration screen.
attribute ’symbol’ := ’read’ - when the attribute value is ’read’, the variables will be available to the OPC DA Server
with read only access right.
attribute ’symbol’ := ’write’ - when the attribute value is ’write’, the variables will be available to the OPC DA Server
with write only access right.
attribute ’symbol’ := ’readwrite’ – when the attribute value is ’readwrite’, the variables will be available to the OPC DA
Server with read and write access right.
In the following example of variable declaration, the variables A and B settings allow that an OPC DA Server access them
with read and write access. However the variable C cannot be accessed, while the variable D can be accessed with read only
access rights.
{attribute 'symbol' := 'readwrite'}
PROGRAM UserPrg
VAR
A: INT;
B: INT;
{attribute 'symbol' := 'none'}
C: INT;
{attribute 'symbol' := 'read'}
D :INT;
END_VAR
When a variable with a type different from the basic types is defined, the use of the attribute must be done inside the
declaration of this DUT and not only in the context in which the variable is created. For example, in the case of a DUT
instance inside of a POU or a GVL that has an attribute, it will not impact in the behavior of this DUT instance elements. It
will be necessary to apply the same access right level on the DUT declaration.
156