Click to See Complete Forum and Search --> : Receive event delay enigma


Mike Pearce
May 14th, 1999, 10:02 AM
Can anyone put me out of my misery?

I have successfully set up a comm port class which uses a thread to monitor
port status and received data. It works fine except for one thing. A delay is
introduced between physically receiving a character and getting the event to
tell me so. I have an echo cable set up on my PC so whatever I transmit, I also receive on the same port. The bugger is that the magnitude of this delay seems
to depend on the baud rate settings. I get a delay of about 3.5 seconds at 300
baud which decreases proportionately as the baud rate increases. At 38400 baud, the delay is either 0 or 10 milliseconds.
My code sets up the port for asynchronous comms and I am using WaitCommEvent etc.
I don't expect to get perfect reaction times from a multitasking OS like NT, but I least expect some consistency. This tells me I have missed something.

I have tried thread priorities and real-time processes to no avail.

Has anyone out there come across this problem and if so did you solve it?
If you did....can you tell me how to do it too please.

Cheers.