Windows/C++/COM Port problem
Hi,
First, sorry, I don't know much software, so please excuse my posting, if this is in the wrong spot. I have a consultant doing a meter program using MS Visual C++ 2010, and he is having trouble fixing a bug, so I thought I would see if anybody has a suggestion.
The application connects to a com port (115200, no handshaking), and displays an angle. The data can come quite fast at times. He occasionally misses the last sets of values (the last value sent is the most important one). He claims it is something to do with Windows.
When I use Hyperterm, it never fails, so I seem to think it shouldn't be a problem.
Any comments/suggestions?
Thanks,
Mark
Re: Windows/C++/COM Port problem
Well, the only possible comment is that the "application connects to a com port" has some bugs.
Since we have no idea how this application was supposed to be implemented and worked, it is no possible to say more...
Re: Windows/C++/COM Port problem
I would say that the application absolutely has some bug. If I don't remember wrong the serial port buffer is about 1000 bytes in Windows so in a modern PC and at that quite slow bitrate it shouldn't be an issue to handle the received data. I've done applications with 10 Mbit / seconds serial communication (serial port on USB) without having any issues so claiming it has something to do with Windows is low.
Just remembered... if you run windows 3.11 on for instance something like a 386/486 then 115200 isn't supported. I can recommend one that I know works at that rate though... ;)
Re: Windows/C++/COM Port problem
The data that is comig in is an ASCII angle, always the same # of characters (8), the last 2 are CR and LF. i.e. +179.0 CR LF. Is there a way to attach the SerialPort.cpp file here? I have no issues with anybody seeing it.
I don't know how hyperterm works. I thought maybe since it was older, it works different than a program written with MSVC++.
Thanks again,
Mark
Re: Windows/C++/COM Port problem
In the advanced editor there is an attach button. It might though that even if SerialPort.cpp is alright the characters are lost in some other parts of the code.
One way of test that is to use a serial port class that is used by many others (i.e. many testers and eyes that search for bugs). There are a lot of such classes on the net and as an example http://www.naughter.com/serialport.html