SV: [DOTNET-WINFORMS] SerialPort.WriteTimout
Benny Skjold Tordrup <[email protected]> Wed, 9 Jan 2008 04:58:12 +0100
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <00a201c85273$dae75710$90b60530$@net> |
Does the physical port settings match the settings that you apply in code? Med venlig hilsen / Best regards Benny Tordrup System Developer Microsoft Certified Technology Specialist -----Oprindelig meddelelse----- Fra: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] På vegne af Peter Osucha Sendt: 9. januar 2008 04:28 Til: [email protected] Emne: Re: [DOTNET-WINFORMS] SerialPort.WriteTimout Thanks, Don. I have a very small test c# (2.0) app that opens a serial port, sets the baud rate and a few other items, and then writes a stream of 50 chars. Doesn't seem to present a problem. I have a much larger, more complicated c# app that also writes to a serial port with similar port settings and less characters and I keep getting a write timeout error. So it doesn't seem to be the hardware. I am looking for other places I might have screwed up (and yes, I do know the port is open! :-)). Peter -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Don Clark Sent: Tuesday, January 08, 2008 5:31 PM To: [email protected] Subject: Re: [DOTNET-WINFORMS] SerialPort.WriteTimout It's not always just the length of the data and the baud rate. I've seen write timeouts happen when using virtual serial port controls even though given the baud rate and the length of the data there was ample time to complete the operation. The most recent drivers for the siLabs 210x USB to Serial chips seem to be especially slow. With a write timeout of 400ms I was sometimes unable to write 2 characters to my device at 38400 baud. If the write operation isn't completed during the timeout period a timeoutexception will be thrown. Don -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Peter Osucha Sent: Tuesday, January 08, 2008 1:58 PM To: [email protected] Subject: [DOTNET-WINFORMS] SerialPort.WriteTimout I have been searching for info on what actually will cause a WriteTimeout error to happen on a serialport object in net 2.0. There are lots of articles that talk about a Write operation not being able to complete in the time allotted. However, besides having a series of bytes to be written that when taking into the account the baud rate cannot complete in the allotted time, I can't think of another reason for this error to occur - nor can I find reference to when it will occur. Any ideas or places you could point me, please? Sincerely, Peter