SerialPort1.ReadLine

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
 
C

Chris

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
 
D

DickGrier

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.
 

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