LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset a USB connection via labview?

Posted in LabVIEW and Instrument Control forums.

 

I working with a device in which I sometimes have to reset the USB connection in order for a command to work. This entails unplugging and plugging the USB back into my computer. Is there a way to do this via LabVIEW without physically unplugging and plugging it back in? Or is there a way to use a power supply and a spliced USB cable to take away power and resupply it back to the USB?

Thanks.

0 Kudos
Message 1 of 3
(1,202 Views)

Hi!

 

DEVCON is a command line too for windows, which allows to restart a device, including USB:

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon-restart

 

However, I ended up with a USB extension cord where a relay was spliced into the +5V line, because devcon did not work well for me. (and since the setip already had digital I/Os, it was no big deal.)

 

First, I think it needs administrative privileges.

 

Second, my device is a bluetooth dongle, which should be passed through to a virtual machine. For some reason Windows claims the device in a way which makes it impossible for the VM to grab it. The only solution is to plug it in while the VM is running, which means the VM can gab it before windows is fully aware of it. May be, this somehow also contributes to the problem that devon doesn't work reliable.

(I have no idea what's going on unter the hood here, it's just experience.)

 

0 Kudos
Message 2 of 3
(1,157 Views)

Does the device in question act as a Virtual COM-Port? I was working with some VCOM-USB-Devices that would just not play nicely under Windows. Bridging the Communication over TCP/IP using a Linux device was the most stable solution and did not require custom cabling.

0 Kudos
Message 3 of 3
(1,142 Views)