WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 06-22-2010, 12:04 PM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Thumbs up

Thanks for the heads up there Wayne, as you suspected my serial settings were wrong however readline() would still not work correctly with 'NMEA out' enabled but work fine with 'Text out'!
However I have ended up using the following approach - Thanks StackOverflow
Code:
buffer = ''
while True:
	buffer = buffer + ser.read(ser.inWaiting())
	if '\n' in buffer:
		lines = buffer.split('\n') # Splits buffer block into lines
		last_received = lines[-2]
		buffer = lines[-1]
		print last_received
which is working pretty much how I want it to

Last edited by nige777; 06-22-2010 at 12:08 PM.
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
serial port with vizard Moh200jo Vizard 3 03-13-2009 03:21 PM
A simple Plug_in for reading data from serial port sled Plug-in development 0 08-12-2003 09:52 AM


All times are GMT -7. The time now is 11:42 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC