LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview check usb device if usb2.0 or usb3.0

Hi all

   I want to check my usb device if usb2.0 or usb3.0,I try read device manager list(by attachment files) is not ok only get device basic information as snapshot,where can check what i want information,thanks in advance!

 

20201204095214.png

0 Kudos
Message 1 of 5
(1,851 Views)

Are you familiar with the command prompt?

 

You can call a script for a command.line parameter and retrieve the information for parsing. So if you already have a command-line way to get the information, you can do that in LabVIEW by passing it to the command line, retrieving the output buffer and parsing accordingly.

0 Kudos
Message 2 of 5
(1,810 Views)

 Thank you for your reply,I don’t know what command prompt get USB device   Version 2.0 or 3.0,Do you have good way to this issue,thanks!

0 Kudos
Message 3 of 5
(1,801 Views)

Who can help me for this issue of check removable device(USB disk,USB audio adapter)usb2.0 or usb3.0 version,thanks in advance.

0 Kudos
Message 4 of 5
(1,776 Views)

Well, if I had to do it, I would most certainly call the Windows API. But that requires some serious C programming. First you have to use the Windows SetupDI API to enumerate the USB devices, find the relevant device and then open a device driver handle to it. From there you can do a DeviceIOControl() on the handle with the control code IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX_V2 IOCTL Windows 8 and higher only). But this requires you to have a C compiler, knowledge about C programming and also the Microsoft Windows SDK and DDK installed as well.

 

The other approach is to call some command line tool with the right options to retrieve extra information. devcon seems not to be able to retrieve either the advertised nor the actually used USB speed for a device. USBVIEW from the Microsoft Developer Toolkit doesn't employ above IOCTL code either, but could be modified to do so. It is in source code on the Microsoft Github page for the Device Driver Development Kit.

 

Another approach would be to try to call libusb through the Call Library Node. It specifically enumerates the capabilities of a USB device including its actual speed. 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 5
(1,770 Views)