OPC (OLE for Process Control) Servers

Measurement Studio 2019 Help

Edition Date: May 2019

Part Number: 375857B-01

»View Product Info
Download Help (Windows Only)

You can use the NetworkVariable .NET class library to exchange live measurement data with OPC (OLE for process control) servers over the network.

Note Note   This topic applies to the following editions: Enterprise, Professional.

You can use the DataSocket .NET class library or the NetworkVariable .NET class library to exchange live measurement data with OPC (OLE for process control) servers over the network. The benefits to using NetworkVariable are that you get server-side buffering, a more elegant API, no COM interop, and higher throughput. The benefit to using DataSocket is that you can connect directly to the OPC data point without going through the Shared Variable Engine as an intermediary, including the implied manual configuration in the Distributed System Manager, or purchasing the LabVIEW DSC Run-Time System.

The following paragraphs explain how to use NetworkVariable with an OPC server using the LabVIEW DSC Run-Time System.

  1. Install LabVIEW Datalogging and Supervisory Control (DSC) Run-Time System.
  2. Install your OPC server. Only OPC2 and higher are supported by LabVIEW DSC Run-Time System.
  3. Select Start»All Programs»National Instruments»Distributed System Manager to launch the application.
  4. Right-click localhost and select Add Process to create a new process. Type Test_Process in the Add Process dialog box and click OK. Grouping variables by process allows you to organize your variables. You can start and stop processes independently, which allows you to easily manage your variables.
  5. Right-click on Test_Process and select Add I/O Server.

  6. For the I/O Server Type, select OPC Client and click Continue.
  7. Type Test_OPC in the Enter IO Server Name dialog box and click OK.
  8. Select the OPC server that you want to access through the Network Variable API from the list of Registered OPC Servers you installed in step 3 and click OK.

  9. Right-click on Test_Process and select Add Variable to launch the Shared Variable Properties dialog box.
  10. In the Shared Variable Properties dialog box, select the Enable Aliasing checkbox and click the Browse button.
  11. In the Browse for Variable dialog box, select one of the OPC items from the OPC I/O server you configured in step 6.

  12. Click OK to bind the new variable to the OPC source.

  13. Click OK to return to NI Distributed System Manager. Use the new variable as you would any other shared variable. You can access the variable you have configured through the .NET NetworkVariable class library, as you would any other network variable.

WAS THIS ARTICLE HELPFUL?

Not Helpful