CommRead data with unknown length

C

Christof Kluß

Hi Bruce

Am 20-09-2012 20:10, schrieb Bruce Bowler:
On Thu, 20 Sep 2012 17:13:42 +0200, Christof Kluß wrote:
How does the device terminate what ever it is it sends? If that's known,
you should be able to read a character at a time, concatenating them
together, until you get the "end of data" indicator...

I only know that the output comes in lines that end with "CRLF", but it
is not set how many lines. Perhaps I can read until long time nothing
comes (after a CRLF)? Do you have an idea how to do this?

Probably, like you said, I have to read one character at time, but how
do I know, if I am out of time?

Do
lngStatus = CommRead(intPortID, strData, 1)
buffer = buffer & strData
...
Loop Until outoftime

Christof
 

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

Top