Part 1: Creating an OPC UA Server (OPC UA Toolkit)

LabVIEW 2018 OPC UA Toolkit Help


Edition Date: March 2018
Part Number: 376230B-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2017 OPC UA Toolkit Help
LabVIEW 2018 OPC UA Toolkit Help
LabVIEW 2019 OPC UA Toolkit Help

You can use the OPC UA Server VIs to create an OPC UA server application that communicates with any OPC UA client. In Part 1 of this tutorial, you complete the following tasks:

  • Creating an OPC UA server that supports only non-secure connections
  • Creating an OPC UA server that supports only secure connections
  • Creating an OPC UA server that supports both non-secure and secure connections

Creating an OPC UA Server That Supports Only Non-Secure Connections

What to Use

Use the following objects to create an OPC UA server that supports only non-secure connections:

What to Do

Create the following block diagram to add an OPC UA server that supports only non-secure connections.

The following list describes important details about the previous diagram:

The server endpoint URL output of the Create VI returns the unique identifier of the OPC UA server.
(Recommended) The While Loop enables the VI to run continuously. Because an OPC UA server does not have any background services, LabVIEW destroys the OPC UA server when the VI stops. Therefore, you can create a structure, such as a While Loop, Event structure, or Time Delay, to enable the example VI to run continuously and avoid destroying the OPC UA server.
Use the Stop VI to stop the OPC UA server before you use the Close VI to close and destroy the OPC UA server.

Creating an OPC UA Server That Supports Only Secure Connections

What to Use

Use the following objects to create an OPC UA server that supports only secure connections:

What to Do

Create the following block diagram to add an OPC UA server that supports only secure connections.

The following list describes important details about the previous diagram:

The supported security policies constant of the Create VI specifies the message mode and security policies that the OPC UA server supports. To prevent the OPC UA client from establishing a non-secure connection to the OPC UA server, you must set None to FALSE. To establish secure connections between the OPC UA client and the OPC UA server, you must select one or multiple message modes and security policies.
The server certificate file control of the Create VI specifies the path or name of the public key.
Note Note  If the OPC UA server does not trust the certificate file that the OPC UA client uses, LabVIEW returns an error. Ensure that you add trusted OPC UA client certificates to an OPC UA server when you create an OPC UA server that supports only secure connections.
(Optional) The Clear All Trusted Clients VI clears the OPC UA client certificates that the OPC UA server trusts. After you start the OPC UA server, you cannot clear the trusted client certificates until the OPC UA server stops.
The Add Trusted Clients VI adds trusted OPC UA client certificates to the OPC UA server. After you start the OPC UA server, you cannot add trusted client certificates until the OPC UA server stops. The trusted client certificates control of the Add Trusted Clients VI specifies the file paths of the certificates that the OPC UA server trusts. You must manually copy the trusted client certificates from the OPC UA client machine to the OPC UA server machine, and then enter the path in trusted client certificates.

Creating an OPC UA Server That Supports Both Non-Secure and Secure Connections

What to Use

Use the following objects to create an OPC UA server that supports both non-secure and secure connections:

What to Do

Create the following block diagram to add an OPC UA server that supports both non-secure and secure connections.

The following list describes important details about the previous diagram:

The supported security policies constant of the Create VI specifies the message mode and security policies that the OPC UA server supports. To establish a non-secure connection between the OPC UA client and the OPC UA server, you must set None to TRUE. To establish secure connections between the OPC UA client and the OPC UA server, you must select one or multiple message modes and security policies.
The server certificate file control of the Create VI specifies the path or name of the public key.
Note Note  To establish a non-secure connection with a client, make sure that the domain names include the machine name of the server application.
(Optional) The Clear All Trusted Clients VI clears the OPC UA client certificates that the OPC UA server trusts. After you start the OPC UA server, you cannot clear the trusted client certificates until the OPC UA server stops.
The Add Trusted Clients VI adds trusted OPC UA client certificates to the OPC UA server. After you start the OPC UA server, you cannot add trusted client certificates until the OPC UA server stops. The trusted client certificates control of the Add Trusted Clients VI specifies the file paths of the certificates that the OPC UA server trusts. You must manually copy the trusted client certificates from the OPC UA client machine to the OPC UA server machine, and then enter the path in trusted client certificates.
Previous
Creating an OPC UA Server and an OPC UA Client
Next
Using an OPC UA Server

WAS THIS ARTICLE HELPFUL?

Not Helpful