Solved

Locking in a port setting for USB

Posted on 2006-07-21
7
554 Views
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.  
0
Comment
Question by:rosenblumm
  • 4
  • 3
7 Comments
 
LVL 44

Expert Comment

by:scrathcyboy
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.
0
 

Author Comment

by:rosenblumm
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.  
0
 
LVL 44

Expert Comment

by:scrathcyboy
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?  
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:rosenblumm
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.
0
 
LVL 44

Accepted Solution

by:
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.
0
 

Author Comment

by:rosenblumm
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."
0
 
LVL 44

Expert Comment

by:scrathcyboy
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 !!!
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
Can you find a fax from a vendor you saved a decade ago in seconds? Have you ever cursed your PC under your breath during an audit because you couldn’t find the requested statement or driver history?  If you answered no to the first question or yes …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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