Provide a wealth of information about the USB device but the one of interest right now is the Hardware Ids. This will bring up a window with four tabs. This time select the COM port identified in step #1 above and either double-click on it or right-click and select Properties. Under this will be several folders that look like subdirectories but are called "hives". This is the starting point for your search. The ones you will be interested in will be found in \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum. Search for this (ie: COM23) using the Edit->Find function in regedit.exe. You know the COM port number currently assigned. If the device doesn't respond or responds with the wrong value then I know it's not the one I'm looking for.Ĥ) If you do not have control over the target device where you can imbed a unique ID value, all is not lost. Thus, I open each of the COM ports in turn and request the device to return the ID value.
#VB6 GET SERIAL NUMBER CODE#
Fortunately, in my case, I am writing the code for each of the boards so I can imbed a unique ID value IDs for the five boards but which is which? (Okay, I can guess that VCP0 is the one that uses the FTDI chip, but as for the other four I have no clue). In my Tcl program I can read the registry and, using the device types listed above I can narrow down the list of all the devices listed by using a regular expression on the device name. In my case, the five devices I'm looking for (determined from step 1) are:ģ) Here's where things get a bit tricky. On the left-hand side is the device name assigned to theĬOM port. On the right-hand side there should be a list of COM ports that matches the list seen in Device Manager. If there is any question about which one the target board is, simply unplug the device and see which entry disappears and then reappears when it is plugged back in.Ģ) Open regedit.exe and go to the location HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM. Of UART based COM ports as well as virtual COM ports. This will provide a list of all serial ports currently active on the system. This is done by opening up Device Manager and expanding the list of Ports (COM & LPT). The approach uses the following steps:ġ) First, determine the current COM port assignment for the target board. Language which supports this and I assume that most other languages do as well. The solution requires the ability to read the registry.
The last board I added uses a microcontroller that has no built-in controller and instead uses an external FTDI chip that provides a UART to USB interface. Most of the USB serial links I use are implemented on a board with a microcontroller that has a built-in USBĬontroller. I actually found two solutions but the first one I found did not work well when I added two more boards, one of which had a different device type. I'm posting the results here in case someone else has a similar problem.
#VB6 GET SERIAL NUMBER PLUS#
It's taken several days and a lot of poking around in the registry plus a bunch of experiments and web searching but I think I finally have a solution that works for me.