SerialPort1.ReadLine

  • Thread starter Thread starter Jan
  • Start date Start date
J

Jan

Hi

why is this piece of code not working?????
It's getting really frustrating.
I can not figure it out.

If I replace the readline method for readchar it's working. But one
character. I want to read everything from the serialport

SerialPort1.Open()

TextBox1.Text = SerialPort1.ReadLine

SerialPort1.Close()

I hope someone has the answer
 
Jan said:
Hi

why is this piece of code not working?????
It's getting really frustrating.
I can not figure it out.

If I replace the readline method for readchar it's working. But one
character. I want to read everything from the serialport

SerialPort1.Open()

TextBox1.Text = SerialPort1.ReadLine

SerialPort1.Close()

I hope someone has the answer

How is the system suppose to know when "everything" has be read.

do a loop and use readchar
Chris
 
Did you see my reply to your previous inquiry?

Do you know that this "should" work? Have you examined the data from your
device to make sure that it actually it terminated with both carriage return
and line feed characters in that order?

There are other (better, IMO) ways to handle this problem.

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition, ISBN 1-890422-28-2, Mabry Publishing (391 pages, includes CD-ROM).
July 2004.
See www.hardandsoftware.net for details and contact information.
 
Back
Top