LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to search Windows registry for a list of USB device subkeys?

I am able to access and modify registry values for some of my USB devices through LabVIEW, but only when I know the exact key name.

 

For example:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS\VID_0403+PID_6001+FTH9KY10A\0000\Device Parameters

 

This works great assuming I always use th exact same device (VID_0403+PID_6001+FTH9KY10A is specific to the device)

 

Is it possible for me to search through HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\FTDIBUS\ and load all of the subkeys into an array?

0 Kudos
Message 1 of 4
(4,573 Views)

It's not ideal, but one way I have figured out to search for attached USB devices using the FTDI driver is by looking in the following subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTDIBUS\Enum\

 

It contains a DWORD number called "Count" which tells how many devices are connected

and also contains the name of the device starting at number "0"

 Registry Editor_2014-10-17_08-48-31.png

 

If I pull the data from "0" into a string then i can retrieve the VID, PID and serial number of the device and use that to generate the subkey I need change settings settings such as 'Polling Period', 'Timeout' and 'Latency'.

Subkey:

SYSTEM\CurrentControlSet\Enum\FTDIBUS\VID_0403+PID_6001+FTH9KY10A\0000\Device Parameters\

 

0 Kudos
Message 2 of 4
(4,544 Views)

I don't know if this is faster or better, but I think one method that would work is using the command line tool Devcon

 

https://forums.ni.com/t5/LabVIEW/List-of-USB-devices-and-port-ID/td-p/1475836

 

I downloaded devcon, and ran the VI posted, and it listed all kinds of devices USB and other.  Not sure if yours would be in the list or the format.

0 Kudos
Message 3 of 4
(4,529 Views)

Thanks for pointing me to the link. The vi included on that thread works great for looking up devices. I will definitely keep that program handy for later.

However, as far as using it to get the subkey location I want, it is as cumbersome as my previous post.

I would need to scan for the device, pull the VID, PID and serial number over and concatenate them into my subkey string.

 

I really would just like to search all paths located underneath a registry path

Example: List all paths located under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\

                  From the picture below I would like to see; Control, Enum, Hardware Profiles and Services returned 

regpic.png

 

0 Kudos
Message 4 of 4
(4,519 Views)