Serial Port CE_OVERRUN errors
- From: "Paul E. Schoen" <pstech@xxxxxxxxx>
- Date: Sat, 4 Feb 2006 16:48:56 -0500
I have discovered that the communication errors I was experiencing are
buffer overruns, which cause loss of a character. This was only identified
as such when I ran the software on a built-in serial port rather than the
USB device. I am trying to find the answer to why this is happening, and it
seems to be at a lower level than the implementation in Delphi, or the
SerialNG component. It appears to be at the level of the operating system,
or even the BIOS. I don't think it is the hardware itself, as I have seen
these errors on several different machines, and with WinXP as well as WinMe.
The main Input buffer is set to 32000, and I have a variable which is
updated with the maximum number of characters waiting there each time the
handler is serviced. Usually this ratchets up from about 8 to 6000 or so,
and only once or twice have I seen it actually reach anywhere near 32000.
However, I still get the CE_OVERRUN errors occasionally, and my data check
system confirms that one (or more) characters are lost each time this
occurs. I tried boosting the baud rate from 57.6k to 115.2k, to give more
space between character pairs, but results were about the same.
I ran a test overnight, using the USB device, for 23,750 seconds, and had
406 errors. This corresponds to 3.56 lost characters per million. Another
test (with the built-in serial port), showed less than 1 per million. My
software compensates for these errors fairly well (I am sampling a 60 Hz
waveform at 2400 samples per sec), so it just shows a little glitch in the
waveform, and the performance as it is will be tolerable.
I have tried to find out what is a normally expected serial data error rate
for a PC, but have had no luck yet. I can also perform more rigorous testing
on a variety of machines to see if there may be any differences. I have made
a lot of changes in my code since I first experienced these errors, and some
of the changes did seem to improve the error rate. It is difficult when
sometimes the software will run for 5 or 10 minutes with no error, and then
at some other time I might get one or two errors within a few seconds. Low
system resources and multiple processes running do make the problem worse,
which is reasonable. I will also try running PortMon to see if it detects
anything.
Hopefully some of you may have had experience with this sort of thing. I
have tried to contact Ekkehard Domning (SerialNG) but have not heard from
him lately, and I'm not sure if other newsgroups may be more suitable for
this if it is not directly caused by something in Delphi.
Thanks,
--
Paul E. Schoen, President
P S Technology, Inc.
Cockeysville, MD
www.pstech-inc.com
.
- Follow-Ups:
- Re: Serial Port CE_OVERRUN errors
- From: Jamie
- Re: Serial Port CE_OVERRUN errors
- From: alanglloyd@xxxxxxx
- Re: Serial Port CE_OVERRUN errors
- From: Hans-Peter Diettrich
- Re: Serial Port CE_OVERRUN errors
- From: Paul E. Schoen
- Re: Serial Port CE_OVERRUN errors
- Prev by Date: Help with changing Icons
- Next by Date: How to get no. of copies of printed pages
- Previous by thread: Help with changing Icons
- Next by thread: Re: Serial Port CE_OVERRUN errors
- Index(es):