Re: MSComm Newby Question

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



Hi,

>>
but where/when is it done?
It seems to me that the NEMA strings I am receiving are incomplete or
fragmented. Should I parse it out as it comes into the buffer one character
at a time or get a larger segment of the string and then parse it out?
<<

The simple way is to concatenate data in the OnComm event. When you have
one (or more) complete sentences, then parse the data out. Each sentence is
terminated by a CRLF, so parsing is pretty simple. Just remember to clean
up the string buffer that you use to concatenated data, after it has been
parsed.

Dick


--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.


.



Relevant Pages

  • Re: Help With PyParsing of output from win32pdhutil.ShowAllProcesses()
    ... None to a string). ... Still have an urge to parse with pyparsing? ... pyparsing Dict class. ... keys from the parsed data, so it looks like you are already thinking ...
    (comp.lang.python)
  • Re: Pyparsing help
    ... our grammar isn't parsing the METAL2 entry at all. ... input string". ... successful parse, then restored half of the entries I removed, until I ... Layer PRBOUNDARY ...
    (comp.lang.python)
  • Re: Nasty code...but please critique it anyway :-)
    ... You only need <string>, move all the other #includes to the C++ files. ... compilation times. ... You may want to use a std::stringstream to parse the integer, ... You may want to flush the output stream after printing menutext, ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Nasty code...but please critique it anyway :-)
    ... You only need <string>, move all the other #includes to the C++ files. ... compilation times. ... You may want to use a std::stringstream to parse the integer, ... You may want to flush the output stream after printing menutext, ...
    (comp.lang.cpp)
  • Re: make changes to a file, then reading in those changes. . .
    ... > I have a file that I want to run multiple actions on. ... > read in as one long string. ... > substitute some words with others so I run a substitution. ... > parse SOURCE; ...
    (perl.beginners)