B.2.5.1 cr23x example program – Campbell Scientific GPS16X-HVS GPS Receiver User Manual
Page 30

Appendix B. CR23X Wiring and Programming
B.2.5.1 CR23X Example Program
;{CR23X}
;
*Table 1 Program
01: 60
Execution Interval (seconds)
; Instruction to eliminate warning about unused subroutine, not needed
1: If Flag/Port (P91)
1: 11
Do if Flag 1 is High
2: 98
Call Subroutine 98
*Table 2 Program
02: 0.0000 Execution Interval (seconds)
*Table 3 Subroutines
1: Beginning of Subroutine (P85)
1: 98
Subroutine 98
;--- read serial data non-buffered
2: Port Serial I/O (P15)
1: 1
Reps
2: 66 --
RS-232 ASCII (decimal delimiter), 38400 Baud
3: 1
Delay (0.01 sec units) before TX
4: 5
No RTS/DTR, C5 TXD/RXD
5: 1
Start Loc for TX [ Raw_Time ]
6: 0
Number of Locs to TX
7: 42
Termination Character for RX
8: 100
RX Buffer Size or Max Chars to RX if Par 2 indexed (--)
9: 80
Time Out for CTS (TX) and/or RX (0.01 sec units)
10: 1
Start Loc for RX [ Raw_Time ]
11: 1.0
Mult for RX
12: 0.0
Offset for RX
;--- filter for $GPGGA
3: Extended Parameters (P63)
1: 36
Option ;$
2: 71
Option ;G
3: 80
Option ;P
4: 71
Option ;G
5: 71
Option ;G
6: 65
Option ;A
7: 0
Option
8: 0
Option
; Test for valid GPS fix and string read
4: If (X<=>F) (P89)
1: 6
X Loc [ Quality ]
2: 3
>=
3: 1
F
4: 30
Then Do
; Make a copy of time
5: Z=X (P31)
1: 1
X Loc [ Raw_Time ]
2: 18
Z Loc [ Orig_TM ]
; Add 0.45 to time stamp to eliminate complications with
; floating point math, P44, and P45
6: Z=X+F (P34)
1: 18
X Loc [ Orig_TM ]
2: 0.45
F
3: 18
Z Loc [ Orig_TM ]
B-6