You can try enabling notification of events using viEnableEvent and viEventHandler. Take a look at the CVI Help under the NI-VISA Library. There are some good references in there for Event handling, function references, and it talks about a USB Interrupt that you can use. My first instinct would be to try that method. If this doesn't work, then you can use Windows SDK calls to register device notification and install a callback to CVI. Inside the callback, you could then look for the event that fired the callback, (i.e. a disconnect message) and then handle the problem accordingly. I would look into the
device management reference on msdn to learn
about finding when a device change occurs. Hope this helps!
Jeremy L.
National Instruments
Jeremy L.
National Instruments