473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

SerialPort1.ReadLine

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

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Jan 4 '06 #1
2 6234
Jan wrote:
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

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com


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

do a loop and use readchar
Chris
Jan 4 '06 #2
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.
Jan 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jian Qiu | last post by:
Hi, I tried to install python2.4.2. Unfortunately building 'readline' extension failed. Here is what I got: (It is a bit long. If you are impatient, please look at the end where it reports the...
4
by: David Bear | last post by:
I built python 2.4.2 for suse linux 9.3. I configured it to be a separate instance of python from the version packaged with suse. Now when I start it I get an error: python Python 2.4.2 (#4,...
3
by: PointMan | last post by:
what i know is... while ((currentStr = sr.ReadLine()) != null) { in this area, can i get next ReadLine Value of currentStr } best regard,,
2
by: RG | last post by:
I am looking for the equivalent serialport1 event handler for "If MSComm1.CommEvent = comEvReceive Then" I am not able to find the "data received event"
0
by: 7stud | last post by:
Hi, 1) Does this make any sense: """ Thus, the loop: for line in f: iterates on each line of the file. Due to buffering issues,
6
by: Sean Davis | last post by:
I have a large file that I would like to transform and then feed to a function (psycopg2 copy_from) that expects a file-like object (needs read and readline methods). I have a class like so: ...
0
by: Akira Kitada | last post by:
Hi list, I was trying to build Python 2.6 on FreeBSD 4.11 and found it failed to build some of the modules. """ Failed to find the necessary bits to build these modules: _bsddb ...
0
by: M.-A. Lemburg | last post by:
On 2008-10-25 08:39, Akira Kitada wrote: Please post a bug report on python.org about these failures. The multiprocessing module is still fairly new and obviously needs more fine tuning for...
0
by: Akira Kitada | last post by:
Hi Marc-Andre, Thanks for the suggestion. I opened a ticket for this issue: http://bugs.python.org/issue4204 Now I understand the state of the multiprocessing module, but it's too bad to see...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.