Xon/xoff flow control with MSComm

I've been trying to reliably send ASCII files to a NC machine tool that has a 132 character input buffer. When about 120 characters have been sent the machine sends an xoff( ASCII 19). When some of the characters have been transferred from the buffer to the main memory a xon (ASCII 17) character is sent to request more characters. I have tried both the OnComEvent method and even polling the serial port and have not been consistantly able to trap the flow control characters. My instantaneous rate is 9600 Baud. I seem to recall a reference that stated that the inner workings of MSComm results in the port being polled 18 1/2 times per second even in the OnComEvent mode. At 9600 Baud that is a deadband of about 52 characters. If that is true then it seems that xon/xoff will periodically fail. My kludged solution is to send one character and then Sleep for 3 milliseconds. That seems to keep up with the bleedout rate of the buffer.
realpayneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LewyCommented:
Try setting the Handshaking property to comXonXoff and let the control do the hand shaking.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.