[REBOL] Serial Communications - SUCCESS!!!
From: webmaster::windsweptfarm::com at: 21-Oct-2001 17:44
Many warm thanks to those who responded with such speed and charity to
I could go on about the silly little stuff that made this minor exercise
a pain, but I won't.
I had the port command and related parameters when I put out my plea to
the list, but thanks for confirming by findings.
Many thaks to Dave Hawley for the while block.
As feeble as it may seem that was my brick wall so to speak.
So this little creation generates a stream of NMEA sentences when you
hook a GPS to com2.
For now they scroll down the console on a line by line basis.
I assume the /lines refinement obviated the need for tracking the "^M"
Thanks for the heads up on that regardless. It was on my list anyway.
My next hurdle is to create a loop to identify the specific NMEA
That funny stuff that looks like [$GPGLL] is what defines a particular
data sentence in NMEA.
Once I can identify a sentence by the first few characters (in this case
a $ sign followed by five letters I can shunt them off for processing.
Any pointers in this regard will not be spurned given my recent
The first pitfall I see is having Rebol mistake this $ sign for a money
and wrap me up in some data type dungeon.
In any event thanks again.
gps_stream: open/read/lines serial://port2/4800/8/none/1
while [0 <> (length? (line: first gps_stream))] [print line]
; This is the data stream cut from console