Windows 如何将虚拟 COM 端口映射到设备 [英] How does windows map the virtual com port to a device

查看:173
本文介绍了Windows 如何将虚拟 COM 端口映射到设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行了一个测试来验证,当我插入一个 USB->串行转换器时,Windows(7 和 8)能够记住每个 USB 端口的配置的 com 端口号.

I have run a test to verify, that windows (7 and 8) is capable of remembering the configured com port number for each usb port when i insert an usb->serial converter.

我的测试很简单:

  1. 我有 2 个来自同一制造商的类似 USB 转串口转换器和来自不同制造商的 1 个转换器.
  2. 我将1号转换器插入USB 1号端口并在设备管理器中将其配置为COM9.
  3. 我将其拔出并将转换器 1 插入 USB 端口 2 并在设备管理器中将其配置为 COM10.
  4. 当在 USB 1 和 2 之间移动 1 号转换器 时,我确认已记住配置的 COM 端口设置.
  5. 使用转换器 2(来自同一制造商)我验证了与转换器 1 相同的结果.
  6. 使用不同的转换器(来自不同的制造商),我确认它被分配到不同的 COM 端口(在我的情况下为 COM4).
  1. I have 2 similar USB to Serial converters from the same manufacturer and 1 converter from a different manufacturer.
  2. I insert converter no 1 into USB port no 1 and configure it as COM9 in device manager.
  3. I pull it out and insert the converter no 1 into USB port no 2 and configure it as COM10 in device manager.
  4. When moving converter no 1 between USB 1 and 2 i verify that the configured COM port settings are remembered.
  5. Using converter no 2 (From same manufacturer) i verify the same result as with converter no 1.
  6. Using a different converter (from a different manufacturer) i verify that it is assigned to a different COM port (in my case COM4).

结论:Windows 似乎能够识别插入的转换器设备,并使用之前的设置配置 COM 端口.

Conclusion: It seems like windows is capable of identifying the inserted converter device, and configure the COM port with its previous setting.

问题:Windows 如何识别插入的设备?.我会根据供应商和/或产品 ID 进行假设,但我不确定.

Question: How does windows identify the inserted device?. I would assume by Vendor and/or Product ID, but I am not sure.

推荐答案

Windows 通过供应商 ID (vID)、产品 ID (pID) 和序列号识别 USB 设备.

Windows identifies USB devices by Vendor ID (vID), Product ID (pID), and Serial Number.

默认情况下,无论您如何插入,您的计算机都会为该设备提供相同的串行端口 COM 编号.

By default, your computer will give that device the same Serial Port COM number no matter how you plug it in.

某些串行端口转换器设备配置为没有序列号,或具有相同的序列号,特别是为了使它们看起来都相同,并且被赋予相同的端口号.

Some serial-port-converter devices are configured without serial numbers, or with identical serial numbers, specifically so that they all look identical, and are identically given the same port number.

如果设备具有相同的序列号,如果一个设备"同时插入两个 USB 端口,Windows 可能会混淆.

If the devices have identical serial numbers, Windows may become confused if "one device" is plugged into two USB ports at the same time.

如果设备没有序列号,Windows 会根据你连接它的位置补一个(这样它就可以区分连接到不同 USB 端口的相同设备).由于虚拟序列号是基于位置的,所以每个USB插座会有不同的串口号.

If the device has no serial number, Windows will make one up based on where you connect it (so that it can tell the difference between identical devices connected to different USB ports). Since the virtual serial number is based on location, there will be a different serial port number for each USB socket.

任何相同的设备(没有序列号)都将在该套接字中获得该端口号,每个相同的设备将在这些套接字中获得这些端口号.

Any identical device (with no serial number) will get that port number in that socket, each identical device will get those port numbers in those sockets.

还可以将 Windows 配置为始终忽略序列号 (GlobalDisableSerNumGen) 或始终忽略特定 pID/vID 组合的序列号 (IgnoreHWSerNum).效果与设备没有序列号相同:Windows 根据位置提供设备端口号.

It is also possible to configure Windows to always ignore serial numbers (GlobalDisableSerNumGen) or to always ignore serial numbers for specific pID/vID combinations (IgnoreHWSerNum). The effect is the same as if the device had no serial number: Windows gives the devices port numbers based on location.

这篇关于Windows 如何将虚拟 COM 端口映射到设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆