Programmatically Find NI Devices Using LabVIEW

Updated Aug 3, 2021

Environment

Software

  • LabVIEW

Driver

  • System Configuration

When multiple systems it is sometimes useful to programmatically find and search for all the NI devices connected to the system. One method of doing this is to use System Configuration and LabVIEW.
 
This guide will walk through the process of programmatically finding and searching by name for all the NI devices with a step by step process and snippets to give a quick start to the application. Please note that expected results for both methods are shown at the bottom of the page.

To detect all NI devices connected to the system programmatically through LabVIEW:

1. Install NI System Configuration to gain access to the NI System Configuration APIs and VIs in LabVIEW. This can be downloaded from the System Configuration Download Page.
2. Either:
  • Recreate the block diagram shown below, or use the LabVIEW snippet below.

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram. 

3. Use the System Hardware Property Node to select any additional information you would like to be displayed about the connected devices.
 

To search for connected NI devices by name programmatically in LabVIEW:

1. Follow the steps above for programmatically detecting all connected NI devices.
2. Either:
  • Modify the code as shown below, or use the LabVIEW snippet below.


Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram. 
 

3. Use the System Hardware Property Node to select any additional information you would like to be displayed about the connected devices.
4. Use the Search Devices String Control on the front panel to enter the device name you want to search for i.e cRIO. Note: this search is case sensitive.

 

Detect all NI devices connected to the system programmatically through LabVIEW - Result:
Run the VI. Any connected NI devices will be displayed along with the corresponding information that was selected in step 3


Search for connected NI devices by name programmatically in LabVIEW - Result:
Run the VI. All connected devices beginning with the name you have entered will be displayed.