Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Dropping a CNetPort

Hi all,

I am encountering an interesting issue. I am running on MacOS X (tiger). The device I am using is USB-6501. I create a task and start the task (for the first time) without the device plugged in, which of course generates and error; then I stop and clear the task. The problem is that if I try and resart the task after plugging in the device without restarting the application, it still generates the same error.

Interestingly, this only occurs if the first task generates the error. Thus the two sequences are:

First sequence:

1)Start app. with device unplugged.
2)Create and start task. (fails)
3)Stop and clear task.
4)Plugin device.
5)Create and start task. (fails ... same error)

Second sequence:

1)Start app. with device plugged in.
2)Create and start task. (successful)
3)Stop and clear task.
4)Unplug device.
5)Create and start task. (fails)
6)Stop and clear task.
7)Plugin device.
8)Create and start task. (successful)

So it is only during an initial faliure that a problem occurs. Restarting the application kills the CNetPort. I was wondering if there was a way that I could either completely reset the resources for the port (or just kill it) without restarting the application. It seems that stopping and clearing the task does not seem to do it for an initial failure as the above indicates.

Note: I am using the DAQmxBase C api.

Any suggestions would be most welcome!

Thanks,

Robert.
0 Kudos
Message 1 of 2
(2,755 Views)

Hello Robert,

It turns out that the behavior you are seeing is documented in the NI-DAQmx Base readme:

Hotplug USB Support

If a USB device is added or removed, you must update the device list either by selecting Refresh Device in the NI-DAQmx Base Configuration Utility or by launching (or re-launching) LabVIEW prior to using the device. Note that updating the device list might change the device order (such as, "Dev1" becomes "Dev2").

I have not found any way to programmatically refresh the device list or otherwise clear this error. 

Sorry that I do not have a solution, but I hope this at least explains the issue.

Thanks,

Laura

0 Kudos
Message 2 of 2
(2,730 Views)