Author Topic: Limit of COM9 is anachronistic and problematic  (Read 4223 times)

0 Members and 1 Guest are viewing this topic.

Offline GTC

  • Newbie
  • Posts: 49
  • Programmer's motto: *This* time it will work.
    • View Profile
Limit of COM9 is anachronistic and problematic
« on: January 14, 2021, 08:30:57 pm »
@Fellippe

Regarding:

Quote
QB64 can open any COMn port number from 1 to 9.

This is my request that the upper limit of 9 ports be replaced with Windows' own limit of 255.

These days, plug-n-play hubs, etc, create port numbers above 9 and QB64's artificial limit of 9 is a nuisance.

Thanks.

FellippeHeitor

  • Guest
Re: Limit of COM9 is anachronistic and problematic
« Reply #1 on: January 14, 2021, 08:34:25 pm »
Hi there.

@luke added an issue to the repository with the reported COM problem of your previous post. I believe he'll be able to see if this is feasible as well.

Thanks for your input!
« Last Edit: January 14, 2021, 08:46:35 pm by FellippeHeitor »

Offline GTC

  • Newbie
  • Posts: 49
  • Programmer's motto: *This* time it will work.
    • View Profile
Re: Limit of COM9 is anachronistic and problematic
« Reply #2 on: January 15, 2021, 04:53:23 am »
Thanks Fellippe. Would you kindly flag this to his attention.

Offline Mad Axeman

  • Newbie
  • Posts: 74
    • View Profile
    • My web site - Harrythetrout
Re: Limit of COM9 is anachronistic and problematic
« Reply #3 on: January 15, 2021, 05:55:37 pm »
I'm opening ports higher than 9 without problem.

 OPEN "COM" + port$ + ":9600,N,8,1,BIN,CS0,DS0" FOR RANDOM AS #1

where port$ can be 30+ on my laptop. I wrote a small routing for checking openable ports from 1 to 255 without problems
Oh look - a sig file :-)

Offline GTC

  • Newbie
  • Posts: 49
  • Programmer's motto: *This* time it will work.
    • View Profile
Re: Limit of COM9 is anachronistic and problematic
« Reply #4 on: January 15, 2021, 07:04:18 pm »
I'm opening ports higher than 9 without problem.

 OPEN "COM" + port$ + ":9600,N,8,1,BIN,CS0,DS0" FOR RANDOM AS #1

where port$ can be 30+ on my laptop. I wrote a small routing for checking openable ports from 1 to 255 without problems

What OS are you using?

I'm using Win 7 and it gives me error 68 (device unavailable) if I go over 9. OK for 9 and under.

EDIT: Case in point -- I added a PCI-type dual serial port to my tower PC. The driver/Windows designated the new ports as COM11 and COM12. QB64 gave me error 68 on those so I had to use Device Manager to renumber those ports to COM2 and COM4, whereupon QB64 was happy.

This may be another manifestation of my other report about COM ports -- now classified on GitHub as a bug.
« Last Edit: January 15, 2021, 11:33:39 pm by GTC »

Offline Mad Axeman

  • Newbie
  • Posts: 74
    • View Profile
    • My web site - Harrythetrout
Re: Limit of COM9 is anachronistic and problematic
« Reply #5 on: January 16, 2021, 05:47:34 am »
I'm running Win 8.1 with QB V1.4. I can have 2 x USB to RS232 and 1 USB to RS485 on COM9, 11 & 12  without problem. I have just tried re-assigning the COMs to lower numbers and my program no longer detects them. I've got another laptop here running (don't laugh!) Vista. I'll try it out later and see what happens on there.
Oh look - a sig file :-)

Offline Mad Axeman

  • Newbie
  • Posts: 74
    • View Profile
    • My web site - Harrythetrout
Re: Limit of COM9 is anachronistic and problematic
« Reply #6 on: January 16, 2021, 06:50:53 am »
I've just tried it on Win Vista (stop sniggering, I can hear you all!) and QB1.5. I installed a USB to RS232 adaptor (I had forgotten just how awkward Vista is with that sort of thing) and it was auto assigned COM15. I ran my program which normally auto finds usable ports and it failed to find it. I reassigned it to COM2 and it still didn't find it (error 68) so I'm not sure if it's a QB problem or my program. I'll have to do a bit more playing around and see whats going on
Oh look - a sig file :-)

Offline GTC

  • Newbie
  • Posts: 49
  • Programmer's motto: *This* time it will work.
    • View Profile
Re: Limit of COM9 is anachronistic and problematic
« Reply #7 on: January 16, 2021, 06:55:49 am »
I've got another laptop here running (don't laugh!) Vista.

I've got tower PCs with Win 3.1, 95, 98 and XP. Not sure how boot-able they all are.

My lifelong procedure has been never to update Windows in place, but to buy a new PC with the latest version on it already.

I sat on XP for as long as possible and now I'm sitting on on 7 64-bit. I hated what I saw with 8 and I like 10 even less.

(BTW: Scuttlebut is that MS considers Windows development a money-losing thing nowadays and some pundits posit that they -- or some MS partner -- may port the GUI to some form of Unix.)

Offline GTC

  • Newbie
  • Posts: 49
  • Programmer's motto: *This* time it will work.
    • View Profile
Re: Limit of COM9 is anachronistic and problematic
« Reply #8 on: January 16, 2021, 06:58:58 am »
[...] I'm not sure if it's a QB problem or my program. I'll have to do a bit more playing around and see whats going on

I get the impression that COM port handing within QB64 is brittle. As mentioned, an associated bug report is on GitHub.

Thanks for the tests!

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: Limit of COM9 is anachronistic and problematic
« Reply #9 on: January 16, 2021, 07:35:20 am »
I'd like to work on this but I'm in the rather awkward position of not having the physical hardware to test with.

Can anyone recommend a software stack for setting up a COM port and connecting it to, say, a virtual modem or similar? Preferably a program that I can connect to with varying stop bits, baud rates etc.