MarshallSoft GPS Component
Reference Library
(MGC_REF)
Version 2.0
June 22, 2007
This software is provided as-is.
There are no warranties, expressed or implied.
Copyright (C) 2007
All rights reserved
MarshallSoft Computing, Inc.
Post Office Box 4543
Huntsville AL 35815 USA
Voice : 1.256.881.4630
email : info@marshallsoft.com
web : www.marshallsoft.com
MARSHALLSOFT is a registered trademark of MarshallSoft Computing.
1 Introduction
1.1 General Remarks2 MGC functions
1.2 Documentation Set
1.3 Declaration Files
1.4 Language Notes
2.1 mgcAltitude3 Sentence Field Codes
2.2 mgcAttach
2.3 mgcBearing
2.4 mgcCallback
2.5 mgcClose
2.6 mgcDecodeDeg
2.7 mgcDecodeMin
2.8 mgcDecodeSec
2.9 mgcDecodeTho
2.10 mgcEncodeDMS
2.11 mgcEncodeDMT
2.12 mgcErrorText
2.13 mgcGetData
2.14 mgcGetInteger
2.15 mgcGetSentenceType
2.16 mgcGetString
2.17 mgcGreatCircle
2.18 mgcLatitude
2.19 mgcLockData
2.20 mgcLongitude
2.21 mgcNewLatitude
2.22 mgcNewLongitude
2.23 mgcOpen
2.24 mgcRelease
2.25 mgcSeaLevel
2.26 mgcSetInteger
2.27 mgcSleep
2.28 mgcStatus
2.29 mgcSysTime
2.30 mgcTimestamp
4 Error Codes
4.1 Serial Port Error Codes
4.2 MGC Error Codes
The MarshallSoft GPS Component (MGC) is a 32-bit dynamic link library (DLL) which reads and decodes standard GPS (Global Positioning System) NMEA (National Marine Electronics Association) 183 sentences from an RS232 serial port as well as computes great circle distances and bearings.
The MarshallSoft GPS Component library can be called from any application capable of calling Windows API functions, including those written in C/C++, .NET, Visual C#, Delphi, Delphi .NET, Visual Basic, Visual Basic .NET, MS Access, MS Excel, MS Word, Fortran, COBOL, PowerBuilder, FoxPro, Power Basic, dBase, Xbase++, etc. We have released versions of the MarshallSoft GPS Component SDK for C/C++ (MGC4C) and Visual Basic (MGC4VB). All versions of MGC use the same DLL (MGC32.DLL).
The latest version of the MarshallSoft GPS Component software can be found online at:
http://www.marshallsoft.com/gps.htm
The MarshallSoft GPS Component Reference Manual (MGC_REF) contains details on each individual MGC function.
All functions return an integer code. Negative values are always errors. See "MGC Error Codes" in Section_4.2. Only return values < MGC_ERROR_BASE (numerical -20000000) are errors.
Note that the mgcErrorText function is used to get the text message associated with any error code.
Each function argument is marked as:
Refer to the declaration files (see Section 1.3 below) for the exact syntax of each MGC function. Also note that the example programs show exactly how MGC functions are called.
The complete set of documentation consists of three manuals in three formats. This is the third manual (MGC_REF) in the set.
Each manual comes in three formats:
The exact syntax for calling MGC functions are specific to the host language (C/C++, Delphi, VB, etc.) and are defined for each language in the "MGC declaration files". Each MGC product comes with the appropriate declaration file for the supported language. For example,
MGC4C C/C++ MGC.H
MGC4VB Visual Basic MGC.BAS
VBA (EXCEL,ACCESS,etc.) MGC.BAS
All MGC functions are used in one or more example programs.
All language versions of MGC include the example program MGCVER. Refer to this program and the declaration file as defined in Section 1.3 above to see how MGC functions are called. The MGCVER program is also the first program that should be compiled and run.
MGC functions can be called from 32-bit application programs only.
mgcAltitude()
The mgcAltitude function returns the last altitude value read provided that GPGGA sentence decoding has been selected. Altitude is returned in units of tenths of meters or tenths of feet. The default is meters.
For example, if the value 124 is returned and the units are meters, then the altitude is 12.4 meters.
// get altitude (in meters) above sea level
Altitude = 10.0 * (double)mgcAltitude();
BASIC Example
' get altitude (in meters) above sea level
Altitude = 10.0 * CDbl(mgcAltitude())
mgcAttach(KeyCode)
KeyCode : (I) Registration key code.
The mgcAttach function must be the first MGC call made: it establishes communications with the MGC component. The mgcAttach function should be called once during the initialization portion of the application code.
When MGC is registered, you will receive a 'KeyCode' which matches the 'KeyCode' within the registered DLL. For the evaluation version, the keycode is 0. See file KEYCODE found in the APPS subdirectory.
unsigned int KeyCode;
KeyCode = 0;
// attach MGC component
Code = mgcAttach(KeyCode);
BASIC Example
Dim KeyCode As Long
KeyCode = 0
' attach MGC component
Code = mgcAttach(KeyCode)
mgcBearing(Lat1,Lon1,Lat2,Lon2)
Lat1 : (I) Latitude of first position (Coded Integer form).
Lon1 : (I) Longitude of first position (Coded Integer form).
Lat2 : (I) Latitude of second position (Coded Integer form).
Lon2 : (I) Longitude of second position (Coded Integer form).
The mgcBearing function returns the bearing from (Lat1, Lon1) to (Lat2, Lon2) in units of hundred-thousandths of a degree. For example, if the value 6589204 is returned, then the bearing is 65.89204 degrees (true).
Refer to the Section_5.1, "Coordinates Used in MGC", in the MarshallSoft GPS Component User's Manual for more details on Coded Integer form.
Note that 0 degrees is due North, 90 degrees is due East, 180 degrees is due South, and 270 degrees is due West.
// Lat1 = Latitude (Coded Integer form)
// Lon1 = Longitue (Coded Integer form)
Angle = mgcBearing(Lat1, -Lon1, ..., ...) / 60000.0;
' Lat1 = Latitude (Coded Integer form)
' Lon1 = Longitue (Coded Integer form)
Angle = mgcBearing(Lat1, -Lon1, ..., ...) / 60000.0
Code = mgcCallback( fn_addr )
Fn_addr : (P) Function address.
Once registered, the callback function, which is created in the user's program code, will be called by MGC whenever there is a new sentence ready to be read.
The mgcCallback function is for use by C/C++ programs only. Refer to the CALLBACK.C example program.
void Callback(int SentenceType)
{// lock data buffer
mgcLockData(1);
//process sentence here . . .
// unlock data buffer
mgcLockData(0);
}
// register callback function
Code = mgcCallback( &Callback );
mgcClose()
The mgcClose function closes the serial port, after which no further processing can occur. mgcClose should be called before exiting your application.
mgcClose()
BASIC Example
mgcClose()
mgcOpen
mgcDecodeDeg(iCoded)
iCoded : (I) Coded degrees >= 0
The mgcDecodeDeg function extracts integral degrees from a coded integer value. Refer to Section_5.1, "Coordinates Used in MGC" in the MarshallSoft GPS Component User's Manual for more details on Coded Integer format.
Degrees returned will always be positive regardless of the sign of the coded integer.
// iCoded = integer coded value
iDeg = mgcDecodeDeg(iCoded);
' iCoded = integer coded value
iDeg = mgcDecodeDeg(iCoded);
mgcDecodeMin, mgcDecodeSec, mgcDecodeTho.
mgcDecodeMin(iCoded, iDeg)
iCoded : (I) Coded degrees >= 0
iDeg : (I) Integral degrees as returned by mgcDecodeDeg()
The mgcDecodeMin function extracts integral minutes from a coded integer value. Refer to Section_5.1, "Coordinates Used in MGC" in the MarshallSoft GPS Component User's Manual for more details on Coded Integer format.
Minutes returned will always be positive regardless of the sign of the coded integer.
// iCoded = integer coded value
iDeg = mgcDecodeDeg(iCoded);
iMin = mgcDecodeMin(iCoded, iDeg);
' iCoded = integer coded value
iDeg = mgcDecodeDeg(iCoded)
iMin = mgcDecodeMin(iCoded, iDeg)
mgcDecodeDeg, mgcDecodeSec, mgcDecodeTho.
mgcDecodeSec(iCoded, iDeg)
iCoded : (I) Coded degrees >= 0
iDeg : (I) Integral degrees as returned by mgcDecodeDeg() iMin : (I) Integral minutes as returned by mgcDecodeMin()
The mgcDecodeSec function extracts integral seconds from a coded integer value. Refer to Section_5.1, "Coordinates Used in MGC" in the MarshallSoft GPS Component User's Manual for more details on Coded Integer format.
Seconds returned will always be positive regardless of the sign of the coded integer.
// iCoded = integer coded value
iDeg = mgcDecodeDeg(iCoded);
iMin = mgcDecodeMin(iCoded, iDeg);
iSec = mgcDecodeSec(iCoded, iDeg, iMin);
' iCoded = integer coded value
iDeg = mgcDecodeDeg(iCoded)
iMin = mgcDecodeMin(iCoded, iDeg)
iSec = mgcDecodeSec(iCoded, iDeg, iMin)
mgcDecodeDeg, mgcDecodeMin, mgcDecodeTho.
mgcDecodeTho(iCode, iDeg, iMin)
iCoded : (I) Coded degrees >= 0
iDeg : (I) Integral degrees as returned by mgcDecodeDeg() iMin : (I) Integral minutes as returned by mgcDecodeMin()
The mgcDecodeTho function extracts integral thousandths of a minute from a coded integer value. Refer to Section_5.1, "Coordinates Used in MGC" in the MarshallSoft GPS Component User's Manual for more details on Coded Integer format.
Thousandths returned will always be positive regardless of the sign of the coded integer.
// iCoded = integer coded value
iDeg = mgcDecodeDeg(iCoded);
iMin = mgcDecodeMin(iCoded, iDeg);
iTho = mgcDecodeTho(iCoded, iDeg, iMin);
' iCoded = integer coded value
iDeg = mgcDecodeDeg(iCoded);
iMin = mgcDecodeMin(iCoded, iDeg);
iTho = mgcDecodeTho(iCoded, iDeg, iMin);
mgcDecodeDeg, mgcDecodeMin, mgcDecodeSec.
mgcEncode(Deg, Min, Sec)
iDeg : (I) Integral degrees >= 0 iMin : (I) Integral minutes >= 0 iTho : (I) Integral thousandths >= 0
The mgcEncodeDMS function encodes degrees, minutes, and seconds to a coded integer value. Refer to Section_5.1, "Coordinates Used in MGC" in the MarshallSoft GPS Component User's Manual for more details on Coded Integer format.
// encode (deg, min, sec)
iCoded = mgcEncodeDMS(iDeg,iMin,iSec);
BASIC Example
' encode (deg, min, sec)
iCoded = mgcEncodeDMS(iDeg,iMin,iSec)
ALSO SEE
mgcEncodeDMT
mgcEncode(Deg, Min, Tho)
iDeg : (I) Integral degrees >= 0 iMin : (I) Integral minutes >= 0 iTho : (I) Integral thousandths >= 0
The mgcEncodeDMT function encodes degrees, minutes, and thousandths to a coded integer value. Refer to Section_5.1, "Coordinates Used in MGC" in the MarshallSoft GPS Component User's Manual for more details on Coded Integer format.
// encode (deg, min, tho)
iCoded = mgcEncodeDMS(iDeg,iMin,iTho);
BASIC Example
' encode (deg, min, tho)
iCoded = mgcEncodeDMS(iDeg,iMin,iTho)
ALSO SEE
mgcEncodeDMS
mgcErrorText(ErrCode, Buffer)
ErrCode : (I) Error code.
Buffer : (P) Buffer for error message.
The mgcErrorText function formats the error message for error 'ErrCode' in 'Buffer'.
All MGC functions return an integer value. If this return value is less than MGC_ERROR_BASE (numerical -20000000), then an error has occurred.
Call the mgcErrorText function when an error is returned from a MGC function so that the text of the error message can be displayed or logged.
int ErrCode;
char ErrBuffer[128];
mgcErrorText(ErrCode, (char *)ErrBuffer);
printf("%s\n", ErrBuffer);
BASIC Example
Dim ErrCode As Long
Dim ErrBuffer As String * 128
Code = mgcErrorText(ErrCode, ErrBuffer)
PRINT ErrBuffer
mgcOpen
mgcGetData(DataID, Buffer)
DataID : (I) Field name.
Buffer : (P) Buffer for field text data.
The mgcGetData function returns the value of the field specified by DataID as specified in Section 6 of the MGC User's Manual (MGC_USR). Only GPGGA, GPRMC, GPGLL, GPGSV, and GPVTG sentences have DataID fields defined.
Note that for any sentence, individual fields are numbered beginning with 0. Therefore, to download the data for the third field of the current data record, specify DataID = 2.
The buffer passed must be able to hold at least 12 bytes.
char DataBuffer[12];
RefCount = mgcGetData(GPRMC_DATE,(LPSTR)DataBuffer);
BASIC Example
Dim DataBuffer As String * 12
RefCount = mgcGetData(GPRMC_DATE, DataBuffer)
mgcGetString
mgcGetInteger(ParmName)
ParmName : (I) Parameter name.
The mgcGetInteger function returns an integer parameter, depending on the parameter name passed, as follows:
[Parameter Name] [Returns]
MGC_GET_VERSION 3 part (X.Y.Z) packed version number.
MGC_GET_BUILD Build number
MGC_GET_VERSION_DIGIT1 First digit of version number.
MGC_GET_VERSION_DIGIT2 Second digit of version number.
MGC_GET_VERSION_DIGIT3 Third digit of version number.
MGC_GET_BYTES_RECEIVED Total number of bytes received.
MGC_GET_LINES_RECEIVED Total number of lines received.
MGC_GET_READY_BUFFER_COUNT Number times current data record has been referenced.
MGC_GET_STRING_LENGTH Number of bytes in 'ready' buffer.
MGC_GET_LINE_NUMBER Current (sentence) line count.
C/C++ Example
// get MGC build number Build = mgcGetInteger(MGC_GET_BUILD);BASIC Example
' get MGC build number Build = mgcGetInteger(MGC_GET_BUILD)
mgcSetInteger
mgcGetSentenceType()
The mgcGetSentenceType function returns the MGC sentence type. This is necessary when multiple sentence types are specified as in the GGA_RMC example program.
Sentence types are defined [in MGC.H (C/C++), MGC32.BAS (VB), and MGC32.PAS (Delphi)] as:
MGC_SENTENCE_GPRMC = 101
MGC_SENTENCE_GPGGA = 102
MGC_SENTENCE_GPGLL = 103
MGC_SENTENCE_GPGSV = 104
MGC_SENTENCE_GPVTG = 105
int SentenceType
// get sentence type
SentenceType = mgcGetSentenceType();
BASIC Example
Dim SentenceType As Long
// get sentence type
SentenceType = mgcGetSentenceType()
mgcCallback
mgcGetString(ParmName, Buffer, BufLen)
ParmName : (I) Parameter.
Buffer : (P) Buffer pointer.
BufLen : (I) Length of above buffer.
The mgcGetString function returns the string corresponding to the parameter name specified, a follows:
[Parameter Name] [String Returned] MGC_GET_STRING Gets (current) undecoded NMEA 183 sentence. MGC_GET_REGISTRATION Gets the registration string from MGC32.DLL.
Refer to the RAW example program.
char DataBuffer[256];
// get undecoded GPS sentence
Code = mgcGetString(MGC_GET_STRING, (char *)DataBuffer, 255);
BASIC Example
Dim DataBuffer As String * 255
' get undecoded GPS sentence
Code = mgcGetString(MGC_GET_STRING, DataBuffer, 255)
mgcGetData
mgcGreatCircle(Lat1,Lon1,Lat2,Lon2)
Lat1 : (I) Latitude of first position (Coded Integer form).
Lon1 : (I) Longitude of first position (Coded Integer form).
Lat2 : (I) Latitude of second position (Coded Integer form).
Lon2 : (I) Longitude of second position (Coded Integer form).
The mgcGreatCircle function computes the great circle distance between two points of the surface of the earth. The latitude and longitude values are passed in units of hundred-thousandths of a degree.
Refer to the Section_5.1, "Coordinates Used in MGC", in the MarshallSoft GPS Component User's Manual for more details on Coded Integer form.
Lat1 = 3450583 // Coded Integer form (34.50582 deg N)
Lon1 = -8691777 // Coded Integer form (86.91777 deg W)
Distance = mgcGreatCircle(Lat1, Lon1, ..., ...);
Lat1 = 3450583 ' Coded Integer form (34.50582 deg N)
Lon1 = -8691777 ' Coded Integer form (86.91777 deg W)
Distance = mgcGreatCircle(Lat1, Lon1, ..., ...)
mgcGetLatitude()
The mgcGetLatitude function returns the last latitude value read provided that GPGGA, GPRMC, or GPGLL sentence decoding has been selected.
Latitude is returned in units of hundred-thousandths of a degree. For example, if 3450583 is returned, then the latitude is 34.50583 degrees. Note that error codes are always less than MGC_ERROR_BASE (numerical -20000000).
Refer to the Section_5.1, "Coordinates Used in MGC", in the MarshallSoft GPS Component User's Manual for more details on Coded Integer form.
South latitude is negative.
// get current latitude
Code = mgcGetLatitude();
Latitude = (double)Code / 100000.0;
BASIC Example
' get current latitude
Code = mgcGetLatitude();
Latitude = CDbl(Code) / 100000.0
mgcLongitude
mgcLockData(Flag)
Flag : (I) Lock Flag (TRUE/FALSE).
The mgcLockData function locks (if Flag is not zero) or unlocks (if Flag is 0) the current data record so that the field data may be copied.
Normally, the data record should be locked just prior to reading individual fields, then unlocked afterwards.
// lock current sentence
mgcLockData(1);
// unlock current sentence
mgcLockData(0);
BASIC Example
' lock current sentence
mgcLockData(1)
' unlock current sentence
mgcLockData(0)
mgcGetLongitude()
The mgcLongitude function returns the last longitude value read provided that GPGGA, GPRMC, or GPGLL sentence decoding has been selected.
Longitude is returned in units of hundred-thousandths of a degree. For example, if -8634151 is returned, then the longitude is -86.34151 degrees. Note that error codes are always less than MGC_ERROR_BASE (numerical -20000000).
Refer to the Section_5.1, "Coordinates Used in MGC", in the MarshallSoft GPS Component User's Manual for more details on Coded Integer form.
West longitude is negative.
// get current Longitude
Code = mgcGetLongitude();
Latitude = (double)Code / 100000.0;
BASIC Example
// get current longitude
Code = mgcGetLongitude()
Latitude = CDbl(Code) / 100000.0;
mgcGetLatitude
mgcNewLatitude(Lat, Lon, Course, Dist)
Lat : (I) initial latitude (Coded Integer form)
Lon : (I) initial longitude (Coded Integer form)
Course : (I) Course to follow (Coded Integer form)
Dist : (I) Great circle distance (meters)
The mgcNewLatitude function returns the latitude of the position on the earth's surface that is computed from the initial latitude and longitude following the specified course and distance.
Latitude is specified in units of hundred-thousandths of a degree. For example, 34.50583 degrees is specified by the integer 3450583. Note that error codes are always less than MGC_ERROR_BASE (numerical -20000000).
Refer to the Section_5.1, "Coordinates Used in MGC", in the MarshallSoft GPS Component User's Manual for more details on Coded Integer form.
// compute new latitude
Code = mgcNewLatitude(3450582, -8677000, 4500000, 1000);
BASIC Example
' compute new latitude
Code = mgcNewLatitude(3450582, -8677000, 4500000, 1000)
ALSO SEE
mgcGetLatitude
mgcNewLongitude(Lat, Lon, Course, Dist)
Lat : (I) initial latitude (Coded Integer form)
Lon : (I) initial longitude (Coded Integer form)
Course : (I) Course to follow (Coded Integer form)
Dist : (I) Great circle distance (meters)
The mgcNewLongitude function returns the longitude of the position on the earth's surface that is computed from the initial latitude and longitude following the specified course and distance.
Longitude is specified units of hundred-thousandths of a degree. For example, 34.50583 degrees is specified by the integer 3450583. Note that error codes are always less than MGC_ERROR_BASE (numerical -20000000).
Refer to the Section_5.1, "Coordinates Used in MGC", in the MarshallSoft GPS Component User's Manual for more details on Coded Integer form.
// compute new longitude
Code = mgcNewLongitude(3450582, -8677000, 4500000, 1000);
BASIC Example
' compute new longitude
Code = mgcNewLongitude(3450582, -8677000, 4500000, 1000)
mgcGetLatitude
mgcOpen(Port)
Port : (I) Port selected.
The mgcOpen function opens the specified serial port at 4800 baud in preparation for receiving MNEA sentences. mgcAttach must be called before mgcOpen. Ports COM1 through COM64 can be specified.
The default serial port parameters
mgcSetInteger(MGC_SET_BAUDRATE, 4800);
mgcSetInteger(MGC_SET_PARITY, MGC_NoParity);
mgcSetInteger(MGC_SET_STOPBITS, MGC_OneStopBit);
mgcSetInteger(MGC_SET_DATABITS, MGC_DataBits8);
can be changed before opening the serial port.
Be sure to check the return code from mgcOpen().
// open COM1 for NMEA sentence input
Code = mgcOpen(MGC_COM1);
BASIC Example
' open COM1 for NMEA sentence input
Code = mgcOpen(MGC_COM1)
mgcClose
mgcRelease()
The mgcRelease function releases MGC32.DLL.
MGC32.DLL is normally released when your executable terminates.
The primary purpose of mgcRelease is to release MGC32.DLL so that mgcAttach can be called again in the same program.
// release MGC32.DLL
Code = mgcRelease();
BASIC Example
' release MGC32.DLL
Code = mgcRelease()
mgcAttach
mgcSeaLevel()
The mgcSeaLevel function returns the last sea level value read provided that GPGGA sentence decoding has been selected.
Sea level altitude is returned in units of tenths of meters or tenths of feet. The default is meters.
// get sea level in meters
Code = mgcSeaLevel();
SeaLevel = 10.0 * (double)Code;
BASIC Example
'get sea level in meters
Code = mgcSeaLevel();
SeaLevel = 10.0 * CDbl(Code)
mgcAltitude
mgcSetInteger(ParmName, ParmValue)
ParmName : (I) Parameter name
ParmValue : (I) Parameter value
The mgcSetInteger function sets a MGC parameter according to the following table.
[Parameter Name] [Parameter Value] [Description]
MGC_SET_BAUDRATE 4800,9600, . . . ,115200. Specify baud rate (default 4800).
MGC_SET_SENTENCE_TYPE Sets the sentence type:
MGC_SENTENCE_RAW All sentences.
MGC_SENTENCE_GPRMC GPRMC sentences.
MGC_SENTENCE_GPGGA GPGGA sentences.
MGC_SENTENCE_GPGLL GPGLL sentences.
MGC_SENTENCE_GPGSV GPGSV sentences.
MGC_SET_ALTITUDE_UNIT Sets the altitude units:
MGC_ALTITUDE_IN_FEET Feet
MGC_ALTITUDE_IN_METERS Meters
MGC_SET_DISTANCE_UNIT Sets the distance units
MGC_DISTANCE_IN_FEET Feet
MGC_DISTANCE_IN_METERS Meters
MGC_DISTANCE_IN_KM Kilometers
MGC_DISTANCE_IN_SM Statue miles
MGC_DISTANCE_IN_NM Nautical miles
// specify RAW sentences
Code = mgcSetInteger(MGC_SET_SENTENCE_TYPE, MGC_SENTENCE_RAW);
BASIC Example
' specify RAW sentences
Code = mgcSetInteger(MGC_SET_SENTENCE_TYPE, MGC_SENTENCE_RAW)
mgcGetInteger
mgcSleep(Time)
Time : (I) Time in milliseconds to sleep.
The mgcSleep function sleeps (approximately) for the number of milliseconds specified.
TRUE (1).
/* sleep one second */
mgcSleep(1000);
BASIC Example
' sleep one second
N = mgcSleep(1000)
mgcStatus()
The mgcStatus function returns TRUE if GPS serial data is being received and FALSE if serial data is not being received.
TRUE if GPS serial data is being received, else FALSE is returned.
/* are we still running ? */
if(!mgcStatus())
{
// not running
}
BASIC Example
' are we still running ?
N = mgcStatus()
If N = 0 Then
' not running
End if
mgcSysTime()
The mgcSysTime function returns the number of milliseconds since bootup. This is the same value as returned by the GetCurrentTime() Win32 API function in Windows.
Number of milliseconds since bootup.
/* get system clock time */
Time = mgcSysTime();
BASIC Example
' get system clock time
Time = mgcSysTime ()
mgcTimestamp()
The mgcTimestamp function returns the last timestamp value read provided that GPGGA or GPRMC sentence decoding has been selected.
unsigned long N;
// get system timestamp
N = mgcTimestamp();
BASIC Example
Dim N As Long
' get system timestamp
N = mgcTimestamp()
[NAME] [VALUE]
GPRMC_UTC_TIME 0
GPRMC_VALIDITY 1
GPRMC_LATITUDE 2
GPRMC_NORTH_SOUTH 3
GPRMC_LONGITUDE 4
GPRMC_EAST_WEST 5
GPRMC_SPEED 6
GPRMC_COURSE 7
GPRMC_DATE 8
GPRMC_VARIATION 9
GPRMC_VAR_EW 10
GPRMC_CHECKSUM 11
GPGGA_UTC_TIME 0
GPGGA_LATITUDE 1
GPGGA_NORTH_SOUTH 2
GPGGA_LONGITUDE 3
GPGGA_EAST_WEST 4
GPGGA_QUALITY 5
GPGGA_SATELLITES 6
GPGGA_HDOP 7
GPGGA_ALTITUDE 8
GPGGA_ALT_UNITS 9
GPGGA_GEOID 10
GPGGA_AGE 11
GPGGA_GEO_UNITS 12
GPGGA_GEO_REF_ID 13
GPGGA_CHECKSUM 14
GPGLL_LATITUDE 0
GPGLL_NORTH_SOUTH 1
GPGLL_LONGITUDE 2
GPGLL_EAST_WEST 3
GPGLL_FIX 4
GPGLL_VALIDITY 5
GPGSV_NUMBER_SATS 0
GPGSV_SENTENCE_NBR 1
GPGSV_SATS_IN_VIEW 2
GPGSV_SAT_NUMBER_1 3
GPGSV_ELEVATION_1 4
GPGSV_AZIMUTH_1 5
GPGSV_SIGNAL_1 6
GPGSV_SAT_NUMBER_2 7
GPGSV_ELEVATION_2 8
GPGSV_AZIMUTH_2 9
GPGSV_SIGNAL_2 10
GPGSV_SAT_NUMBER_3 11
GPGSV_ELEVATION_3 12
GPGSV_AZIMUTH_3 13
GPGSV_SIGNAL_3 14
GPGSV_SAT_NUMBER_4 15
GPGSV_ELEVATION_4 16
GPGSV_AZIMUTH_4 17
GPGSV_SIGNAL_4 18
[NAME] [VALUE] [FUNCTION]
WSC_NO_DATA -200100 No data available.
WSC_RANGE -200100 Parameter not in legal range.
WSC_ABORTED -200102 Internal checksum error.
WSC_WIN32ERR -200103 Win32 API error.
WSC_BUFFERS -200105 Cannot allocate dynamic memory.
WSC_THREAD -200106 Cannot start Win32 thread.
WSC_IE_BADID -1 Bad port ID.
WSC_IE_OPEN -2 Port already open.
WSC_IE_NOPEN -3 Port not open.
WSC_IE_MEMORY -4 Dynamic memory error.
WSC_IE_DEFAULT -5 Error in default parameters.
WSC_IE_HARDWARE -10 Hardware error.
WSC_IE_BYTESIZE -11 Byte size not supported.
WSC_IE_BAUDRATE -12 Baud rate not supported.
[NAME] [VALUE] [FUNCTION]
MGC_PORT_ALREADY_OPEN -20000001 Port is already open.
MGC_PORT_NOT_OPEN -20000002 Port is not open.
MGC_CANNOT_START_THREAD -20000003 Error starting thread.
MGC_NO_SUCH_FIELD -20000004 No such field.
MGC_NO_SUCH_PARAMETER -20000005 No such parameter.
MGC_NO_SUCH_SENTENCE -20000006 No such sentence type.
MGC_BAD_DIGIT -20000007 Bad digit found.
MGC_NO_DATA -20000008 No data is available.
MGC_NO_SUCH_UNIT -20000009 No such unit.
MGC_ABORTED -20000010 MGC aborted.
MGC_BUFFER_TOO_SMALL -20000011 Buffer too small for data.
MGC_EXPIRED -20000012 Evaluation version expired.
MGC_CANNOT_ATTACH -20000013 Cannot attach MGC.
MGC_ALREADY_ATTACHED -20000014 MGC already attached.
MGC_NOT_ATTACHED -20000015 MGC not attached.