Streaming Data and Sending Commands between Applications

Streaming data and sending commands are models of communication for sending data between two LabWindows/CVI applications. Use network streams to accomplish these tasks. A network stream is a lossless, unidirectional, one-to-one communication channel that consists of a writer and a reader endpoint. Use the Network Streams Library functions and the network stream endpoint attributes to design applications using network streams.

The following figures illustrate some of the ways you can configure network streams to transfer data.

In the following figure, a network stream transfers data between two applications on the same computer.

In the following figure, a network stream transfers data between two applications on different computers.

In the following figure, a network stream transfers data between an application and a web service.

In the following figure, a network stream transfers data from an application on one computer to two applications on another computer.

In the following figure, a network stream transfers data from an application on one computer to two applications on different computers.

Network Streams Engine

Each endpoint uses a FIFO buffer to transfer data. The Network Streams Engine (NSE) transfers data from the FIFO buffer on the writer endpoint to the FIFO buffer on the reader endpoint.

The following figure illustrates the flow of data in a network stream.

In the previous figure, data flows in the following order.

  1. The writer endpoint writes data to a FIFO buffer.
  2. The NSE transfers data to a FIFO buffer on the reader endpoint.
  3. The reader endpoint reads the data from the FIFO buffer.

Determining When to Use Network Streams Instead of Network Variables

Use network variables to publish the latest value in a data set to one or more subscribers. Use network streams to send every point of data from one writer to one reader.

For example, assume that you are using an accelerometer to detect the vibrations of a pump that is repressuring natural gas in a pipeline. You are processing the vibration data on a CompactRIO target to ensure that the pump does not fail. However, the CompactRIO target does not have enough memory to analyze the data. Therefore, you must send the data to a desktop computer that has enough memory to store, analyze, and display that data.

Because network variables are optimized for publishing the latest value of data only, they could miss a critical data point. However, network streams would stream every point of data to the desktop computer so you could monitor the condition of the engine.

Note  Network streams can induce jitter in real-time (RT), time-critical loops. Therefore, if you want to stream data from a time-critical loop with network streams, National Instruments recommends that you first share the data with a lower-priority loop. Then, use network streams to stream the data to another application.

WAS THIS ARTICLE HELPFUL?

Not Helpful