Garmin GPS 17HVS Technical Specifications - Page 30

APPENDIX C: EPHEMERIS DATA DOWNLOAD (PROGRAMMING EXAMPLE), Synopsis, Garmin Binary Format Review - reviews

Page 30 highlights

APPENDIX C: EPHEMERIS DATA DOWNLOAD (PROGRAMMING EXAMPLE) Synopsis This section describes, using an example, how to download ephemeris information from a Garmin 15, 16, 17 or 18 family GPS unit with the exception of the GPS 15-W and the GPS 15-F. Garmin Binary Format Review To download the ephemeris data, you must first command the unit to output information in Garmin Binary Format (Garmin mode) instead of the default NMEA output format. To put the unit in Garmin mode, connect to the unit using a terminal program and send the following NMEA sentence: $PGRMO,,G*hh The checksum *hh is used for parity checking data and generally is not required in normal PC environments, but is recommended for use in environments containing high electromagnetic noise. When used, the parity bytes (hh) are the ASCII representation of the exclusive-or (XOR) sum of all the characters between the "$" and "*" characters, non-inclusive. Sentences may be truncated by after any data field and valid fields up to that point will be acted on by the GPS sensor. See Section 4 Software Interface. The unit will stay in Garmin mode until the next power cycle. Now that unit is in Garmin binary format, transmitted and received packets are structured as follows: Byte Description Packet Delimiter Packet ID (type) Data Size Data bytes . . . Checksum Packet Delimiter End of Packet Name DLE ID SIZE DATA . . . CHKSUM Notes 0x10 Packet type Number of bytes in data portion(not including escaped DLEs. See below) Not to exceed 256 bytes . . . 2's complement of the arithmetic sum of all the bytes from the Packet ID byte to the last DATA byte(inclusive) not counting escaped DLEs. See below DLE 0x10 ETX 0x03 The DLE (0x10) is a delimiter byte used in conjunction with the ETX byte to determine beginning and ending of a packet. However, a 0x10 could appear in the data itself; if this occurs, the byte is escaped with another DLE byte (sometimes referred to as DLE stuffing). In other words, if a DLE occurs in the data, another DLE is transmitted immediately after to indicate that it is a data byte and it is not being used as a delimiter. Note that the size byte of the packet does not count the second DLE byte in an escaped DLE pair in the data field. Since a DLE that is a part of the data will have a second DLE to escape it, a single DLE followed by an ETX byte means that the end of a packet has been reached. In order to interpret these packets properly, one must remove the escaped DLE bytes. This can be achieved using an algorithm similar to the Sample C Code fragment on the previous page. 190-00228-21 GPS 16/17 Technical Specifications Page 26 Rev. A

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

190-00228-21
GPS 16/17 Technical Specifications
Rev. A
Page 26
APPENDIX C: EPHEMERIS DATA DOWNLOAD (PROGRAMMING EXAMPLE)
Synopsis
This section describes, using an example, how to download ephemeris information from a Garmin 15, 16, 17 or 18
family GPS unit with the exception of the GPS 15-W and the GPS 15-F.
Garmin Binary Format Review
To download the ephemeris data, you must first command the unit to output information in Garmin Binary Format
(Garmin mode) instead of the default NMEA output format. To put the unit in Garmin mode, connect to the unit
using a terminal program and send the following NMEA sentence: $PGRMO,,G*hh<CR><LF>
The checksum *hh is used for parity checking data and generally is not required in normal PC environments, but is
recommended for use in environments containing high electromagnetic noise. When used, the parity bytes (hh) are
the ASCII representation of the exclusive-or (XOR) sum of all the characters between the “$” and “*” characters,
non-inclusive. Sentences may be truncated by <CR><LF> after any data field and valid fields up to that point will
be acted on by the GPS sensor. See Section
4 Software Interface.
The unit will stay in Garmin mode until the next
power cycle.
Now that unit is in Garmin binary format, transmitted and received packets are structured as follows:
Byte Description
Name
Notes
Packet Delimiter
DLE
0x10
Packet ID (type)
ID
Packet type
Data Size
SIZE
Number of bytes in data portion(not
including escaped DLEs. See below)
Data bytes
DATA
Not to exceed 256 bytes
.
.
.
.
.
.
.
.
.
Checksum
CHKSUM
2’s complement of the arithmetic sum of
all the bytes from the Packet ID byte to
the last DATA byte(inclusive) not
counting escaped DLEs. See below
Packet Delimiter
DLE
0x10
End of Packet
ETX
0x03
The DLE (0x10) is a delimiter byte used in conjunction with the ETX byte to determine beginning and ending of a
packet. However, a 0x10 could appear in the data itself; if this occurs, the byte is escaped with another DLE byte
(sometimes referred to as DLE stuffing). In other words, if a DLE occurs in the data, another DLE is transmitted
immediately after to indicate that it is a data byte and it is not being used as a delimiter. Note that the size byte of the
packet does not count the second DLE byte in an escaped DLE pair in the data field. Since a DLE that is a part of
the data will have a second DLE to escape it, a single DLE followed by an ETX byte means that the end of a packet
has been reached.
In order to interpret these packets properly, one must remove the escaped DLE bytes. This can be achieved using an
algorithm similar to the
Sample C Code
fragment on the previous page.