Part 3: Establishing Connections between an OPC UA Server and an OPC UA Client (OPC UA Toolkit)
- Updated2023-02-21
- 4 minute(s) read
Part 3: Establishing Connections between an OPC UA Server and an OPC UA Client (OPC UA Toolkit)
You can use the OPC UA Client VIs to create an OPC UA client application that communicates with any OPC UA server. In Part 3 of this tutorial, you establish a non-secure connection and secure connection between an OPC UA server and an OPC UA client.
Establishing a Non-Secure Connection between an OPC UA Server and an OPC UA Client
What to Use
Use the following objects to establish a non-secure connection between an OPC UA server and an OPC UA client.
Connect VI | Disconnect VI | ||||||
![]() |
![]() |
||||||
|
|
What to Do
Create the following block diagram to establish a non-secure connection between an OPC UA server and an OPC UA client.

The following list describes important details about the previous diagram:
![]() | The server endpoint URL control of the Connect VI specifies the endpoint URL to which the OPC UA client connects. |
![]() | The security policy constant of the Connect VI specifies the message mode and security policy to use. To connect an OPC UA client to an OPC UA server in non-security mode, you must set message mode to None. An OPC UA client has to trust the OPC UA server certificate even for an insecure connection. |
![]() | The Disconnect VI disconnects the OPC UA client from the OPC UA server. |
Establishing a Secure Connection between an OPC UA Server and an OPC UA Client
What to Use
Use the following objects to establish a secure connection between an OPC UA server and an OPC UA client.
Connect VI | Disconnect VI | ||||||
![]() |
![]() |
||||||
|
|
What to Do
Create the following block diagram to establish a secure connection between an OPC UA server and an OPC UA client.

The following list describes important details about the previous diagram:
![]() | The security policy constant of the Connect VI specifies the message mode and security policy to use. To establish secure connections between an OPC UA server and an OPC UA client, you must set message mode to either Sign or Sign and Encrypt depending on the message mode that the OPC UA server supports. You must also specify a security policy that the OPC UA server supports. |
![]() | The client certificate file control of the Connect VI specifies the path or name of the public key. If you do not specify the client certificate file, the Connect VI generates and uses the default certificate file. |
![]() | The trusted server certificates control of the Connect VI specifies the file paths of the certificates that the OPC UA client trusts. You must manually copy the trusted server certificates from the OPC UA server machine to the OPC UA client machine, and then enter the path in trusted server certificates. |
![]() |
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. |
![]() |
Previous Using an OPC UA Server |
Next Using an OPC UA Client |
![]() |