OPC UA Connection

Prerequisites

As a prerequisite for creating an OPC UA connection, an OPC UA server must be configured on your controller and must be started.

Creating an OPC UA Connection

To create an OPC UA connection, proceed as follows:

Step

Action

1

In the Connections view, right-click inside the table and run the command OPC UA Client from the contextual menu.

Result: A new row is added to the table with Protocol = OPC UA.

2

Select this row and configure the connection in the Properties view.

3

In the Communication section, edit the OPC Server Address parameter to enter the IP address and the port of the controller you want to connect to. Use the following format as an example, using the default port 4840:

opc.tcp://127.0.0.0:4840

4

In the Connections view, right-click the row you created for the OPC UA connection and run the Connect command from the contextual menu.

5

Enter the Username and Password in the OPC UA Credentials dialog box.

NOTE: If anonymous login is allowed by the OPC UA server, select the check box Anonymous Login in the Properties view to avoid this dialog box for future logins.

Result: The message Untrusted Certificate is displayed.

6

Verify that you are about to connect to the correct URL and you trust the certificate. Click Yes to proceed or No to cancel.

Result: After the connection to the controller is established, you can see Status = Connected displayed in the row of the selected connection. The available tags are read from the OPC UA server, as indicated in the Logs view by the messages Started reading tags and Finished reading tags. The controller variables can be selected within EcoStruxure Machine Expert Twin. Subscribed controller variables are listed in the Outputs view.

OPC UA-Specific Commands of the Connections View

The contextual menu of the Connections view does not provide any OPC UA-specific commands apart from those described in General Commands of the Connections View.

OPC UA-Specific Settings in the Properties View

The following settings of the Properties view are specific to OPC UA connections:

Parameter

Description

Communication

Anonymous Login

If anonymous login is allowed in the OPC UA server (for details, refer to the description of the Disable anonymous login parameter in the OPC UA Server Configuration in the M262 Logic/Motion Controller - Programming Guide in the EcoStruxure Machine Expert online help) select this check box to avoid entering credentials.

Communication Interval

Enter the minimum delay (in ms) that must elapse between the OPC UA client data requests sent to the OPC UA server.

Default value: 16 ms

NOTE: Consider the impact this polling frequency can have on the performance of the OPC UA server when reducing the value. If you transfer a large amount of data using an OPC UA connection, consider increasing the polling frequency to avoid slowing down the performance of the OPC UA server.

OPC Server Address

Enter the IP address and the port of the controller you want to connect to. Use the following format as an example, using the default port 4840:

opc.tcp://127.0.0.0:4840

Use Publish-Subscribe

Select this check box to activate the publish/subscribe data exchange between the OPC UA client and server.

For a description of the general settings, refer to General Parameters of the Properties View.