SV: [DOTNET-WINFORMS] SV: [DOTNET-WINFORMS] SerialPort.WriteTimout

Benny Skjold Tordrup <[email protected]> Thu, 10 Jan 2008 05:00:59 +0100
Newsgroups gmane.comp.windows.devel.dotnet.winforms
Message-ID <013101c8533d$68d1ceb0$3a756c10$@net>
Peter,

Try the command "mode com1" (or what ever com port you use) in a cmd shell.
What settings are returned? Do they match the settings you want to use from
your code?

Med venlig hilsen / Best regards





-----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 14:23
Til: [email protected]
Emne: Re: [DOTNET-WINFORMS] SV: [DOTNET-WINFORMS] SerialPort.WriteTimout

Benny, I'm not sure what you mean by this.  The port can handle the baud
rate and all lines (for the 9 pin rs-232 spec) are connected.  Is this what
you meant?

Peter

-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps and
controls [mailto:[email protected]] On Behalf Of Benny
Skjold Tordrup
Sent: Tuesday, January 08, 2008 10:58 PM
To: [email protected]
Subject: [DOTNET-WINFORMS] SV: [DOTNET-WINFORMS] SerialPort.WriteTimout

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