05-21-2012 03:58 AM - edited 05-21-2012 04:07 AM
Hi Jamie,
Have you tried operating the device without using the hub just to see whether the problem still persists? If there was any chance you could leave the software running overnight with the device connected, ensuring we're not clearing errors, we should be able to conclusively understand whether this issue is purely to do with the device or not.
Reading on, after seeing that as part of your application you purposely remove power to the USB device, this definitely seems like the probable source of the issue. Whenever power is removed from a USB device connected on the hub, this is the same as disconnecting it completely. In this regard, if your application comes to a point in the software where it needs to make an interaction, it's sure to throw an error because the device isn't there. So at this point, it makes sense for the application to throw an error. Although USB is based on positioning on the bus, I'm interested in finding out whether the Base Address of the device can vary depending on whether a device is unplugged and then plugged back in; if it does, this will explain why we're receiving this error even once the device is successfully powered again.
I'll try and create a VI on my machine for one of NI's DAQ devices, and see whether I can force this error to occur by plugging/unplugging the device at different states of the application. This should show us whether the issue is ubiuitous in all USB devices, or whether we may be dealing with how Measurement Computing have implemented the driver layer.
05-21-2012 04:07 AM
Hi Alex
Once I have removed the power to my device under test, I dont actually try and interrect with it. I just wait 1 second then reconnect it.
I am just cycling the power to test if the units RTC keeps time when main power is removed.
I was thinking that as Dave mentioned plugging in another usb device to his hub could disturb the daq, the same thing could be happening when i cycle the power to the device under test.
i.e. a disturbance on the bus is causing problems with the DAQ.
BUT, my device under test is not actually plugged into the hub, it goes into the back of the pc.
Im just thinking the same thing could be happening at a lower level.
I have managed to recreate my 'digital device is not responding error' by creating a loop that toggles a digital output continually and just pulling the usb lead out of the daq while the program is running.
Thanks for all your help Alex
Jamie
05-21-2012 04:23 AM - edited 05-21-2012 04:25 AM
Hi Jamie,
I just did a quick test with another USB device, and I received the same error.
When I run the VI, every time I click the 'Do Interaction' Boolean control, my USB Device updates a digital output channel. If the interaction is a success, then the 'Device Okay?' indicator returns a true. When I unplug the device, I try another interaction and the Device Okay? returns a false. If I plug the device back into the same address, every subsequent interaction also fails. As another test, I unplug the device, then plug it back in, then perform attempt an interaction, I receive the same error. I think that subsequently this is an issue with removing power from devices while they're being interacted with; the device must become re-enumerated on the bus.
05-21-2012 04:30 AM - edited 05-21-2012 04:32 AM
The format below will allow the software to execute successfully, even after a power down procedure.
05-21-2012 05:18 AM
Hi Alex
Yes this is the same solution I came up with, it is in place and seems to be working for now.
I hope it will continue to hold up. I will not be using measurement computing hardware again.
Thanks for your help
Jamie
05-21-2012 05:29 AM - edited 05-21-2012 05:30 AM
Hi Jamie,
This solution should work fine. I want to stress that this doesn't seem to be a problem with the hardware you're using, as I was able to repeat this same kind of issue with one of our devices; the type of behaviour we're seeing is a fundamental part of the USB protocol itself. Devices becoming disconnected are re-enumerated; this causes the software-side confusion; this is expected behaviour from using the devices in a non-standard way (Power off during interaction).
However, for some of the other posters above, I'd recommend getting in touch with Measurement Computing regarding your concerns. This is because you're receiving the same errors, however you are not purposely forcing the devices to power down. To resolve this issue on the software side, I'd make sure that there aren't any power saving options that may be forcing the USB to lose power, which may be causing your USB devices to disconnect. With regards to the hardware, I'd recommend also contacting the Measurement Computing to check if this kind of behaviour is associated with a faulty device.
Kind Regards,