How to Programmatically Find NI Devices Using LabVIEW

Updated Jan 2, 2020

Reported In

Software

  • LabVIEW

Issue Details

How do I programmatically find all my NI devices connected to a system using LabVIEW?
Can I programmatically search for all connected NI devices by name in LabVIEW?

Solution

To detect all NI devices connected to 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...
  • If you are using Internet Explorer, drag and drop the snippet of code below directly into a LabVIEW 2019 block diagram.
  • If you are using Chrome or Firefox, first drag and drop the snippet of code onto your desktop or a folder on your computer, then drag and drop the file into a LabVIEW 2019 block diagram from there.
 

 
3. Use the System Hardware Property Node to select any additional information you would like to be displayed about the connected devices.
4. Run the VI. Any connected NI devices will be displayed along with the corresponding information that was selected in step 3.
 

 

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

1. Follow the steps above for programatically detecting all connected NI devices.
2. Either:
  • Modify the code as shown below, or...
  • If you are using Internet Explorer, drag and drop the snippet of code below directly into a LabVIEW 2019 block diagram.
  • If you are using Chrome or Firefox, first drag and drop the snippet of code onto your desktop or a folder on your computer, then drag and drop the file into a LabVIEW 2019 block diagram from there.
 
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.
5. Run the VI. All connected devices beginning with the name you have entered will be displayed. 


 
Note: The drag and drop method will only work with LabVIEW 2019 and LabVIEW 2019 SP1, for earlier versions you will need to recreate the snippets of code yourself.