Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to restart a USB connection without unplugging USB?

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 6
(5,389 Views)

I have seen people splice 5V line of USB cable through a USB-controlled relay and control the relay to disconnect/connect the USB device.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 6
(5,366 Views)

Hi, I'm new to the forum. I have changed the Tektronix IP address to 192.168.1.2. I can't detect the oscilloscope to the NI MAX (version 20.0.0f0). Hope you can help.

The connection is here below. 


Windows 7 Tektronix oscilloscope>LAN cable>USB 3.0 Ethernet adapter (RJ45 to USB adapter)> Windows 10 PC

 

 

0 Kudos
Message 4 of 6
(4,786 Views)

You might be able to use the Windows Management Instrumentation (WMI) infrastructure or PnPUtil to do what you want.

 

pnputil /restart-device "USB\VID_045E&PID_00DB\6&870CE29&0&1"      

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

 

You can interface with the WMI using .NET calls in LabVIEW.

 

Here is an example of how to get the device information via the WMI. 

https://forums.ni.com/t5/LabVIEW/USB-Serial-Device-Friendly-Name-and-Model/m-p/4192548#M1213063

 

The WMI provides methods you can use to control the device as well.  You can download a tool called WMI Explorer to view details of the interface (see Microsoft's website to download the WMI Explorer).

LotsaMotsa_0-1637249905221.png

As shown above there are Enable/Disable and Reset methods available.

 

Be sure to read Microsoft's documentation for details

https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-pnpentity

LotsaMotsa_0-1637251082919.png

LotsaMotsa_0-1637251335369.png

LotsaMotsa_0-1637251478817.png

 

https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/cim-logicaldevice

 

Here is information on the PnPUtil which might work better

LotsaMotsa_0-1637252105511.png

 

https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/pnputil-examples

 

 

Note: NI-VISA seems to only work well and be robust for USB Test & Measurement class devices and products manufactured by National Instruments.

 

 

0 Kudos
Message 5 of 6
(4,778 Views)

Note: Microsoft suggests using PnPUtil.  See my post above.

 

LotsaMotsa_0-1637252912430.png

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

 

0 Kudos
Message 6 of 6
(4,754 Views)