PDA

View Full Version : Q about serial port writes



P. Short
12-27-2007, 10:50 PM
Questions for those who know...

1) is the serial port output buffer fixed in size? If so, what is the size, and can this be modified?

2) Does the write command that is used in the various plugins return any error indication if there is a transmit buffer overflow?

This is in the context of trying to figure out what is causing the dropouts that some people with more than about 128 channels have been experiencing. I'm suspicious that the O.S. scheduling has some role in this problem, and am trying to think of ways to check this out.

--

Phil

teberle
12-28-2007, 05:49 PM
Phil,

For item one the default values for read is 4096 bytes and the default value for write is 2048 bytes. They can both be set by doing the folloiwng:

serialPort1.WriteBufferSize = 4096;

For Item two you can set the following event:

private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
{

}

and it should return you any errors. I haven't done this myself and would need to mock it up to see what errors are returned.

Tony

P. Short
12-28-2007, 05:54 PM
Thanks. A buffer size of 2048 bytes is large enough that I think that the problem that people are seeing is probably not due to transmit buffer overrun. I'll have to think about it, I'm not sure where to start right now.

--

Phil