Locking in a port setting for USB

Posted on 2006-07-21
Last Modified: 2012-08-14
Is there a way to lock in the port settings so that a specific USB port will always be set to com x, and also can the port settings be locked in to some value other than the Windows default ?

The issue is that the default com number is com 4 but this can be changed through Device Manager-Ports-(converter device)-Properties-Port settings-Advanced and setting to com 1. But the problem arises when the device is unplugged and reattached. When the driver reloads, the com port reverts back to the default of com 4 (on my pc, at least).Since the laptop does not have the 9 pin port, the signal must be converted to USB, and a RS-232 to USB adapter is employed.  
Question by:rosenblumm
  • 4
  • 3
LVL 44

Expert Comment

ID: 17161911
NO, you do not set USB devices to any specific COM port, that is erroneous thinking.  COM 1-4 are used normally by the system and COM 5-8 are for other COM adapters.  NONE of these ports relate to USB.  A universal serial device bus is a PLUG_N_PLAY but that is specifically engineered to be autodetected by windows OSs.  It is NOT designed for fixed IRQs and port numbers, if you try to do this, you will totally freeze the USB bus.

The way USB works is that each DEVICE on the bus has an ID that is identified and dynamically assigned to a "resource" in the system ID chain, as well as the windows configurable interrupts and ports on the USB controller bus, it is totally separate from fixed COM ports.

If the identification of USB devices ever gets fouled up, you go into disk management, and assign that device on the USB bus to a unique DRIVE LETTER -- which can help separate USB devices, but you never assign it fixed resources, it doesnt work that way.

Author Comment

ID: 17168598
I understand that, I need a way to work around that.  This modification is being done for machines that we are building that will always be exactly the same.  
LVL 44

Expert Comment

ID: 17173040
" Is there a way to lock in the port settings so that a specific USB port will always be set to com x"

No, USB is supposed to be configurable, it is designed to adapt to the system.  Sounds like you need to force the user to use COM1 for this application, since you want a true serial port, not a USB, correct?  
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.


Author Comment

ID: 17176418
We can't force the user to do anything.  The systems that are being built are the foundation for automated equipment that the customers will have installed.  It could be configured once to work ok, but if there was a cycle of power for whatever reason, our customers might be screwed.
LVL 44

Accepted Solution

scrathcyboy earned 500 total points
ID: 17178828
I dont think so.  If you are using straight USB, it will automatically adapt to find the device on whatever port and IRQ is assigned to it (usually 10 up).  However, if you are converting a USB device to run on a serial card, then yes, there could be a reboot problem.  However, if the adapter is between the device and the USB cable, and is just a pin converter, I dont see a problem.  Try a few failures to see.  You cannot lock in a USB port on a windows system -- go into device manager and check all USB devices and controllers, and you will see there is NO WAY to pick manual settings to lock it in.  That is not the USB system.  You could write your own device driver, but windows will freeze when it cannot dynamically change the USB port assignments, and the user can still remove that device driver if it is giving problems.

Author Comment

ID: 17179011
It's a USB to Serial connection.  What do you think of this solution?

"Our devices use the FTDI USB interface chip, and they're programmed with a "USB Serial Number".  This allows the assigned COM port to follow the particular cable.  It can be plugged into any USB port on the same host and still be assigned the same COM port.  For your application, you only need to be sure that "cable 1" is used with "device 1" and "cable 2" is used with "device 2" when you ship it to a customer.

The same is true for our 2-port devices as well.  Serial 1 (or the top port of the ES-U-1002) is assigned the lower COM port number.  Serial 2 (or the bottom port) is the higher COM port.

Finally, the device driver also allows modifying the COM port number through the advanced settings.  Once changed, the newly assigned COM port number will follow the cable as before."
LVL 44

Expert Comment

ID: 17292741
In fact, you CAN pin a USB serial number to a com port, starting at COM7, I think.  And as long as you have a hardcoded number to work with, then yes, you could do this -- but their strategy is not in line with the plug and play idea of USB ports -- however, I do sympathize with their effort or attempt to TRY to fix a USB device to a particular COM port.  It is a great idea, until a problem develops.

Suppose the user loses the BIOS settings, and his windows XP settings get corrupted and he has to do a repair install --- then the USB device list is lost.  Also, suppose he has to remove the USB driver because it is "stuck" because of one of these fixed assignments that they suggest, per your quote -- then the USB table is lost.  And if the user has to do a repair install, or update the USB drivers, it is also lost.

In the end, I would simply TRY what they suggest -- it might work fine for a long time for most users -- but if not, be prepared to help them on tech support with the problems.  This is EASY to do, all you have to do is simulate a failure on your own system -- upgrade the USB drivers, remove them, do a repair install -- do ALL those kinds of things -- including adding oodles of USB devices until the bus is choked -- if you TEST what will happen, you KNOW what will happen, at least on XP.

And good luck !!!

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now