Home All Groups Group Topic Archive Search About

serialport1.writebuffersize problem

Author
8 Jul 2009 11:49 AM
friend
Hello all,

How to increase the writebuffersize of a serial port
the default value is 2048 bytes. if i try to send more than 2048 bytes
the application is getting blocked.

I need to send 2.5mb of data and i tried to increase the
writebuffersize manually in the properties of serialport.
It didnt worked...

thanks for any help...

Author
8 Jul 2009 4:04 PM
Dick Grier
Hi,


You can increase it, but certainly not to the size of the data that you want
(I do not remember the practical limits, but I think they may be about
32K) -- and (IMO) there is no good reason to do so.

Simply write a few lines of code that calls the Write method in a loop.  In
the loop, break the buffer you are sending into "chunks" of 2048 bytes.  If
you want non-blocking operation, place this code in a worker thread.

Dick

--
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.

Bookmark and Share

Post Thread options