IonicWind Software

IWBasic => General Questions => Topic started by: JimH on March 10, 2009, 02:23:51 PM

Title: Serial Port programming
Post by: JimH on March 10, 2009, 02:23:51 PM
I need to capture the output of our telephone system and save it. The data blazes across the wire at 9600 bps and needs to be dumped to a text file for later processing. (Yes, I know that 9600 bps doesn't seem too "blazing" these days, but for those of us who remember how marvelous it was when 1200 bps modems arrived for our BBS systems back in the 80's...)  ;)

Searching through the topics here, I don't see much about reading from the serial ports. There is one topic that refers to port.dll, but the links in that topic appear to be dead.

Is anybody else grabbing data from the serial ports on the PC? How are you doing that?

   <*> Jim
Title: Re: Serial Port programming
Post by: Ionic Wind Support Team on March 10, 2009, 02:36:51 PM
Mine doesn't even have serial ports ;)

Look at the example program commread.eba that comes with Emergence.  That is the preferred way of doing it since your not allowed to directly read/write from a serial port.

Paul.
Title: Re: Serial Port programming
Post by: Rock Ridge Farm (Larry) on March 10, 2009, 03:05:54 PM
One thing to remember is to write stop/start control into your code.
Even at 96k you can cause a buffer overflow or loss of data.
I did something like this a long time ago in 'C'.
It was logging all the traffic from the port and I was dropping data till I
added the stop/start control. (IOCTL).
Title: Re: Serial Port programming
Post by: JimH on March 10, 2009, 05:00:52 PM
Ah, source code! Thank you, Paul!!

I was sure there was an example somewhere, but my brain-dead Vista search insisted that it couldn't find the .eba sample files on my system. It took a little manual digging to find them.

Quote from: Paul Turley on March 10, 2009, 02:36:51 PM
Mine doesn't even have serial ports ;)

Yeah, sadly, almost all of the new computers don't have serial ports these days. I had to dig around to find an old box with one on the motherboard.

Quote from: Rock Ridge Farm (Larry) on March 10, 2009, 03:05:54 PM
One thing to remember is to write stop/start control into your code.
Even at 96k you can cause a buffer overflow or loss of data.

Thanks for the reminder, Larry. It has been a while since I had to deal with stuff like that. Years ago, there was an amazingly versatile communications library called PDQComm for QB45 and Basic 7 that I used to write a bunch of drivers for platform truck scales. TSR programs for DOS - those were the days!

   <*> Jim
Title: Re: Serial Port programming
Post by: LarryMc on March 10, 2009, 05:11:20 PM
Jim,
I used that same library w/QB45 to interface into a security card reader system.

Larry
Title: Re: Serial Port programming
Post by: JimH on March 10, 2009, 09:10:05 PM
Quote from: Larry McCaughn on March 10, 2009, 05:11:20 PM
I used that same library w/QB45 to interface into a security card reader system.

I'm straying a bit off-topic here, but back then Crescent Software was a major force in BASIC programming tools. I think I convinced my boss to buy just about all of them, from QuickPak Pro and XRef to PDQ and PDQcomm. Those along with AJS Publishing's db/Lib routines to work with dBase files were my box of everyday magic tricks. They were all incredibly useful tools.

   <*> Jim