02-24-2011 12:59 PM
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
Solved! Go to Solution.
02-25-2011 02:19 PM - edited 02-25-2011 02:20 PM
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
02-25-2011 02:49 PM
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