Call Search
     

New to Ham Radio?
My Profile

Community
Articles
Forums
News
Reviews
Friends Remembered
Strays
Survey Question

Operating
Contesting
DX Cluster Spots
Propagation

Resources
Calendar
Classifieds
Ham Exams
Ham Links
List Archives
News Articles
Product Reviews
QSL Managers

Site Info
eHam Help (FAQ)
Support the site
The eHam Team
Advertising Info
Vision Statement
About eHam.net

   Home   Help Search  
Pages: [1]   Go Down
  Print  
Author Topic: Using all com ports  (Read 4327 times)
N1DVJ
Member

Posts: 383




Ignore
« on: September 28, 2013, 10:30:50 AM »

It seems that for years I've been running into software that may or may not be decent, it may or may not be the next best thing, but it won't work.  There's a lot of HAM software out that STILL doesn't work generically with all the com ports available on a PC. 

But that's not totally the HAM writers fault.  The original PC com port scheme was so brain dead developers had to write their own code to get around it and make it work.  In my opinion the only thing worse than the built in com routines were the built in video routines.  And when the HD came along, it wasn't far behind.

However, the system developers eventually cleaned up their act.  Eventually.  But I STILL run into software that just doesn't work.  I've found software that won't work except on COM1 or COM2.  Then software that won't work past COM9. 

The justification with some developers is that writing com routines for Windows for high numbered com channels is tedious. 

Sorry, I don't buy that.  You can write the SAME software for ANY com port if you do it right, and the only difference is how you init the port.

So, here's what I did in one of my Delphi programs, and this works for com ports up to COM99

  ComParams := Concat('COM', IntToStr(portnum), ':',IntToStr(baudrate),',n,8,1')  ;
  pComParams := StrPCopy(buff, ComParams);         { creat null term strings }
  if portnum < 10 then pPortName :=  StrPLCopy ( buf4, ComParams, 4 )
      else pPortName :=  StrPLCopy ( buf4, '\\.\'+ComParams, 9 );

The first part, for a single digit com number up to 9, builds a string that starts with COMx where x is the number.  When the com port hits 10, the string now starts with COMxx, or 1 digit longer.  In addition, the ComParams string is preceeded by the doubleback slash a period and a single back slash.  So that's 1 + 4 characters long, or the length changes from 4 to 9 in the string copy command, a difference of 5.  I didn't do it here, but to go past COM99 and into the hundreds, just change the length from 9 to 10, the slash thing is the same.

In Delphi you then just call the CreateFile routine using the above pPortName as the first parameter, then use the returned handle to access the port.

I've used COM ports that are virtual on other machines up in the 200's, but you have to be careful with the delays when the com port isn't really on the host machine.  I've been told from various sources that this technique work up to COM768 from one person, and to com1023 from another, but I don't personally know for sure.

This technique has worked for YEARS on multiple versions of the windows operating systems. 

NO MORE EXCUSES!!
Logged
W8JX
Member

Posts: 5438




Ignore
« Reply #1 on: October 02, 2013, 09:27:58 AM »

The "excuse" may be that there is a problem with OS compatibility for those wanting to use XP still.
Logged

--------------------------------------
Entered using a  WiFi Win 8.1 RT tablet or a Android tablet using 4G/LTE or WiFi.
N1DVJ
Member

Posts: 383




Ignore
« Reply #2 on: October 02, 2013, 11:32:56 AM »

That was my point, there is no excuse.

For years the writers always would say they needed primitive access to the video and com ports.  But once even the EGA came along, that excuse went away.  Writers adopted it only because they had to, the simple stuff just wasn't there any more and the complex stuff varied way to much from vendor to vendor.

With the com port they held on with the lie that they just HAD to do it themselves to get the performance.  But that was BS.  They just didn't want to take a little bit of time to learn how to do it right.  Those that did found it to be simpler and more robust they most of them could do themselves. 

Heck, remember the predecessor to RTSystems?  But they came on board, and now it just doesn't matter.  Heck, they even went so far as to use USB as part of their piracy protection scheme.   And their software works on any port, anywhere, anytime.  Well, at least as far as I've seen.

Logged
KC4MOP
Member

Posts: 729




Ignore
« Reply #3 on: October 03, 2013, 03:48:17 AM »

There is probably a lot of hams stuck with their 1985 computer and do not want to give up on Win95.
XP was a nice break-away from the computer trap we were in.
I am enjoying win7 and many many com ports. There is now software available for virtual com ports (comm-o-comm) to link various Ham apps internally within the machine. And virtual audio cables (VAC) to interconnect audio in/out between apps too.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!