SerialPort timeouts

S

SteM

Hi all,
somebody told me to post my questions here ...


i'm in a trouble handling timeouts of the SerialPort class.
If I set timeouts (<>0) what i have to expect? An error? A call to
DataReceived routine? A call to Error routine?

What is the initial moment when the timeout count starts? When i open the
port? When I send data? Delay between chars?

What is the 'real' minimum timeout the code is able to handle? What about 5
ms??

Thanks!
 
D

Dick Grier

Timeouts control the amount of time that the serial driver keeps data around
before it is discarded (if not processed). For example, the transmit
timeout governs the data you are sending from your application. If it
cannot be sent before the timeout has expired (say, flow control has stopped
the transmit process) the data that has been buffered will be discarded.
Also, the receive timeout operates similarly. If your application does not
handle data received before the timeout period, the receive buffer is
cleared by the driver.

I, normally, set both transmit and receive timeouts to 5000 mS. This is
arbitrary (receive is a don't care). I sometimes increase the transmit
timeout for slow data (say, 300 bps) or slow systems, where flow control may
interrupt data transmission for an extended period of time

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top