Measurement Studio includes user interface controls for Windows development, such as the waveform graph, knob, gauge, tank, LED, switch, and other controls. Measurement Studio 8.1 and later includes the network variable application programming interface (API). With network variables, you can perform cross-platform communication among several Windows or real-time applications. You can use the network variable class library to send data to Windows applications, as well as remotely monitor and control distributed applications.This tutorial is designed to help you learn how to modify a pre-existing Windows application to use network variables. This tutorial will take you through the following steps:
The following components are required to complete this tutorial:
The Signal Filtering application attached to this tutorial generates a noisy signal and displays it on a waveform graph. You can filter the signal by increasing the cutoff frequency; the filtered signal then displays on a waveform graph.
Add the Cutoff network variable by setting the following options in the NetworkVariableBinding Collection Editor dialog box: select ReadWrite for BindingMode, type 0 for DefaultReadValue, and type Cutoff for Name.
Note: Make sure the members of the NetworkVariableBinding Collection Editor are in the following order: 0-Originak Signal, 1-Filtered Signal, and 2-Cutoff. If the members are not in this order, use the arrow buttons in the NetworkVariableBinding Collection Editor to order them.
Add the following code to the beginning of the timer1_Tick method in Form1 to programmatically declare a NetworkVariableBufferedWriter to update the value of the OriginalSignal and the FilteredSignal network variables.
String originalSignal_location =
NetworkVariableBufferedWriter<double> originalSignalBufferedWrite = new
String filteredSignal_location =
NetworkVariableBufferedWriter<double> filteredSignalBufferedWrite = new
Dim originalSignal_location As String
originalSignal_location = NetworkVariableDataSource1.Bindings(0).Location.ToString()
Dim originalSignalBufferedWrite As NetworkVariableBufferedWriter(Of Double())
originalSignalBufferedWrite = New NetworkVariableBufferedWriter(Of Double())(originalSignal_location)
Dim filteredSignal_location As String
filteredSignal_location = NetworkVariableDataSource1.Bindings(1).Location.ToString()
Dim filteredSignalBufferedWrite As NetworkVariableBufferedWriter(Of Double())
filteredSignalBufferedWrite = New NetworkVariableBufferedWriter(Of Double())(filteredSignal_location)
Add the following code to the end of the timer1_Tick method in Form1 to programmatically bind the network variables to the data that is being displayed on the Original Signal and Filtered Signal waveform graphs.
Now that the signal filtering application binds to network variables, you can create a Web application to monitor the Windows application.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.