Re: Reading data from port
- From: "Dick Grier" <dick_grierNOSPAM@.msn.com>
- Date: Sat, 6 Oct 2007 10:57:41 -0600
Hi,
Try this.
Use a Windows forms Timer to poll for receive data, instead of the
DataReceived event. Then you do not need to invoke a Delegate to update the
UI.
However.... I suspect the problem may be in your receive and parsing code,
rather than in the UI update. You don't show that code, but if it takes a
lot of time, there is nothing that you can do, except to make sure that you
are processing the data efficiently. For example, if you were to attempt to
read data one-byte-at-a-time (the alternative is to read ALL available data
in a single call), and to parse that single byte from each read, you never
will achieve the speed that you need. You must Read your data into an array
of type Byte, and parse out of that array. So, if you are using the
ReadByte method instead of the Read method... Try Read.
--
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.
.
- Follow-Ups:
- Re: Reading data from port
- From: Shark
- Re: Reading data from port
- References:
- Reading data from port
- From: Shark
- Reading data from port
- Prev by Date: Re: I'd really like your opinion about this....
- Next by Date: display turned sideways
- Previous by thread: Reading data from port
- Next by thread: Re: Reading data from port
- Index(es):
Relevant Pages
|