Example Code

Reconnecting Network Streams using a State Machine using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.


  • LabVIEW

Code and Documents


This example demonstrates how to reconnect Network Streams using a simple State Machine Architecture.


Here is a brief description of the example:

This example was created based on the Simple Network Streams found in the NI Example Finder.  We utilized a state machine on the Reconnect Network Streams - Target program.  This allows the program to properly close the Network Stream when it gets disconnected from the host (stopping the host VI).  Then the program moves into waiting for reestablishing a connection with the host.


  1. LabVIEW 2014 (or compatible)

Steps to Implement or Execute Code

  1. Run Reconnect Network Streams- Target.vi
  2. Run Reconnect Network Stream- Host
  3. Click Stop on the Reconnect Network Stream- Host
  4. If the Reconnect Network Streams - Target.vi is running you should then be able to run this VI again and communicate over Network Streams.


Additional Information or References
VI Snippet

The Host VI:

Reconnect Network Streams - Host 2014 NIVerified.png

The Target VI:

 Reconnect Network Streams - Target 2014 NIVerified.png


 **This document has been updated to meet the current required format for the NI Code Exchange.**


M. Whitaker

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.


Just what I am looking for!

Unfortunately I am not able to run it because I use LabVIEW 2013 (the project was saved in LV2014).

Could you please make it available for LabVIEW 2013?