www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/04/09:51:32

From: David Allsopp <daa AT tqSPAMbase DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Help needed: reading COM1
Date: Thu, 4 Feb 1999 14:34:47 +0000
Organization: Tranquillity Software Ltd.
Message-ID: <tu8XHPAHAbu2Ewmz@tqbase.demon.co.uk>
NNTP-Posting-Host: tqbase.demon.co.uk
X-NNTP-Posting-Host: tqbase.demon.co.uk:193.237.23.6
X-Trace: news.demon.co.uk 918139266 nnrp-13:22292 NO-IDENT tqbase.demon.co.uk:193.237.23.6
X-Complaints-To: abuse AT demon DOT net
MIME-Version: 1.0
X-Newsreader: Turnpike (32) Version 4.01 <g0Tf4xpDTD4exNTVgwOBdC6kr2>
Lines: 37
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Summary: need help in writing simple program to read from COM ports
under Win95.

Background: I'm a freelance programmer, database applications
mostly.  When one of my customers said "Can you write something
to read a short, simple string from COM1 and write it out to a
file?", I thought "Well, I haven't used C for <mumble> years, but
this doesn't sound too hard."  This is exactly what you'd expect
an old Unix programmer to think, of course.

So, after some research, I've got the latest DJGPP compiler,
and I've started in on the FAQ, which is, of course, huge.

Could anyone help me short-circuit the process of finding what I want,
please?  The program I need to write must:

        Open COM1 (or possibly another COM) and send a character.

        Read a short (~30 char) string from the port.

        Write the string out to a file.

        Time out after 5 seconds if the port (a weighbridge, actually)
        doesn't reply.

        There is no windowing/GUI functionality needed at all.

What's the best start point in the FAQ, and which are the relevant
libraries, please?

I'm gradually getting the rust off my C skills, but it's taking a
while...

Thanks in advance.
-- 
David Allsopp                           Houston, this is Tranquillity Base.
Remove SPAM to email me                 The Eagle has landed.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019