Example Code

Check Real-Time Controller Connection Status Programmatically

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.

    Hardware

  • CompactRIO|SingleBoardRIO

    Software

  • LabVIEW Real-Time Module
  • LabVIEW

Code and Documents

Attachment

Overview

This code demonstrates how to programmatically check if a Real-Time system is connected to the network or not. 

 

Description

Use the RT Get Target Information VI from the NI_Real-Time Libraries.lvlib to test the connection to a Real-Time system. The VI will return error 56 if the connection times out because the target it is not available within the network. You can check for this error code to determine whether the controller is connected or not. You should clear the error if you want your code to keep running.

Please keep in mind, that the VI used in this example is deprecated since LabVIEW Real-Time 2012. Use the System Configuration API instead.

 

Requirements

 Software

  • LabVIEW Base Development System 2012 (or compatible)
  • LabVIEW Real-Time Module 2012 (or compatible)

 Hardware

  • NI Real-Time target like cRIO, sbRIO, myRIO, PXI RT

 

 Steps to Implement or Execute Code

  1. Open the attached VI
  2. Enter the IP adress or DNS name of the target which you want to check
  3. Run the VI

 

Additional Information or References

undefined

 

undefined

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Tanya Visser
National Instruments
LabVIEW Group Manager

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