Maptitude GISDK Help

GetGPSInfo()

Summary

Gets a reading from a GPS device.

 

Syntax

GetGPSInfo()

 

Returns

In case of a transient error (e.g., a timeout when reading from a GPS device), a one-element array is returned, containing a string describing the error. Otherwise, an array of eleven elements is returned, describing the current GPS reading. If particular information is missing, that field is null, otherwise the elements are:

 

Element Type Contents
1 Integer Longitude (in millionths of degrees)
2 Integer Latitude (in millionths of degrees)
3 String Time in the form HH:MM:SS.uuu (hours, minutes, seconds and milliseconds)
4 String Date (DD/MM/YY)
5 Real Course in degrees true north
6 Real Speed (over ground) in miles per hour
7 Real Altitude in feet
8 Real Course in degrees magnetic north
9 String Text describing the status of the device
10 Real Horizontal dilution of precision
11 String Text describing the status of the device

 

Notes

Example

// Most common settings

options = {{"Read From", "\\\\.\\COM1"}, {"Baud Rate", 4800},

     {"Data Bits", 8},{"Stop Bits", 1}, {"Parity", "None"}}

StartGPS("Serial Port", options)

dim pos[10]

for i=1 to 10 do

     gps_data = GetGPSInfo()

     if gps_data.length = 1 then

          ShowMessage("An error while reading: " + gps_data[1])

     else if gps_data[1] <> null && gps_data[2] <> null then

// Store the location as a coordinate

          pos[i] = Coord(gps_data[1], gps_data[2])

end     // for

StopGPS()

 

Error Codes

Error Type Meaning
Error No GPS device has been initialized, or a fatal error occurred while reading from the device
EndOfFile Reached the end of the playback file (not applicable when reading from serial ports)

 

See Also

Function Summary
StartGPS() Initializes reading from a GPS device
StopGPS() Closes a GPS device

 

 

©2025 Caliper Corporation www.caliper.com