serialport1.writebuffersize problem

F

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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SerialPort1.ReadLine 2
Dialer Failing Under VB2010 beta 1
rs232 3
serialPort receive problem 6
rs232 Data Received 7
Serialport issue? 10
SerialPort control using RTS/CTS seems to loose bytes 20
Serial port proxy 1

Top