The number of symbols which can be exchanged via OPC UA is limited based on the used PLC type. OPC UA symbols can be configured via two ways:
-
Select the symbols in the “Symbol Configuration” object and enable the flag “Support OPC UA features”. All selected symbols are counted for the OPC UA tag limitation.
-
Define the symbols in the “Symbol Set” object(s) below “Communication Manager OPC UA Server”. All defined symbols are counted for the OPC UA symbol limitation, independently if they are defined in several “Symbol Set” objects.
In case both ways are used in parallel the sum of the symbols is considered for the OPC UA symbols limitation.
In addition to the known “Symbol Configuration Editor”, with CODESYS Communication there is also a new editor for configuring IEC symbols for exchanging with other controllers.
Currently, the “IEC Symbol Publishing” object for the publication of symbols via “OPC UA” is available. The object has to be inserted in the device tree below the application below the “Communication Manager” object and there again below an “OPC UA Server” object.
You can insert multiple “IEC Symbol Publishing” type objects to configure different symbol sets for different purposes. Individually assign the object names accordingly. In the OPC UA Client, a separate folder with the assigned name is then created for each symbol set.
The IEC symbol set configuration is based on precompile information. In contrast to the known “Symbol Configuration”, the project does not necessarily have to be in an error-free compilable state to get the variables and types available in the project for a configuration in the editor. Discrepancies between the editor and the project, which may result due to changes in the project, will be brought to your attention and you will be assisted in making corrections.
Creating and configuring a symbol set
Requirement:
You have a project with IEC variables and IEC data types. You want to exchange a specific set of variables as symbols with other OPC UA Clients via an OPC UA Server. For the following instructions: To control the publication, you have also created a data source of type OPC UA in the project. See here: Establishing the Connection of a Data Source OPC UA Client to an OPC UA Server.
In the following, you create the required symbol configuration for a symbol set in the editor of an object of type “IEC Symbol Publishing”:
⮫ “Object: IEC Symbol Publishing”
-
Click [Add Object] to add a “Communication Manager” below the application.
-
Add an “OPC UA Server” below the communication manager.
-
Add an “IEC Symbol Publishing” object below the “OPC UA Server” and rename the object (for example, "webvisu", or "client xy", depending on the intended use of the symbol set to be configured).
-
Double-click the symbol publishing object to open the editor.
Below “Precompile Sets” in the left part of the window, the variables and types which are currently supported in the project for publishing are listed.
-
Select one or more variables or a POU containing variables and drag the selection to the right part of the window.
The variable(s) are inserted into the table.
-
Configure all desired variables in the table for export as symbols. If necessary, assign a different symbol name and set the access rights. When assigning the access rights, note the “Use access rights defined in the user management” option at the top of the editor. When this option is selected, the rights assigned in the user management of the controller for the symbol set are also considered in addition to the access rights set here in the editor. The stronger restriction is applied.
-
If you have structured data types in the project, then on the “Symbol Type Editor” tab you can make a specific symbol configuration for different variants of the type:
-
For example, on the “Symbol Type Editor” tab, drag a POU of type
STRUCT
to the table on the right side of the window. Click thebutton to open the Data type members of <
STRUCT
> dialog. -
Select the members of the <
STRUCT
> POU to be exported as symbols and configure accordingly. Close the dialog. -
Option: On the “Symbol Type Editor” tab, drag the same POU of type
STRUCT
to the table a second time and configure it with the corresponding name as a "variant" of the first one. -
In the project, change something in the declaration of the
STRUCT
type, for example, add another member. Then click“Refresh” in the symbol editor.
An
icon is displayed at the corresponding entry in the table. In the tooltip of the icon, you will be prompted to click the
button to resynchronize between the editor and the project.
-
Click the
button.
The “Data type members of<STRUCT>” dialog opens and by clicking [D] the editor and project are synchronized again. The new member is added to the configuration table.
-
When the symbol configuration is finished, log in to the controller and open the data source object created for OPC UA to check the symbols for publishing.
On the “Variables” tab, you can see the symbol set(s) with the variables and types you have defined as symbols.