Appendix C. Example Programs
C-2
'Declare Public and Dim Variables
Public batt_volt
Public Panel_temp
Public Period (8)
Public VWC (8)
Public Flag (1)
Dim I
'Declare Constants
'CS616 Default Calibration Constants
const a0= -0.0663
const a1= -0.0063
const a2= 0.0007
'Flag logic constants
const high = true
const low = false
'Define Data Tables
DataTable (Dat30min,1,-1)
DataInterval (0,30,Min,10)
Minimum (1,batt_volt,IEEE4,0,False)
Average (1,Panel_temp,IEEE4,0)
Sample (8,Period(),FP2)
Sample (8,VWC(),FP2)
EndTable
'Main Program
BeginProg
Scan (5,Sec,0,0)
'scan instructions every 5 sec
Battery (Batt_volt)
PanelTemp (Panel_temp,250)
'
'Set flag 1 High every 30 min (Note: User can manually set flag 1 high/low)
If IfTime (0,30,min) Then flag (1) = high
'+++++++++++++++++++++++++++
If Flag (1) = high Then
'measure 8ea CS616 probes on CR1000
CS616 (Period(1),4,9,7,4,1.0,0)
'measure 4ea CS616 probes, enable w/ C7
CS616 (Period(5),4,13,8,4,1.0,0)
'measure 4ea CS616 probes, enable w/ C8
'
For I=1 to 8
'convert CS616 period to Volumetric Water Content
VWC(I)=a0 + al*Period(I) + a2*Period(I)^2
Next
'
flag(1)= low
'set Flag 1 = Low
'
EndIf
'+++++++++++++++++++++++++++++++
'
CallTable Dat30min
'Call Output Tables
NextScan
EndProg