Appendix B. Example Programs
B-5
B.2.2 CR1000X Programs for CS700H
This section includes two CR1000X programs that measure the CS700H heated
tipping bucket rain gage. Both programs measure precipitation (mm), battery
voltage, and panel temperature. The second program also retrieves real time
status information by using SDI-12 protocol.
CRBasic Example B-5. CR1000X Program Measuring the CS700H
'Program measures one CS700H
'Wiring Diagram
'==============
'CS700H
'Wire
'Color Function Terminal
'----- -------- --------
'Black Rain signal P1
'White Rain signal ground Ground Symbol
'Clear Shield Ground Symbol
'Declare Variables and Units
Public
BattV
Public
PTemp_C
Public
Rain_in
Units
BattV = Volts
Units
PTemp_C = Deg C
Units
Rain_in = inch
'Define Data Tables
DataTable
(OneMin,True,-1)
DataInterval
(0,1,Min,10)
Totalize
(1,Rain_in,FP2,False)
EndTable
DataTable
(OneDay,True,-1)
DataInterval
(0,1440,Min,10)
Minimum
(1,BattV,FP2,False,False)
Totalize
(1,Rain_in,FP2,False)
EndTable
'Main Program
BeginProg
Scan
(5,Sec,1,0)
'Default Data Logger Battery Voltage measurement BattV
Battery
(BattV)
'Default CR1000 Data Logger Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp
(PTemp_C,_60Hz)
'CS700H Rain Gage measurement Rain_in
PulseCount
(Rain_in,1,P1,1,0,0.01,0)
'Call Data Tables and Store Data
CallTable
OneMin
CallTable
OneDay
NextScan
EndProg
The CS700H will only communicate over SDI-12 when both
its sensor cable and power cable are connected (TABLE
CAUTION