Campbell Scientific SR50-L CSC Ultrasonic Distance Sensor User Manual

Page 34

Advertising
background image

Appendix A. Making Concurrent Measurements with the SR50

A-

2

Place measurement in Loc X.
If measurement is > -1000 then use measurement
Else
Add 1 to a counter

If the counter = 3 (means there were 3 bad readings in a row) then do:
Use bad reading for measurement.
Reset counter.

Example Program:

In this example, an SR50 is mounted 2 meters above the ground. Snow depth
and measurement quality numbers are the desired output. This program uses
Instruction 105 (refer to Section 9 in the CR10X manual for details on P105
SDI-Recorder Instruction) to obtain a distance measurement from the SR50.
The SR50’s address is 0. It is assumed that a Campbell Scientific 107
Temperature Probe is being used and that the SR50 SDI-12/DATA Bus line
(green wire) is wired to control port 1(see Figure 2, page 6 for wiring
diagram).

;{CR10X}
;

*Table 1 Program
01: 5

Execution

Interval

(seconds)


1: Temp (107) (P11)

; Measure air temperature

1: 1

Reps

2: 1

SE

Channel

3: 1

Excite all reps w/E1

4: 1

Loc [ AIR_TEMP ]

5: 1

Mult

6: 0

Offset


2: Z=X+F (P34)

; Convert Celsius reading to Kelvin

1: 1

X Loc [ AIR_TEMP ]

2: 273.15 F
3: 2

Z Loc [ T_KELVIN ]


; Measure the SR50 using Concurrent Measurement ability...
3: SDI-12 Recorder (P105)
1: 0

SDI-12

Address

2: 1 --

Start Measurement (aM1!)

; <<<< Configured to provide distance with

3: 1

Port

; echo quality numbers and do concurrent measurement

4: 3

Loc [ Raw_Dist ]

5: -1.0

Mult

6: 0.0

Offset

; Check to see if a valid measurement has been returned, and if it has, move
; the measurement to another Input Location to be used as data and reset the
; failure counter.

Advertising