| Field | Example | Comment |
| Sentence ID | $DPTG2 | Sentence identifier |
| Date | 2003/01/15 | date in format yyyy/mm/dd |
| Time | 20:35:02 | Time in format hh:mm:ss |
| TCS ID | TCS-GPS-01 | TCS board identifier (user programmable) 10 characters |
| smsc | 517 | Counter of SMS that have been sent (4 digits) |
| si | 30 | Sampling interval in seconds |
| Latitude | 4413.5589 | Latitude in degrees, minutes and 1/10000 of a minute ( i.e. 44º 13.5589 ' ) |
| N/S Indicator | N | North South emisphere indicator |
| Longitude | 048.0984 | Longitude in degrees, minutes and 1/10000 of a minute ( i.e. 0º 48.0984' ) |
| E/W Indicator | E | East west of Greenwich indicator |
| Altitude | 33.0 | Altitude over sea level in meters |
| Ground speed | 0.00 | Speed over ground in Km/h |
| Satellites used | 8 | Number of satellites received and used to compute position (maximum 12) |
| Input 1 | 0 | Logic status of input 1 (TTL) |
| Mark | M | |
| Output 1 | 0 | Logic status of Output 1 |
| void | void,future use | |
| Heading | 93 | Heading degrees |
| void | void for future use | |
| void | void for future use | |
| void | void for future use | |
| Accel. Axis X | 12 | X max acceleration value range 0-255 |
| Accel. Axis Y | 35 | Y max acceleration value range 0-255 |
| Analog input | 1 | Analog input value (from 8 bit ADC) range 0-255 |
| powtype | E | Power supply type: E=external, B=backup batteries |
| battlev | 12.2 | Backup battery voltage level |
| checksum | *3A | packet checksum |
|
|
|
Q. How is the checksum calculated in NMEA 0183? A. The checksum is the 8-bit exclusive OR (no start or stop bits) of all characters in the sentence, including the "," delimiters, between -- but not including -- the "$" and "*" delimiters. The hexadecimal value of the most significant and least significant 4 bits of the result are converted to two ASCII characters (0-9, A-F) for transmission. The most significant character is transmitted first. Below is the Visual Basic code to calculate the checksum value for the NMEA sentence Private Function GetChecksum(ByRef sInString As String) As String Dim lCurrent&, lLast& On Error Resume Next '-- We don't use the $ in the checksum If Mid$(sInString, 1, 1) = "$" Then sInString = Mid$(sInString, 2) End If '-- Get the ASC of the first Char lLast& = Asc(Mid$(sInString, 1, 1)) '-- Use a loop to Xor through the string For lCurrent& = 2 To Len(sInString) lLast& = lLast& Xor Asc(Mid$(sInString, lCurrent&, 1)) Next '-- Pass the data back as a string GetChecksum = CStr(Hex(lLast&)) End Function Example in C char cNMEA_Checksum(char *st){ char sum = 0; int i; i = strlen(++st) - 1; //Skip '$' e '*' while(i){ sum ^= *st++; i--; } return sum; } |