Appendix B. Example Programs
B-2
B.1.2 CR1000X Programs for the TB4 or CS700
This section includes two CR1000X programs. In the first program, the rain
gage is connected to
P1
, and the rain measurements are reported in inches.
Battery voltage and panel temperature are also measured. In the second
program, the rain gage is connected to
C1
, and the rain measurements are
reported in millimeters.
CRBasic Example B-2. CR1000X Program Using a Pulse Terminal to Measure the TB4 or
CS700
'Program measures one TB4 or CS700
'Wiring Diagram
'==============
'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 CR1000X Data Logger Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp
(PTemp_C,60)
'CS700 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