LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List of USB devices and port ID

I need to test whether some USB extension ports are wired correctly. What I'm thinking is to use some small USB devices such as flash drives connected to these extension ports and run the program to list the devices. Because the test is going to be handled by other people, I want to have proof that correct ports are used.

 

I'm open to suggestions regarding how this test can be done, or detailed to how I can display the devices and their ports.

 

I did some search and find this site, the solution it provides will list audio devices, but it couldn't give a port ID.

 

Guangdew

0 Kudos
Message 1 of 6
(14,460 Views)

Hey-

 

I found a good link that might help point you in the right direction.

 

http://zone.ni.com/devzone/cda/tut/p/id/4478

 

Hope this helps!

 

Thanks,

 

Sean

Applications Engineering Specialist - Semiconductor Test
National Instruments
0 Kudos
Message 2 of 6
(14,414 Views)

Hi Sean,

 

I studied this article before for some other project. I revisited and want to see whether it will show me the port information. But then I realized that it's port dependent. If I plug an audio device to a specific port, Windows can recognize it as a usb device, but not a HID device, MAX can recognize it as usb device. For other ports, Windows can recognize it as both HID and usb device but MAX can not recognize it at all. This device is the one I tried with this article. Because it shows only on one port, I don't know whether it has port information in it, and also I don't know how I can read it out with my LabVIEW program. Please advise.

 

Thank you for your help.

0 Kudos
Message 3 of 6
(14,402 Views)

I have used MS DevCon to find ports and devices on a Windows based PC.

I find USB comports

Network Interfaces installed.

Comport and LPT port addresses

PCI bus devices etc.

 

Check if this will provide the port info you need and if so I have a number of VI to parse out the info from DevCon.

Omar
0 Kudos
Message 4 of 6
(14,394 Views)

Thank you for your suggestion. I tried the DevCon before. If I run the DevCon itself, it will only give me a flash of cmd screen. If I use use System Exec.vi to call it, it will not give me any meaningful list on the output sind.I don't know whether my computer has problem or not.

0 Kudos
Message 5 of 6
(14,376 Views)

The flash means there was likely an error. Like it could not find devcon.exe or you did not use the correct form of the command.

First do you have a copy of devcon.exe where your program can find it (in system32)?

 

Have you tried opening a Command Prompt window first and manually typing devcon and seeing what if any errors are reported.

 

This is the help from devcon

 

devcon [-m:\\<machine>] find <id> [<id>...]
devcon [-m:\\<machine>] find =<class> [<id>...]
Find devices that match the specific hardware or instance ID.
This command will work for a remote machine.
Examples of <id> are:
*                  - All devices
ISAPNP\PNP0501     - Hardware ID
*PNP*              - Hardware ID with wildcards (* matches anything)
@ISAPNP\*\*        - Instance ID with wildcards (@ prefixes instance ID)
<class> is a setup class name as obtained from the classes command.
Devices are listed as <instance>: <descr>
where <instance> is the unique instance of the device and <descr> is the descrip
tion.

 

 

Omar
0 Kudos
Message 6 of 6
(14,363 Views)