LabVIEW Communicates with Wonderware InTouch Across Network

Updated Mar 19, 2019

Reported In

Software

  • LabVIEW OPC UA Toolkit
  • OPC Servers
  • LabVIEW Datalogging and Supervisory Control Module

Operating System

  • Windows

Programming Language

  • LabVIEW G

Issue Details

I use Wonderware InTouch to read sensor data from PLCs. I have an existing connection setup as follow:

Wonderware > Microsoft SQL database on external server > LabVIEW via Database Toolkit

However, I am looking into using OPC to make a direct connection between Wonderware InTouch and LabVIEW. My Wonderware InTouch system comes with an OPC Server, FSGateway. How can I set up a remote connection in LabVIEW to the Wonderware OPC Server, FSGateway?
 

Solution

For Classic OPC remote connection:
Use OPC Client I/O Server (DSC Module) to access remote OPC tag. See Create Shared Variables that Connect to the OPC Tags through the I/O Server in Connect LabVIEW to Any PLC Using OPC . However, DCOM setting is required before using this I/O Server. 
 
For OPC UA remote connection:
At server computer, use NI OPC Server to act as OPC DA Client to access data from FSGateway. Whereas at client computer, use OPC UA API to act as OPC UA Client to access data from remote NI OPC Server (server computer).
  1. In server computer, open NI OPC Server and create new communication channel by clicking New Channel icon and key in appropriate name for it.
  2. Select OPC DA Client from the Device driver drop down menu.
  3. Configure appropriate write optimization setting.
  4. Click Select server and navigate to FSGateway.
  5. Configure appropriate connection setting.
  6. Add device to the new created channel and key in appropriate name for it.
  7. Configure appropriate settings and choose desired tags that you would like to access.
  8. Open OPC UA Configuration Manager to obtain server endpoint URL, set desired security policies and export server certificate. 
  9. Reinitialize NI OPC Server. You can do this by right clicking the NI OPC Server icon at taskbar and select Reinitialize. If it doesn't exist, you can open OPC Server Administration, NI OPC Server icon will be displayed at taskbar. 
  10. Transfer the server certificate from server computer to client computer. Double click the certificate and install the certificate. Usually the certificate will be installed in Trusted Root Certification Authorities.
  11. In client computer, program your LabVIEW application using OPC UA API and establish connection by using server endpoint URL, security policies and server certificate that you obtain in step 8. 
  12. At first run, you may receive an error, because OPC server doesn't trust the OPC client. However, after the first run, certificate is generated by Create Certificate.vi and is located at C:\ProgramData\National Instruments\certstore\opcua.
  13. Transfer the client certificate from client computer to server computer. Double click the certificate and install the certificate.
  14. In server computer, open OPC UA Configuration Manager and import the client certificate. 
  15. Repeat step 9.
  16. In client computer, run the LabVIEW program again. 

Additional Information

The remote communication via OPC UA interface might not be able to establish although you follow the step above. Please refer page 16 of OPC UA Configuration Manager - Kepware for the detail. At server computer, please kindly add an exception (TCP port). 

WAS THIS ARTICLE HELPFUL?

Not Helpful