Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Unused Devices from LabVIEW

Solved!
Go to solution

Hello,

 

I have an application that I am developing and we have run into an interesting problem.

 

We are using a USB DAQ device.  If we have 2 USB daq devices, unplug 1 and plug in the new one the new USB device gets installed and identified as "Dev2"  This is the default response of the DAQmx driver.  However this creates a problem for our application because our address reference "Dev1" the now disconnected DAQ device.

 

So how do make sure that make sure when a device gets disconnected it gets deleted from the Driver?  Is there a way when I bring up my application in LabVIEW I can delete unconnected devices and rename the connected device to "Dev1"

 

Any help would be appreciated.

 

Thanks

 

Dan

Dan Shangraw, P.E.


   

0 Kudos
Message 1 of 3
(4,371 Views)
Solution
Accepted by topic author ASTDan

Hi Dan,

 

At this time, there isn't a programmatic way to delete individual DAQmx devices, but you can use the NI System Configuration API to import a MAX configuration in "replace" mode in order to delete all of the disconnected DAQmx devices (and it renames your connected devices, too). There's an example of how to do this in <LabVIEW Directory>\examples\nisyscfg\Import MAX Configuration.vi.

 

You can rename individual devices using the NI System Configuration API. An example of this is in <LabVIEW Directory>\examples\nisyscfg\Rename Aliases.vi.

 

There is a somewhat related idea on the DAQ Idea Exchange: DAQ device available by type instead of device number

 

Brad

---
Brad Keryan
NI R&D
Message 2 of 3
(4,349 Views)

Dan,

 

That is a good question. Instead of making sure that each device that gets plugged in gets named Dev1, it is a more robust solution to use the steps outlined in this KnowledgeBase. Programmatically Finding Device Name of DAQ Device in System.

 

Regards,

 

Elizabeth K. 

National Instruments | Applications Engineer | www.ni.com/support 

0 Kudos
Message 3 of 3
(4,344 Views)