LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keeping multiple COM ports in check

Hi All,

I am working on a project where I need to talk to 4 UART devices. The devices are identical but I need to know which one is which. My plan is to have a custom PCB associated with each device which includes a FTDI Serial->USB IC.

My concern is that on other projects I have had COM ports spontaneously change on me. Typically this happens after the system has been off for a while.

How do I prevent COM ports from reassigning themselves?

I had thought about creating a custom USB device which would perform the USB->Serial conversion and then also have GPIO for ID, but that seems like more trouble than its worth.

Thanks!

0 Kudos
Message 1 of 6
(404 Views)

I don't know how to prevent com port numbers from changing.

But if your devices are serialized, you might be able to use "Find Com Port of USB PnP Device.vi"

Message 2 of 6
(376 Views)

@operty wrote:

My concern is that on other projects I have had COM ports spontaneously change on me. Typically this happens after the system has been off for a while.

That is an issue that does not happen much if you use good, commercial grade USB-RS232 adapters.  I would be more inclined to get a PCIe board with 4 ports on it.  I have never had an issue with a PCIe board, even with cheap ones.  This does assume a tower PC for the test setup.  If you are using a laptop, get a good, commercial-grade, serial port hub.  I have personally had a lot of success with StarTech ICUSB2324I.  If possible, I would also recommend using an external power supply for this hub, mostly because I don't trust laptop USB hubs to properly supply power.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(367 Views)

I have not done this for awhile, but with USB serial converters I think you can assign particular COM port numbers in windows.  It was always a nuisance when the port number changed if I plugged one into a different USB port.

0 Kudos
Message 4 of 6
(357 Views)

Modern versions of Windows will "remember" what Com port it assigned to what USB device as long as the USB to Serial device is using a non-counterfeit chipset, as each chip should have a different UUID.

 

I have not had any problem with randomly changing com ports designators since Windows 7 using FTDI chipset USB to Serial adaptors bought from FTDI as opposed to some cheap generic adaptor from Amazon.

 

Now there can be a couple hoops you need to jump through if your compile and deploy your application on another computer. In this case I suggest you label the adaptors with the com port you expect them to be at. Then plug them into the target computer one at a time and use Windows Device Manager to set each adaptor to the com port is is supposed to be on.

========================
=== Engineer Ambiguously ===
========================
Message 5 of 6
(338 Views)

On FTDI (and probably an other commercial grade chips) you can also access a few EEPROM settings, which - if i remember correctly - include the device identification string.

 

What I did once was enumerate the available serial port devices through the device manager, then check their respective parent devices (which would be the USB adapters or some controller on the host PC) for the ID that I would expect. This way, the adapters could be immediately used on a new PC without having to set up the port numbers manually or sending identification queries to all available ports.

 

Maybe this is what @paul_a_cardinale 's code is doing (I can't open the code here). In this case, I am sorry for repeated the idea and recommend it.

0 Kudos
Message 6 of 6
(319 Views)