LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB to Serial Comport Changing Mapping

My test system has 4 Serial devices that each use individual USB to Serial converters and the Prolific USB-to-Serial Comm Port driver.  The 4 devices are located inside a test rack and utilize a multiport USB hub with a single cable back to the host PC.  My problem is with Windows remapping the 4 devices to new Comport numbers whenever the system is shut down or if the host PC is removed and plugged back into the test rack.

I’m using XP & LabVIEW 8.6 and have written utilities to detect if the expected Comports exist by identifying the Comport driver interface description for each expected port number and comparing against a list of expected values. If the test fails, I still have to manually open device manager, plug in each device one by one and watch to see what new device Comport appears, and then update my comport configuration file.

Has anyone come up with a reliable solution to prevent the remapping of the USB to Serial converter port numbers or a utility to automate the process of detecting each device?

0 Kudos
Message 1 of 9
(8,165 Views)

In the past i have used code similar to this to find what COM ports have been assigned to a known adaptor type. When a USB->RS232 adaptor is used it will get a description in Device Manager that is something like "Random Brand RS232 Adaptor", and if you know what this is going to be, use that instead of "Communications Port" (in the attached VI) and it will list all of the associated COM ports on the system of that adaptor type.

 

Shaun 

Message 2 of 9
(8,144 Views)

I think this might be a problem related to the adapter you are using. I have used Belkin adapters extensively and they seem to remember their COM port assignments even if unplugged and moved to a different USB port. I don't think I have ever seen Windows remap serial ports unless the serial port configuration changed - restarting certainly shouldn't do it.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 9
(8,129 Views)

Shaun,

  Your example is very similar to the utility I created to detect if the Comports exist on my system. My real question is if someone has perfected a way to prevent the remapping of the Comport numbers or a way of automating the process of detecting each devices port number.

 

Mike,

  My system has 4 USB to Serial devices. 2 are USBGear converters, 1 is a ACTiSYS USB to serial Infrared adapter, and 1 is a B&K Power Supply. All 4 devices came with and use the same Prolific driver.

 

Thanks,

Todd

0 Kudos
Message 4 of 9
(8,103 Views)

Hello Todd,

 

I may be mistaken, but doesn't the number after the ASRL you receive represent the COM port of that resource?  It seems like you could use the query to programmatically determine which COM ports are associated with which resources.

0 Kudos
Message 5 of 9
(8,050 Views)

That utility will tell you the COM port of a specific adaptor - i.e. it can identify what COMx has been associated with your ACTiSYS USB to serial Infrared adapter by supplying the appropriate device manager string instead of "Communications Port". This allows you to make sure that you use the correct com port from there on in. I used it when communicating with a custom USB device that used an RS232-USB chip - the customer wanted the application to detect that one of their devices had been connected and to avoid having to ask the user what COM port to use (which invariably led to confusion as users dont generally understand that a USB device may still have a COM port number).

 

I'm not sure how to tell the difference between two devices that are the same (ie your two USBGear converters) unless they have a command that returns a serial number or something. 

 

PS. I have had a couple of situations over the years where the ASRLx number didnt match the COM number, therefore I get suspicious of relying on that method. 

0 Kudos
Message 6 of 9
(8,042 Views)

I'm running into the same problems with a variety of USB to serial adapters using the prolific drivers.  What's worse is that my instruments don't all even "talk back", so the best I can do to automate the discovery process is sort of a "click here, does instrument 1's light blink, yes or no?" type of system. 

Compared to engineering time, these USB to serial adapters are pretty cheap, so if I can solve the problem by buying different adapters, that's an option.  Mike Porter mentioned that he's had good luck with Belkin adapters.  Does anybody know what to look for in an adapter that gives it the capability to come up at the same location?  I assume there is some sort of serial number in some adapters but not others that windows looks for?  I'm no expert on the USB protocols. 

Mike, do you perchance have a part number for that adapter?  Any body else have any pertinant information that will help us all buy the right part to begin with in the future?

Thanks all,

Ben

0 Kudos
Message 7 of 9
(8,009 Views)

I have run into the device number switching issues myself.

 

There may be a way of digging this up from the registry but I'm just guessing on that point.

 

In post number 11 of Shane's USB Nugget, Daklu posted code that read the device descriptor info. Tht may be be helpful in figuring out what is what but unless the mnfg includes a S/N it may not help in distinguishing two of the same model.

 

Just trying to help,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(8,004 Views)
have also experienced this problem. To avoid it you have to use the exact system setup every time. Then you have a working system: Label the USB RS232 converters so you can plug them into the same hub port next time. Remember also to plug the hub into the same USB connector on your PC. If you still think it is to cumbersome buy a 4 port serial to USB converter. You find it here http://www.serialgear.com/4-Port-Serial-USB.html .

 This way your RS232 ports will have the same order. But they will be remapped if change the USB connector on the PC side



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 9 of 9
(7,945 Views)