0

I have to base a critical Windows 7 software on virtual COM Port assignment. The software has to test devices in a production line. Each device is different and needs to be supplied with individual security keys.

There are 20 serial connections from an USB-Serial bridge (Silicon Lab CP2103). Each connection on a physical USB Port gets some virtual COM Port, which I can adapt by the device manager (e.g. to COM7).

If the serial number of the bridges are all the same, I was told, that Windows remembers the chosen COM Port for each USB Port. Can I rely on that to be "stable" under restarts and other USB activities, not related to my adapters?

What would be the difference, if each adapter has individual serial number: Is it true, that in this case Windows remembers the COM assignment, but is doesn't matter which physical USB port is used for connection?

Are there any recommendations to do it in one or an another way?

MichaelW
  • 1,328
  • 1
  • 15
  • 32
  • 1
    Windows does **not** remember assigned COM port numbers, it is entirely up to the device driver to pick them. Neither the data sheet nor the AN197 application note make any promises about it, if a company representative told you this then you'll have to take his word for it. It might record the number in the registry, it isn't unusual. Surprise removal is never not a problem with these virtual port emulators, things invariably implode when the app doesn't know how to deal with them. They never do, so you'd better test that. They also provide an api for the USB interface, always best. – Hans Passant Nov 25 '17 at 14:09
  • Lets say I have 20 Adapters A1...A20 with the same serial number. Each of it is plugged into an USB Port of an USB Hub. How can my application communicate with a given adapter (e.g. A7), if I cannot safely rely on a stable port number (e.g. COM6)? What do you mean by "testing" in detail? – MichaelW Nov 26 '17 at 12:01
  • To summarize: I plug in the adapter for the first time. By some magic a COM Port is assigned. Lets say "COM99". Now, I modify this COM port to "COM6" by use of the device manager/com port settings. After a reboot the manually assigned Port can change, e.g. again to COM99, or some other port? If that is true, I can never rely on a stable assignement and COM Port numbers are completely unsuitable for the purpose of addressing an USB cable. What are the alternatives? – MichaelW Nov 26 '17 at 12:04
  • Who told you that Windows remembers or assigns COM ports if the serial numbers are all the same? I've not seen it documented that Windows can handle multiple identical serial numbers. If you want to use port numbers dependent on USB location, you should use GlobalDisableSerNumGen or IgnoreHWSerNum – david Feb 22 '18 at 10:32

0 Answers0