Click to See Complete Forum and Search --> : Serial Communication


Automatik
May 18th, 2005, 07:49 AM
I am trying to communicate between serial ports. The MSCOMM activex code works, but it is not what I want to use because you need the license and so forth. I have found a few examples on the web, but do any of you know a flawless way to do serial communication (read/write).

Automatik
May 19th, 2005, 08:25 AM
I don't want to use any ActiveX code at all.

RoboTact
May 19th, 2005, 11:36 AM
Search in CodeGuru for "serial port". There were answers suggesting this, but somehow they disappeared...

Andreas Masur
May 19th, 2005, 11:41 AM
Well...assuming the Windows operating system...

Depending on what you are trying to do take a look at the functions

BuildCommDCB()
ClearCommError()
CreateFile()
EscapeCommFunction()
GetCommModemStatus()
GetCommState()
GetCommTimeouts()
GetOverlappedResult()
ReadFile()
SetCommMask()
SetCommTimeouts()
WaitCommEvent()
WriteFile()

Additionally, the MSDN (http://msdn.microsoft.com) provides a detailed article about serial communication in Windows. Open MSDN, choose Index and type "Serial Communications". There are several subitems, choose 'Win32'... (it's also available online (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp)).