OPC UA client

Available from 2023.0 LTS

The OPC UA client supports subscribing variables from connected servers and writing changes of local variables to connected servers. The PLCnext Control device establishes the connection automatically as soon as the server is available. When the connection gets lost, the OPC UA client tries to reestablish the connection continuously.

The OPC UA client is available for all PLCnext Control devices starting with firmware version 2023.0 LTS.

Activation

The OPC UA client is an independent feature that can be activated via the WBM page System Services. It is deactivated by default.

Profile and facetsd

The eUA client implements the Minimum UA Client Profile and supports the following facets:

Licensing

To use the OPC UA client, a license is required. Without a license the client can be used for a trial period of 4 hours after starting the OPC UA client. For further use of the feature, an OPC UA client license must be purchased via the PLCnext Store. How to purchase and install the license is described in the PLCnext Store Info Center.

Types of variable groups

The OPC UA client supports two types of variable groups:

  • Subscribe groups subscribe to variables on the remote OPC UA server and write the changed values to variables of the PLCnext Control device.
  • Write groups monitor variables of the PLCnext Control device and write changed values to the remote OPC UA server.

Each variable group has an individual cycle time and there can be multiple variable groups with different intervals for each remote OPC UA server.

Note: In OPC UA the used sampling interval is a negotiation between client and server. For Subscribe groups the server can use a revised sampling interval which can be higher or lower than the requested one.

Supported variables

All local variables and global variables of PLCnext can be used if they have a supported data type. This includes complete arrays but not structures.

Note: Up to firmware version 2023.3 only variables that are also visible in the OPC UA server can be used (e. g. in PLCnext Engineer: Set visibility to Marked and check the OPC flag at the variables).

Supported data types

All data types supported by the OPC UA server can also be used for the OPC UA client.

The type of the remote variable needs to be compatible. This means it must be of the same build-in type as documented at the OPC Foundation website. For a thorough mapping of IEC 61131‑3 data types to OPC UA® data types, see this reference table published by the OPC UA® Foundation.

This allows connections to variables of derived data types. As an example, the type duration is derived from double. Therefore a remote duration variable can be connected to a local double variable.

Limits

The OPC UA® client does not limit the number of connected servers, variable groups or variables within a group. This is to support different applications where the client is either a small extension using a few resources or where the client is the main part of the application.

Note: It is the responsibility of the user to ensure that a CPU usage of about 80 % is not exceeded, visible in the PLCnext Engineer cockpit (hide screenshotshow where to see the CPU load), or in the WBM cockpit (available from firmware version 2023.0 LTS).

Module configuration

The module configuration is about general, connection independent settings of the OPC UA client module. For all these settings there are default values so that in common cases no changes are required. For further information see Module configuration of the OPC UA client.

Connection configuration

The OPC UA® client can be configured with PLCnext Engineer from version 2023.3 or manually using XML files stored on the device. For further information see Connection configuration.

Tutorial - OPC UA setup for PLCnext Control

This tutorial video explains how to configure a secure OPC UA server and client communication on PLCnext Control. It features the following topics:

  • Configure the OPC UA server in a PLCnext Engineer project
  • Check the OPC UA server configuration with the UaExpert reference client
  • Create the OPC UA client in a PLCnext Engineer project
  • Map the variables
  • Activate the OPC UA client feature
  • Where to get a permanent license
  • Set up the certificate authentication on both devices
  • Check for proper notifcations
  • Test the communication with a variables roundtrip

cookie

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.
Even showing the video previews on this page depends on your personal settings in the Cookie consent dialog. To watch YouTube videos, you have to allow cookies for marketing purposes which will remain on your device. The data gained through these cookies will be used by YouTube to provide video suggestions and advertisements based on your browsing habits, and may be made available to other parties.

Check and change your cookie consent

Security

Authentication, security policies and trust stores are used within the OPC UA® client. For further information see OPC UA client security.

XML schema

The format of the connection configuration is described in OPC UA client XML schema

Troubleshooting

In this section you will find some tips on common problems with the OPC UA® client configuration.

Connection

If the connection cannot be established:

  • Check the notification log for error information in PLCnext Engineer or the WBM page Notifications.
  • Verify that the OPC UA client is activated via the WBM page System Services.
  • Verify that the current certificate of the remote OPC UA server is in the OPC UA client trust store (WBM → SecurityCertificate Authentication Trust Stores).
    Or, for testing purpose only: Disable Application Authentication (see OPC UA client module configuration)
  • Verify that the current certificate of the client (WBM → SecurityCertificate AuthenticationIdentity Stores) is in the trust store of the remote OPC UA server.
  • Check the firewall configuration (connection from the PLC to the PC is often blocked).
  • Use IP addresses in the certificates of client and server or ensure that a DNS server is available which can resolve the host names (i.e. enter the IP address into the DNS name / IP address field of the OPC UA server configuration in PLCnext Engineer).

Security

Some security checks lead to bad result codes which can be switched off (not recommended). For further information see OPC UA client security and OPC UA client module configuration

  • Server certificate verification failure results in Bad_CertificateUntrusted. This security check can be disabled with the Application Authentication switch.
  • Server certificate application URI validation failure results in Bad_CertificateUriInvalid. This security check can be disabled with the Application Uri Check switch.
  • Server certificate hostname validation failure results in Bad_CertificateHostNameInvalid. This security check can be disabled with the Certificate Hostname Check switch.
  • Server certificate time validation failure results in Bad_CertificateTimeInvalid. This security check can be disabled with the Certificate Time Check switch .
  • Server certificate issuer time validation failure results in Bad_CertificateIssuerTimeInvalid. This security check can be disabled with the Certificate Issuer Time Check switch.

Variables

If variables are not synchronized:

  • Check the notification log for error information, either in PLCnext Engineer or the WBM page Notifications.
  • Check the correct NodeIds with an OPC UA client that can browse the address space of the server and the client (with general purpose OPC UA client like UA Expert).


• Published/reviewed: 2024-09-24   ☀  Revision 073 •