Author Topic: Accessing COM ports >9 ??  (Read 3838 times)

0 Members and 1 Guest are viewing this topic.

Offline softfoot

  • Newbie
  • Posts: 2
    • View Profile
Accessing COM ports >9 ??
« on: August 28, 2020, 06:52:44 pm »
Probably a bit of a newby question ...

In the documentation it says that QB64 can open COM 1-9.

Is there any way to open those over nine ??

I am running WIN 7 and one USB serial adapter is coming up as COM7 and I can open that OK, but a second adapter is at COM27 and fails to open.

TIA Dave

Offline doppler

  • Forum Regular
  • Posts: 241
    • View Profile
Re: Accessing COM ports >9 ??
« Reply #1 on: August 30, 2020, 06:50:26 pm »
Are they FTDI type devices?  There is a way to permanently assign comm ports.  They won't change as long as, the same USB port is used.  Any FTDI device can be used and the same comm port is used again.  Search google for a FTDI document on comm port assignment. This is a registry hack to make FTDI VID/PID stable to a comm port.

Second way (quickest but can change again).
Right click on start menu (window symbol) Pick Device manager > ports > "right click the port" > properties > advanced > port settings.  Change port number to an not opened port < 9  <hit OK> <hit OK> <close device manager>

If you are using a NON FTDI device.  It maybe possible to use your device VID/PID change the lock setting of the port using the FTDI document.  I have not tried this but it should work.  The hack is only changing how the Communication Enumerator assigns port numbers.

Offline softfoot

  • Newbie
  • Posts: 2
    • View Profile
Re: Accessing COM ports >9 ??
« Reply #2 on: August 30, 2020, 11:52:46 pm »
Sadly, none of those is an option and since I have a lot of com ports on the target machine its unlikely that I have a spare/unused one.

I would have prefered to use QB64 but have had to switch to FreeBasic as it supports COM1-255 without fuss.

Thanks for the info though, it will be useful elsewhere.

Dave

Offline doppler

  • Forum Regular
  • Posts: 241
    • View Profile
Re: Accessing COM ports >9 ??
« Reply #3 on: August 31, 2020, 06:32:23 am »
Not all is lost yet.  Take an inventory of physical comm ports in your machine.  You may not have all comm ports assigned in 1 to 9.  The device driver is not the end all authority.  Even the enumerator may say the port is in use when it is not.  It maybe just reserved.  That's where the physical inventory comes into play.

Re-assigning some of the ports to free up a location in the 1-9 range is an option.  Re-think what ports must be assigned in the 1-9 range.  The software in use for those ports maybe able to go above 9, allowing a re-assignment to free the lower range.

If you are using serial ports to talk from PC to PC machines.  An alternative could be http://com0com.sourceforge.net/ which allows serial to serial VCP communications.  re: using Ethernet as the linking medium.

Please detail your serial ports requirements.  Are you in a MFG environment using PC's and CNC machines, pick place or robotic movement ?  Is an endpoint of the serial comm a dedicated machine to another PC ?  Do you need optical isolation comm for a noisy RF environment ?

I have a experience in this stuff. If I can't answer it someone maybe able to.  BTW, QB64 does not have a 9 port limit (I think).  It was just setup that way to simplify things.  It maybe possible to expand to the real 255 limit.  The only real limit is in Windows.  Using USB to connect stuff, it has an ENDPOINT limit.  It's a programming thing.  USB3 devices use 2 endpoints and USB 2< uses 1.  The number of endpoints that windows can setup is less than 255 much less.  Comms maybe assigned up to 255 but you will never have 255 of them.