How To Create Opc Ua Server
Quickstart OPC UA server configuration
Tutorial video
Note: Tutorial videos are embedded from the Phoenix Contact Technical Support YouTube channel. With playing an embedded YouTube video in this platform, you accept the YouTube Terms & Conditions.
Depending on your personal settings in the Cookie consent dialog you may have allowed cookies for marketing purposes which will remain on your device. The data gained through this will be used by YouTube to provide video suggestions and advertisements based on your browsing habits, and may be made available to other parties.
| | 04m:35s | | HDTV 720p | | English | | English |
How to
If a controller features an integrated OPC UA server, it is displayed in the PLCnext Engineer software in thePLANT area →OPC UA. Here, you can configure the OPC UA server. The configuration is loaded to the controller as part of aPLCnext Engineer project and in form of a configuration file. It contains all parameters for setting the OPC UA server. All users of an OPC UA must authenticate themselves to the OPC UA server with a user name and a password. You can create a user via the WBM of the controller (see Web-based management (WBM)). In the course of this, you have to assign the necessary roles:
-
DataViewer -
DataChanger -
FileReader -
FileWriter
It is highly recommended to make sophisticated use of the different user roles for access in different use cases, such as accessing the PLCnext device for programming, OPC UA access, PLCnext Engineer HMI etc. For further information on user roles, please refer to the User Authentication. In case an authentication fails, see Authentication failure handling.
With PLCnext Engineer, the following configurations are possible:
- Defining the server endpoint URI:
Define the name of the network node the eUA server is to use in the server URI and in the endpoint URL. - Defining which certificate the server should use:
Download a dedicated certificate to the controller, use a self-signed certificate created by the controller or connect to a OPC UA Global Discovery server (GDS). - Visibility of variables and alarms for the OPC UA clients:
Due to security reasons, the variables and ports of a program in PLCnext Engineer are set tonot visibleby default.
Visibility is set in your PLCnext Engineer project: In the PLANT area, open the OPC UA node and open the Basic settings. Via theVisibility of variables drop-down list, you can set the visibility of variables for the OPC UA clients:
- Privilege settings for data access:
You can configure access of clients to the file system of the server. Read and write access for clients to selected folders and files in the file system of the server as well as creating additional directories and files are possible. Once this option is active, only PLCnext Technology users with aFileReaderorFileWriterrole can read or write files.
The required roles are assigned to the user in the Web-based Management (WBM) of the controller (see User Authentication).
The OPC UA server always accesses the Linux file system as theplcnext_firmwareLinux user. It makes no difference which firmware user you use to log in as the OPC UA client, or whether you have deactivated the user authentication. All the files and directories are created by theplcnext_firmwareuser.
For further information on configuring OPC UA in PLCnext Engineer, please refer to the help system embedded in thePLCnext Engineer user interface.
Accessing variables via OPC UA subscriptions
Values of PLC variables can be subscribed via OPC UA. For this, the OPC UA server uses the RSC service ISubscriptionService (see RSC GDS Services for details).
The OPC UA server can be configured to use different subscription kinds:
-
RealTimeprovides task-synchronous values but may increase the execution time of ESM tasks. -
DirectReadcollects the values by a separate task that also collects the values of global and component variables. So by configuring the subscription asDirectReadthe collection of values does not increase the execution time of ESM tasks.
With RealTimesetting, the subscription determines the related ESM task from the variable's instance path. The subscription instructs the related ESM task to collect the values of the variables. This ensures that all values which are calculated in the same task are collected in the same execution cycle of the ESM task, which means that the collected values are task synchronous. This is possible for all variables except global variables (IEC 61131-3), and for variables defined in a component instance. The values of global variables (IEC 61131-3) and component variables are not collected by an ESM task. The subscription creates a separate task which is executed cyclically with the revisedSamplingInterval(see OPC UA monitored item and subscription for details).
Note: Beware of the ESM task watchdog! While task-synchronous values offer some advantages for further processing in the OPC UA client, they can also have an effect on the execution time: The collection of the values requires CPU time which increases the execution time of the ESM task(s) involved. Normally this is irrelevant but if many variables are processed this may trigger the ESM task watchdog (especially if the ESM task watchdog is configured close to the task's regular execution time without anOPC UA client attached).
For more details on the SubscriptionKind parameter, see RSC ISubscriptionService .
Default SubscriptionKindsettings
- Up to firmware andPLCnext Engineer releases 2020.0 LTS, the OPC UA configuration does not include the
<SubscriptionKind>tag at all, so no configuration is possible. These versions use the<SubscriptionKind>RealTime. - With firmware andPLCnext Engineer releases 2020.3 and 2020.6, the OPC UA server provides values that are synchronous to the ESM tasks, done by having the
<SubscriptionKind>set toRealTimeby default. Changes to the configuration can be done manually. - From firmware and PLCnext Engineer release 2021.0 LTS, the
<SubscriptionKind>is set toDirectReadby default.PLCnext Engineer provides a configuration option.
| Firmware release | OPC UA subscription configuration | SubscriptionKind default value |
| up to 2020.0 LTS | no configuration possible | RealTime |
| 2020.3 and 2020.6 | manual configuration only | RealTime |
| from 2021.0 LTS | configuration byPLCnext Engineer or manually | DirectRead (if the 2021.0 LTS project template is used) |
Configuration byPLCnext Engineer
Available only from firmware used withPLCnext Engineer
on controllers
Manual configuration
The configuration is done by editing the PCWE.opcua.config configuration file in the/opt/plcnext/Projects/PCWE/Services/OpcUa/ directory on the controller.
Note: This has to be repeated after each project download by PLCnext Engineer because manual changes will be overwritten with each download. To activate the configuration, perform a warm or cold start, or restart the firmware.
Note the XML entities when editing XML configuration files:
There are symbols in the XML code that cannot be represented as attribute values because they fulfill a function in the code. For example, the characters < and > are used to open and close XML tags. To be able to use these characters as attribute values (e. g. less than or greater than), the special XML entities are required.
The following entities are predefined in the XML specification. Make sure to use these entities in the attribute value to avoid XML parser errors:
| Character | Entity |
| Ampersand (&) | & |
| Single quote (') | ' |
| Double quote (") | " |
| Less than (<) | < |
| Greater than (>) | > |
- Add the
<SubscriptionSettings>tag in the XML file, e. g. right before the<SecuritySettings>tag. - Insert (or change, if already present) the
<SubscriptionKind>tag with the valueDirectReadorRealTime.
Example with DirectRead:
<SubscriptionSettings> <SubscriptionKind>DirectRead</SubscriptionKind> </SubscriptionSettings> How To Create Opc Ua Server
Source: https://www.plcnext.help/te/Service_Components/OPC_UA_Server/OPCUA_server_configuration.htm
Posted by: baileydoopeas.blogspot.com

0 Response to "How To Create Opc Ua Server"
Post a Comment