Communicating LabVIEW OPC UA Client and Server Through Tunneling Application

Updated Jul 19, 2023

Environment

Software

  • LabVIEW OPC UA Toolkit
  • LabVIEW

Other

  • PuTTY

Some third-party OPC UA servers use tunneling applications that are used to communicate data across firewalls. In these cases, LabVIEW may not be able to communicate directly with the server and may need to communicate with the tunneling client application instead. This tutorial explains the steps required to set up this communication using the LabVIEW OPC UA toolkit to create the server (PC A), the client (PC B), and PuTTY (PC B) to build the tunneling channel. 
 

Before following the steps below, make sure you have installed LabVIEW , LabVIEW OPC UA Toolkit and PuTTY (it will be used as the tunneling application).
  • Run the LabVIEW OPC UA server* in PC A and get the OPC UA URL endpoint. The endpoint URL is in the format opc.tcp://<PC_A_IP-Address>:<port A> where <PC_A_IP-Address> is the IP address of the computer where the OPC UA server is hosted and <port A> is the port of the OPC UA server.
  • In PC B, open PuTTY and create an SSH session with PC A.
Screenshot_1.png
The PC_A_User is the user required to access PC A.
  • Configure a tunnel using the Tunnel tab inside the SSH section. Click Add after configuring the Source port and the Destination.
Screenshot_2.png
The Source port (Port B) is the port that will be used to communicate with PC A from PC B.
  • Run the LabVIEW OPC UA client in PC B with the following endpoint URL: opc.tcp://localhost:<port B>
*Note: LabVIEW OPC UA server represents a third-party server in this tutorial.

A successful connection will be established between the client and the server.

To demonstrate the functionality of the steps above, the OPC UA Demo.lvproj LabVIEW example is considered and the following variables will be used:
  • PC_A_IP-Address: 10.0.18.125
  • PC_A_User: lvadmin
  • Port A: 49580
  • Port B: 8012
Now, follow these steps to complete the test.
  1. In PC A, run the Data Access Server.vi that belongs to the OPC UA Demo.lvproj LabVIEW example.
  2. In PC B, configure the SSH session as follows.
Screenshot_3.png
  1. In PC B, run the Data Access Client.vi that belongs to the OPC UA Demo.lvproj LabVIEW example.
  2. A successful connection will be established between the client and the server.
Screenshot_4.png