Re: Reading data from port

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.


.



Relevant Pages

  • Re: Reading data from port
    ... data into an array of type Byte, and parse out of that array. ... are using the ReadByte method instead of the Read method... ... my parsing code is very simple. ...
    (microsoft.public.dotnet.general)
  • Re: Parsing a chemical formal
    ... > portion of single atoms ... > Beginning letter of a element ist written in upper case. ... > capital letter will be pushed in a temporary Array. ... It can parse formulas like the ...
    (comp.lang.perl.misc)
  • Re: Advanced? Parsing Methods
    ... >>and writes new records to a table in a SQL Server 2000 database. ... >> Would it be faster to use the Splitfunction to parse each line (using ... >> a comma delimiter) and pass the parsed data to an array? ... that I can select a specific item within the array. ...
    (microsoft.public.access.modulesdaovba)
  • Re: extract config files tokens: need advice on algorithm
    ... I'd kill comments in the lexer. ... There are plenty of sources on the web for writing lexer and writing ... parsing code written in the normal structured way. ... Since 'named' is quite a common file to parse I expect you will be able ...
    (comp.programming)
  • Re: Parsing Data, Storing into an array, Infinite Backslashes
    ... > I am using this function to parse data I have stored in an array. ... It looks like you are setting the variable qval to the string ... Hint: it ...
    (comp.lang.python)