beautypg.com

2 example cr10(x) program, Example cr10(x) program – Campbell Scientific 227-L Delmhorst Cylindrical Soil Moisture Block User Manual

Page 19

background image

227 Delmhorst Cylindrical Soil Moisture Block

'CR1000

'Declare Variables and Units
Public Batt_Volt
Public Rs_kOhm

Public WP_kPa

Units Batt_Volt=Volts

Units Rs_kOhm=kOhms
Units WP_kPa=kPa

'Define Data Tables
DataTable(Table1,True,-1)

DataInterval(0,60,Min,10)
Sample(1,Rs_kOhm,FP2)
EndTable


DataTable(Table2,True,-1)
DataInterval(0,1440,Min,10)

Minimum(1,Batt_Volt,FP2,False,False)
EndTable

'Main Program
BeginProg
Scan(5,Sec,1,0)

'Default Datalogger Battery Voltage measurement Batt_Volt:
Battery(Batt_Volt)

'227 Soil Moisture Block measurements Rs_kOhm and WP_kPa:
BrHalf(Rs_kOhm,1,mV250,1,Vx1,1,250,True,0,250,1,0)
Rs_kOhm=Rs_kOhm/(1-Rs_kOhm)

If Rs_kOhm<17 Then
WP_kPa=Rs_kOhm*0.1
WP_kPa=0.15836+(6.1445*WP_kPa)+(-8.4189*WP_kPa^2)+(9.2493*WP_kPa^3)+

(-3.1685*WP_kPa^4)+(0.33392*WP_kPa^5)
WP_kPa=WP_kPa*100
Else

WP_kPa=1000
EndIf
'Call Data Tables and Store Data

CallTable(Table1)
CallTable(Table2)

NextScan
EndProg

7.2.4.2 Example CR10(X) Program

This program example is intended to be a portion of a larger program with
instructions that are executed at a 10 second interval. It is a CR10X program
but other Edlog dataloggers are programmed similarly.

The 227 sensor is measured with Measurement Instruction (5). The Bridge
Transform Instruction (59)
uses the result of Instruction 5 (V

s

/ V

x

) to

generate R

s

in kohms. If R

s

is less than 17 kohms, soil water potential is

generated using the polynomial. If R

s

is greater than 17 kohms, the overrange

indicator –99999 is loaded into the water potential location.

Every 6 hours the time (day, hour, minute), sensor resistance, and calculated
water potential are output.

13