Page 1 of 1

Serial Port Information

Posted: Mon Jun 21, 2004 8:21 pm
by TerryHough
Here is a program to look for any installed serial ports (Com1 - 16).
For each port found, an attempt is made to send and receive data,
Actually, the data sent is a standard modem request that should return
the modem's information if the port has an attached modem.

NOTE: This uses several WinAPI calls

The code includes examples of:
Defining the DCB
Setting the COMM State
Setting the COMM Timouts
Setting the COMM Buffers
Purging the COMM Buffers
Sending data to a COMx port
Receiving data from a COMx port
Panel and ListIcon gadget handling
SplashMsg (thanks to Vanleth and PB)

An executable and the source code is available <a href="http://www.electrofile.com/purebasic/in ... P">HERE</a>.

Screenshot

Image

Hope you find this useful,

Terry

Posted: Mon Jun 21, 2004 10:51 pm
by RJP Computing
This looks Great :!:

Thanks. I will download it right now.

Serial I/O

Posted: Fri Jul 30, 2004 6:14 am
by SimpleMind
Hi,

Thanks for the examples. nice work.

If you want to see some more examples go to the Microssoft site and serach for MTTTY and 'Allen Denver'. He did a very good job on Serial I/O and OVERLAPPED I/O and the creating of threads and events so your interface is not blocking.

MTTTY is C but you can learn a lot of it.

David M. Hitchner wrote ModCOMM a bunch of VB routines.

Regards,

Marcel