06-29-2021 03:13 PM
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.
06-29-2021 05:22 PM
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.
06-29-2021 07:23 PM
11-18-2021 03:05 AM
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
11-18-2021 09:41 AM - edited 11-18-2021 10:21 AM
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).
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
https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/cim-logicaldevice
Here is information on the PnPUtil which might work better
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.
11-18-2021 10:28 AM - edited 11-18-2021 10:29 AM
Note: Microsoft suggests using PnPUtil. See my post above.
https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon