Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

GPS NMEA Handling Query


ocrory Aug 27, 2018 05:27 AM

I'm trying to store Lat and Long values in the format as output by the device i.e. DDMM.MMMM and DDDMM,MMMM respectively. We currently use the GPS instruction but this breaks both the Lat and Long into two separate variables (Degrees and Minutes). Is there a way to get the instruction to output the values as received from the device? I don't think so but thought I'd ask to begin with...

One appraoch could be to use the SerialIn function but I wonder if issues could arise if both the GPS instruction and SerialIn instruction are pointed to the same Com Port?

Alternatively, is there a way to stitch the two variables back together? By this I mean merge the degrees and minutes variables together after the GPS instruction has done it's thing?

Any thoughts or ideas would be well received. 

I've pasted the sections of code related to the GPS instruction below:

Public NMEAStrings(4) As String * 90 = {"$GPRMC","$GPGGA","$GPHDT"}',"$GPVTG","$GPGSA"
Dim GPS_Data(19)

GPS (GPS_Data(),COMU1,-1,750,NMEAStrings(1))

Lat_deg = GPS_Data(1)
Lat_min = GPS_Data(2)
Lon_deg = GPS_Data(3)
Lon_min = GPS_Data(4)
SOG_kts = GPS_Data(5)
COG_deg = GPS_Data(6)
Mag_Var_deg = GPS_Data(7)
Fix_quality = GPS_Data(8)
nmbr_satellites = GPS_Data(9)

Many thanks in advance,

Ocrory


JDavis Aug 27, 2018 05:02 PM

The NMEAStrings variables will have the intact data strings. You can parse those with SplitStr() to get the piece you want.


ocrory Aug 27, 2018 05:38 PM

Thanks, I'll give that a go

Log in or register to post/reply in the forum.