B.6 program examples – Campbell Scientific CR10X Measurement and Control System User Manual
Page 240

APPENDIX B. CONTROL PORT SERIAL I/O INSTRUCTION 15
B-8
The following program example will read-in the GGA and VTG GPS strings. Since this program is
unique to the GPS application, additional data processing will be required to decode and format these
strings. See Program Example #3 for a complete listing.
The following is a section of a datalogger program that uses Instruction 15 to read in data from a GPS
receiver. This program uses a filter for reading in the GGA and VTG strings. The GGA strings include
time, position and fix related data for the GPS receiver; the VTG strings convey the actual track made
good and the speed relative to the ground. Additional data processing is required to completely decode
and format these strings.
06: Port Serial I/O (P15)
01:
1
Reps
02:
1
Configuration Code; RS-232 ASCII, 1200 baud
03:
1
Delay (0.01 seconds)
04:
7
C7 RTS/DTR ; C8 RXD (code could be 78)
05:
0
Output Loc [ ________ ]
06:
0
no. of Locs to Send
07:
42
Termination Character; asterisk (*)
08:
100
Maximum Characters; GGA + VTG characters
09:
100
CTS/Input Wait
10:
27
Loc [ RAW_TIME] ; Input Location of first received byte
11:
1.0
Mult
12:
0.0
Offset
; Configure and load input filter strings
07: Variable Parameter (P63) or (P68)
01:
36
Option; $
02:
71
Option; G
03:
80
Option; P
04:
71
Option; G
05
71
Option; G
06:
65
Option; A
07:
0
Option; END OF STRING 1
08:
36
Option; $
08: Variable Parameter (P63) or (P68)
01:
71
Option; G
02:
80
Option; P
03:
86
Option; V
04:
84
Option; T
05
71
Option; G
06:
0
Option; end of string 2
07:
0
Option;
08:
0
Option;
B.6 PROGRAM EXAMPLES
The following examples represent portions of a
larger, more complete application program, and
SHOULD NOT BE USED VERBATIM.
B.6.1 EXAMPLE 1: ATMOSPHERIC
INSTRUMENTS RESEARCH AIR-DB-1A
BAROMETER
Various barometer functions (mode, units of
output, baud rate, etc.) are determined by
jumpers internal to the barometer. A summary
of the jumper configurations is found in Section
B6. Detailed instructions for jumper placement