Good Day,
I am developing an application that utilizes the serial port. I have looked
through the news groups and seen some examples.
Here is my dilemna:
I am creating a processing intensive application that gets all of its data
from the serial port.
It would be great if I could do the following:
Read Com Port, parse message
Determine message type
call appropriate function to process message
continue extensive processing
So I need to read the com port, collect the bytes, check to see if I have a
message
If I have a complete message, process it
Now the problem may be that the stream of data to the serial port could be
constant, message after message. And I will have a ton of processing that
will have to happen while the data collection on the serial port continues.
If this is possible, please if you could point me in the right direction I
would certainly appreciate it.
Thanks,
Bill
Jochen Kalmbach [MVP] - 09 Jun 2005 07:34 GMT
Hi bill!
> Now the problem may be that the stream of data to the serial port could be
> constant, message after message. And I will have a ton of processing that
> will have to happen while the data collection on the serial port continues.
1. Use some "prooven and working" serial port class like:
See: Serial library for C++
http://www.codeproject.com/system/serial.asp
See: CSerialPort v1.03 - Serial Port Wrapper
http://www.codeproject.com/system/cserialport.asp
> If this is possible, please if you could point me in the right direction I
> would certainly appreciate it.
Use one thread only for reading the data and put the "message" into an
queue which will be processed from an different thread.

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/