Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6009 How can I do a Remote Reset from Software

As seems to be the case with some USB devices, when they need to be reset you have to disconnect the USB cable from the device and plug it back it. This occurs intermittently with a couple of applications using NI-DAQmx 8.0.1 and VB6. I don't want to have the operator shutdown the app., disconnect, reconnect the cable and reload the app. If there was a way I could query the device (except when it's incommunicado of course) and determine an unstable state, or even if I could force a hardware reset from my app., I could routinely do a reset.
 
During program development if I terminate my app. without stopping the tasks, exiting to Windows and reloading the app. is usually enough to clean up the OS environment, but when the environment seems okay, and the 6009's LED stops flashing and returns error msgs, I'd like to be proactive. The crudest work-around would be add a relay to interrupt +5V to the module and reinitialize the 6009 after power cycling. Still, it seems like a remote reset would be best and a way to query to see if the device is still communicating, else programmatically issue the reset.
 
Thanks in advance for any suggestions.
 
Bill
0 Kudos
Message 1 of 4
(3,704 Views)
Bill,

You can reset it in software.  Open Measurement and Automation Explorer and find the device listed under My System >> Devices and Interfaces >> NI-DAQmx Devices.  Right click on the device and look for 'Reset Device.'  Selecting this option should effectively reset the device.  Just try to make sure that the task is stopped and cleared before the program ends and you should be able to avoid this problem.


Elijah Kerry
NI Director, Software Community
0 Kudos
Message 2 of 4
(3,691 Views)

Elijah,

Thanks for the reminder of this feature, but the problem is that I cannot access that menu conveniently from my 3rd party application. Since it can be done from the menu, what is the function from NI-DAQmx that I can call to accomplish the same objective? Also, is there a query I can do to check on the status of the module? Is there any user set options that I would clear by doing the reset?

Thanks very much,

Biill

0 Kudos
Message 3 of 4
(3,672 Views)
Bill,

Use the DAQmxResetDevice function to reset it from your code.  All parameters of any generation or acquisition would be stored in a task, so they will be the same after the reset.  You will need to restart the task after resetting, but your configuration should remain the same when you relaunch the task.

The status of the device is returned as an integer code by any function call.  You can monitor this value to see if anything in your code is behaving incorrectly
Elijah Kerry
NI Director, Software Community
Message 4 of 4
(3,654 Views)