Measurement Studio 2019 Help
»View Product Info
You can use the NetworkVariable .NET class library to exchange live measurement data with OPC (OLE for process control) servers
over the network.
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.
Install LabVIEW Datalogging and Supervisory Control (DSC) Run-Time System.
Install your OPC server. Only OPC2 and higher are supported by LabVIEW DSC Run-Time System.
to launch the application.
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.
Test_Process and select
Add I/O Server.
For the I/O Server Type, select
OPC Client and click
Test_OPC in the Enter IO Server Name dialog box and click
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
Test_Process and select
Add Variable to launch the Shared Variable Properties dialog box.
In the Shared Variable Properties dialog box, select the
Enable Aliasing checkbox and click the
In the Browse for Variable dialog box, select one of the OPC items from the OPC I/O server you configured in step 6.
OK to bind the new variable to the OPC source.
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.