[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Get your server patched

5/7/2008 10:09:00 AM

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!

--
SteM


1 Answer

Dick Grier

5/7/2008 3:46:00 PM

0

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.