Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Serial Communications - SUCCESS!!!

From: webmaster::windsweptfarm::com at: 21-Oct-2001 17:44

Dear List, Many warm thanks to those who responded with such speed and charity to my plight. 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" line terminator. Thanks for the heads up on that regardless. It was on my list anyway. TO DO: My next hurdle is to create a loop to identify the specific NMEA sentences. 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 experience. The first pitfall I see is having Rebol mistake this $ sign for a money token and wrap me up in some data type dungeon. In any event thanks again. CODE start----> close gps_stream gps_stream: open/read/lines serial://port2/4800/8/none/1 while [0 <> (length? (line: first gps_stream))] [print line] close gps_stream CODE stop----> ; This is the data stream cut from console $GPGLL,4330.038,N,08030.681,W,220800,A*3B $PGRMZ,865,f,3*10 $PGRMM,WGS 84*06 $GPBOD,251.5,T,261.3,M,GARMIN,*5C $GPRTE,1,1,c,0,GARMIN*35 $GPWPL,3851.333,N,09447.941,W,GARMIN*49 $GPRMC,220801,A,4330.029,N,08030.719,W,086.9,251.5,260202,009.8,W*75 $GPRMB,A,0.00,R,,GARMIN,3851.333,N,09447.941,W,703.5,251.5,086.9,V*2F $GPGGA,220801,4330.027,N,08030.725,W,1,09,2.0,263.5,M,-35.4,M,,*75 $GPGSA,A,3,01,04,05,06,07,10,13,24,30,,,,1.8,2.0,3.0*3D $GPGSV,3,1,09,01,08,033,32,04,38,068,44,05,36,247,43,06,17,308,38*7D $GPGSV,3,2,09,07,10,133,34,10,50,204,46,13,23,062,40,24,72,014,49*79 $GPGSV,3,3,09,30,33,286,43,,,,,,,,,,,,*48 $PGRME,15.0,M,22.5,M,15.0,M*1B