Appendix B. Example Programs
B-4
B.2 CS700H Example Programs
B.2.1 CR6 Program for the CS700H
In the following CR6 program, the CS700H is connected to
U1
, and the rain
measurements are reported in inches. This program does not retrieve real-time
status information using the SDI-12 protocol. An example program that
retrieves status information is provided in Appendix
(p. B-5)
CRBasic Example B-4. CR6 Program Measuring the CS700H
'Program measures one CS700H
'Wiring Diagram
'==============
'CS700H
'Wire
'Color Function Terminal
'----- -------- --------
'Black Rain signal U1
'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 Data Logger Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp
(PTemp_C,60)
'CS700H Rain Gage measurement Rain_in
PulseCount
(Rain_in,1,U1,1,0,0.01,0)
'Call Data Tables and Store Data
CallTable
OneMin
CallTable
OneDay
NextScan
EndProg