beautypg.com

Campbell Scientific CR23X Micrologger User Manual

Page 260

background image

APPENDIX B. CONTROL PORT SERIAL I/O INSTRUCTION 15

B-16

07:

13

Input termination character

Terminate on carriage return

08:

75

Max characters to receive

09:

200

Delay for CTS/input

Wait 2 seconds for input

10:

11

First input location

Store VALUE #1 in Location 11, #10 in 20

11:

1

Multiplier

12:

0.0000

Offset

03:

P95

End

Input Location Labels:

11:VALUE #1

16:VALUE #6

12:VALUE #2

17:VALUE #7

13:VALUE #3

18:VALUE #8

14:VALUE #4

19:VALUE #9

15:VALUE #5

20:VALUE #10

Program Example # 3

This program will decode the $GPGGA and $GPVTG strings, format them in input locations, and set the
CR23X clock according to the GPS time. The primary reason for formatting the data strings is to parse
long data strings into multiple input locations. The CR23X can display 5 significant digits. The
maximum value that can be displayed in an input location is 99999. Data in the GPS string is anywhere
from 1 to 8 characters. Data fields such as time has 6 digits (i.e. HHMMSS) and will exceed the 99999
input location value limit. To get around this problem, data will be parsed and separated into individual
input locations.

If the GPS receiver is to be used to keep the CR23X clock updated (via P114) caution should be used
when pulse count type measurements (i.e. wind speed, velocity) are made. This can increase or
decrease the total number of counts based on if the datalogger clock was slow or fast. The program
code below can be put into a conditional type statement (P92, P95) to be executed on an less frequent
interval rather than once per second (i.e. once per day).

CR23X#3 PROGRAM EXAMPLE

*Table 1 Program

01:

1

Execution Interval (seconds)

; LOOK FOR $GPGGA AND $GPVTG STRINGS

; READ IN SERIAL GPS DATA VIA NULL MODEM AND
; CR23X 9-PIN RS-232 PORT

01:

Port Serial I/O (P15)
1:

1

Reps

2:

03

Configuration Code

;RS-232 ASCII, 4800 BAUD

3:

1

Delay (0.01 seconds)

4:

9

RS-232 Port

;GET GPS DATA VIA CSI 9-PIN RS-232

PORT

5:

1

Output Loc [ HOUR_MIN ]

6:

0

No. of Locs to Send

7:

42

Termination Character

;ASTERISK *

8:

100

Maximum Characters

;GGA + VTG CHARACTERS

9:

100

CTS/Input Wait

10:

27

Loc [ RAW_TIME ]

11:

1.0

Mult