Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Designing Applications Using Network Streams

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

The following sections show examples of using the Network Streams functions to stream data continuously between applications and Network Stream Endpoint properties to view information about network stream endpoints.

Streaming Data with Network Streams Functions

The following figure shows an example of using the Network Streams functions to transfer data between two applications on different computers.

The following events occur in the previous figure.

  1. The Create Network Stream Writer Endpoint function creates a writer endpoint on Computer 1, and the Create Network Stream Reader Endpoint function creates a reader endpoint on Computer 2.
    Note  You can run the Create Network Stream Writer Endpoint and Create Network Stream Reader Endpoint functions in any order. These functions will create a network stream unless the timeout in ms terminal on one function expires before the other function runs.
  2. The writer endpoint establishes a connection with the reader endpoint using the endpoint URL of the reader endpoint.
  3. The Write Single Element to Stream function continuously writes the value of the iteration (i) terminal of the While Loop to the stream.
    Note  You also can use the Write Multiple Elements to Stream function to stream more than one data point at a time. For example, use this function if you need to stream two samples of waveform data every second.
  4. The Read Single Element from Stream function continuously reads the stream.
    Note  You also can use the Read Multiple Elements from Stream function to read a stream. You can use a Read Multiple Elements from Stream function even if you used a Write Single Element to Stream function in the other application, and vice versa.
  5. Data streams continuously until the user clicks the stop button on Computer 1.
  6. The Flush Stream function transfers all remaining data to the reader endpoint.
  7. The Destroy Stream Endpoint function destroys the writer endpoint.
  8. The reader endpoint receives an error due to disconnection, and data flow exits the While Loop.
  9. The Destroy Stream Endpoint function destroys the reader endpoint, which destroys the stream.

Viewing Information about Endpoints

You can use the Network Stream Endpoint properties to view information about endpoints. Complete the following steps to use Network Stream Endpoint properties.

  1. Add the Property Node (Network Stream Endpoint) to the block diagram. 
  2. Wire an endpoint refnum wire to the reference input on the property node. Obtain this reference from the reader endpoint reference of the Create Network Stream Reader Endpoint function, the writer endpoint terminal of the Create Network Stream Writer function, or the endpoint out terminal of any of the other Network Streams functions.
  3. Right-click the Property terminal of the Network Stream Endpoint Property Node and select Select Property from the shortcut menu to select the property you want to use.
  4. (Optional) Use the Positioning tool to resize the Network Stream Endpoint Property Node to display more than one property simultaneously.

The following figure shows an example of using the Network Stream Endpoint properties.

In this example, subtracting the Available Elements for Writing property from the Buffer Size property indicates the number of elements in the buffer of the writer endpoint.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit