Appendix C. Example Programs
C-4
'Declare Public and Dim Variables
Public batt_volt
Public Panel_temp
Public Period (48)
Public VWC (48)
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,FP2,0,False)
Average (1,Panel_temp,FP2,0)
Sample (48,Period(),FP2)
Sample (48,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 48ea CS616 probes on AM16/32 in (4x16) mode
PortSet (4,1)
'Set Mux Reset line High
'
I=1
'Set sub scan loop counter
SubScan (0,mSec,16)
PulsePort (5,10000)
'Clock Mux
CS616 (Period(I),3,1,6,3,1.0,0)
'Measure 3ea CS616 probes
I=I+3
NextSubScan
'
For I=1 to 48
'convert CS616 period to Volumetric Water Content
VWC(I)=a0 + al*Period(I) + a2*Period(I)^2
Next
'
PortSet (4,0)
'Set Mux Reset line Low
flag (1) = low
'
EndIf
'+++++++++++++++++++++++++++++++
'
CallTable Dat30min
'Call Output Tables
NextScan
EndProg