OPC with LabVIEW Software Options

Updated Nov 16, 2023

Reported In

Software

  • OPC Servers
  • LabVIEW OPC UA Toolkit

Issue Details

I want to use OPC communication in LabVIEW. What software do I need? 

Solution

You can use OPC in LabVIEW with LabVIEW OPC UA Toolkit, LabVIEW Datalogging and Supervisory Control (DSC) Module, or LabVIEW's native functions. The method of interacting with OPC through LabVIEW varies significantly based on whether you are using the OPC DA or OPC UA protocol and what version of LabVIEW you're using. 
 

LabVIEW Version

Communication Method

Additional Software Required

2017 and later
  • OPC UA communication 
LabVIEW OPC UA Toolkit
2013-2016
  • OPC UA communication using OPC UA API
LabVIEW DSC Module 2013-2016
8.x and later
  • Communicate with OPC Servers using Shared Variable Engine
LabVIEW DSC Module 8.x and later 
6.x-7.1
  • Communicate with OPC Server
  • The Tag Engine in LabVIEW DSC 6.x-7.1 can act as both an OPC client and as an OPC server. 
LabVIEW DSC Module 6.x-7.1
5.1 and later
  • Communicate with OPC Servers as DataSocket Client 
Native LabVIEW functionality
5.0
  • Communicate with OPC Servers via ActiveX Automation interface
Native LabVIEW functionality

Additional Information

Communicate to OPC UA Server with LabVIEW DSC 2013 - 2016 or LabVIEW 2017 OPC UA Toolkit using the OPC UA API 

From LabVIEW 2013 to 2016, the LabVIEW DSC module contains an API for programmatically communicating with and exchanging data between OPC UA servers and clients. Starting with LabVIEW 2017, OPC UA Toolkit was released separately from the LabVIEW DSC Module and became a stand-alone LabVIEW toolkit. See Using OPC UA Servers and Clients (DSC Module or Real-Time Module)  for more information on this process.

 
Communicate to OPC Server with LabVIEW DSC 8.0 and later using Shared Variables

Starting with LabVIEW 8.0, the LabVIEW DSC module extends the functionality of the Shared Variable Engine (SVE) to allow LabVIEW to serve as an OPC DA client. OPC Server Functionality is provided by the separate NI OPC Servers software. See Connect LabVIEW to Any PLC Using OPC for more information on this process.

 
Communicate to OPC Server with LabVIEW DSC 7.1 and previous using the Tag Engine

The LabVIEW DSC Engine (Tag Engine) takes care of OPC for you. Because LabVIEW Datalogging and Supervisory Control is an OPC Client, it is much more efficient at OPC operations. If you are going to have more than 30 I/O points, you will sacrifice efficiency using data sockets. At 30 I/O points, you should consider using LabVIEW DSC and the Tag Engine.
 
Because LabVIEW DSC is an OPC server, an OPC client can launch the Tag Engine. When an OPC client launches the Tag Engine, the Tag Engine loads the current .scf file. The Tag Engine can then load any servers that the tags in that .scf file require. However, an OPC client cannot specify which .scf file the Tag Engine should use. The Tag Engine will only use the current .scf file, so you must make sure the correct .scf file is set as the default if you want this type of access.
 
When you access data from the Tag Engine acting as an OPC server, the client software, such as Lookout or some other OPC client software, sees the Tag Engine as an OPC server named National Instruments.OPCLabVIEW, while the tag names you set in the .scf file appear as the OPC item names.

 
Communicate to OPC Servers through DataSocket

The DataSocket protocol has an OPC layer, which allows you to read and write to an OPC server using DataSocket. Starting with LabVIEW 5.1, any version of LabVIEW can connect to an OPC Server as a DataSocket Client.
 
LabVIEW ships with an example that demonstrates the above process. To access the example in LabVIEW, go to Help » Find Examples to open the LabVIEW Example Finder. Once the Example Finder opens, click Browse and then navigate to Networking » DataSocket » OLE for Process Control (OPC) and you will see the example (Monitor OPC Items with DataSocket.vi). 

Note: DataSockets cannot communicate with OPC Server 3.x