![]() |
|
#1
|
|||
|
|||
Receiving data over serial portI'm programming a C++ console app that receives data over the serial port and does some number crunching on it. I got the serial library over at http://www.codeproject.com/system/serial.asp . I'm hoping someone here is familiar with it, because I'm having problems using it.
First all, I know that the input data is a series of 6 bytes at a baud rate of 115200, no handshaking, and theoretically continues forever. I am using a serial port monitoring program and can confirm that this data is being sent properly. The problem is that my program receives the data, but at varying byte intervals, ranging from 9 to too-many-to-count. There are no control codes or anything in the stream, so if it doesn't read in the 6 bytes per read then the rest of the data won't be correct. CPP / C++ / C Code:
I figure the code won't mean much to people who haven't used this specific library, but I'm hoping that someone can give me a hand. Any help would be appreciated! Last edited by admin : 23-May-2006 at 07:50.
Reason: Please insert your C code between [c] & [/c] tags
|
|||
|
#2
|
|||
|
|||
Re: Receiving data over serial porti dont know anything about that library, but i looked at it when I was going to do all my serial port stuff. ended up finding some really good howto kinda stuff, which i basically threw together in this post:
http://www.gidforums.com/showthread.php?p=46273 i had a ton of trouble trying to get this and that class working and eventually just had to dig in and do it that way^, but it turned out to be really easy since I basically copy and pasted the code into my prog and it worked. maybe itll help you? if not good luck! |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 14:12 |
| Strange C++ code memory leakage problem | gaoanyu | C++ Forum | 7 | 04-Nov-2005 09:09 |
| Problem to read on a serial port | collinm | C Programming Language | 2 | 30-Mar-2005 02:42 |
| Problem with string and serial port | collinm | C Programming Language | 13 | 25-Mar-2005 08:39 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The