Crbasic programming, 1 gps() instruction, Gps() instruction – Campbell Scientific GPS16X-HVS GPS Receiver User Manual
Page 14

GPS16X-HVS GPS Receiver
5. CRBasic Programming
This section describes programming a CR800, CR850, CR1000, or CR3000.
See Appendix B and C for programming other dataloggers.
CRBasic is used to write programs for the CR1000, CR3000, CR800, and
CR850 dataloggers. These dataloggers use several instructions to read GPS
output, which is asynchronous serial data.
5.1 GPS() Instruction
The
GPS() instruction is available for our CR800, CR850, CR1000, and
CR3000 dataloggers. It is used along with a GPS device to set the datalogger's
clock. This instruction will also provide information such as location
(latitude/longitude) and speed, and store NMEA sentences from the GPS
device.
To use the
GPS() instruction, the datalogger operating system
(OS) should be OS17 or higher for the CR1000; OS10 or higher
for the CR3000; or OS08 or higher for the CR800 and CR850. Go
to
OS.
The resolution of accuracy for the clock set is 10 microseconds if the
datalogger has a hardware revision number greater than 007 (RevBoard field in
the datalogger's Status table). Otherwise, resolution is 10 milliseconds. The
clock set relies on information from the GPRMC sentence. If this sentence is
not returned, a clock set will not occur.
By default, the instruction expects the GPS unit to be set up at 38400 baud,
outputting the GPRMC and GPGGA sentences once per second. The
datalogger expects the start of the second to coincide with the rising edge of the
PPS signal. If there is no PPS signal or if the required sentences come out at
less than once per second, the datalogger will not update its clock.
GPS units with lower baud rates can be used with the
GPS() instruction but the
baud rate has to be set for the relevant Com port it is to be connected to either
in the datalogger settings or by including a
SetStatus() command after the
BeginProg() instruction in the program (e.g.,
SetStatus("BaudrateCOM4",19200)).
Baud rates of 2400 bps or lower will not work as the GPS unit will not
transmit the two GPS sentences once per second reliably. Similar problems
can be encountered even at higher baud rates if too many optional GPS strings
are selected to be output.
NOTE
8