09-26-2010 10:41 PM
Colleagues,
What would be the best way to monitor that a USB DAQ device (e.g. USB-6008) have been disconnected (unplugged)? Does unplugging the DAQ device trigger any more a less specific events? If USB DAQ is accidentally unplugged, I would like to disable parts of the user interface.
As always, any suggestions references and insight is appreciated!
Cheers,
- Nick
09-28-2010 03:49 PM
Howdy Nick!
The DAQmx driver should throw an error if the devive is removed during operation.
If you try to start a DAQmx Task and the device is not present in the system then you will receive error -201003.
If you are running a DAQmx Task and then remove the device from the system you will receive error -50405.
Regards,
09-28-2010 07:03 PM
Thanks! I see, so it looks like there's no way of knowing outside of the context of a DAQmx.Task whenther a particular device is unplugged. To see a device is unplugged, I need to call Start() on some task that uses this device and trap an exception that can potentially occur. If I need to monitor the presence of the device while s/w is idle, I can do one of 2 things:
09-29-2010 11:46 AM
You can also query the DAQmx System property for currently present devices. You can programmatically scan the list of detected devices to make sure your device is present. This does not require a task.
10-04-2010 05:26 PM
It would be neat if DaqSystem.Local or some other object firedan event when a new device is connected or disconnected. Then there would be no need for polling. Wishful thinking. 🙂
On the other hand, I could write my own class that would have a timer, poll for new or suddenly missing devices and then fire its own event.
- Nick
10-05-2010 09:35 AM
I would recommend adding your feedback to the Add LabVIEW events based on hardware post on the DAQ Idea Exchange. This will allow our R&D teams to view what customers would like to use these features for when researching if and how to implement them.