Campbell TDR100 Instruction Manual - page 44
Appendix B. Example Program
B-2
'CR1000 Series Datalogger
'program: c:\mydoc\cr1000\cr1000-testing\TDR&SDM&F1&Wave_CR1K.CR1
'Measure and Record Analog Measurements, Volumetric Water Content, & Store Waveforms
'
'Declare Public & Dim Variables ------------------------------------
Public batt_volt
Public Panel_temp
Public LaL(8)
Public LaL2(8)
Public LedieuVWC(8)
Public ToppVWC(8)
Public Flag(2)
Dim WavePT(260)
'To conserve datalogger memory, use Dim
instead of Public for waveform data points.
public MuxChan
Dim I
'Declare Constants ------------------------------------------------
'Topp Equation Dielectric Constants
const a0= -0.053
const a1= 0.0292
const a2= -0.00055
const a3= 0.0000043
I
const high = true
const low = false
'Define Data Tables ----------------------------------------------
DataTable (Dat15min,1,-1)
'15-minute Data Table (i.e. Analog Measurements)
DataInterval (0,15,Min,10)
Minimum (1,batt_volt,IEEE4,0,False)
Average (1,Panel_temp,IEEE4,0)
EndTable
DataTable (Data_TDR,1,-1)
'2-Hour Data Table (i.e. TDR100 VWC Measurements)
DataInterval (0,120,Min,10)
Minimum (1,batt_volt,IEEE4,0,False)
Average (1,Panel_temp,IEEE4,0)
Sample (8,LaL(),IEEE4)
sample (8,LedieuVWC(),FP2)
sample (8,ToppVWC(),FP2)
EndTable
'
DataTable (TDR_Wave,1,240)
'Data Table (i.e. Capture TDR Probe Waveforms)
sample (1,MuxChan,IEEE4)
sample (260,WavePT(),FP2)
EndTable
'Note: The DataTable "TDR_Wave" data storage area is NOT and should NOT be auto allocated
'in this program example!!! Therefore, "TDR_Wave" memory storage size should be allocated
'by the programmer. How to calculate memory storage size?
'Example: In this program when F2 goes high there are 8ea calls to "TDR_Wave", repeated
'let's say 30 times, will allocate memory for 240 waveforms. "DataTable (TDR_Wave,1,240)"
'
'Main Program ---------------------------------------------------
BeginProg
SDMSpeed (50)
'Fix TDR100 to CR1K communication timing
'
Scan (5,Sec,0,0)
'scan instructions every 5 sec
Battery (Batt_volt)
PanelTemp (Panel_temp,250)
CallTable Dat15min
'
'Set flag 1 High every 120 minutes (Note: User can manually set flag 1 high/low)
If TimeIntoInterval(0,2,Hr) Then Flag(1)=High
'Set flag 2 High once per day (Note: User can manually set flag 2 high/low)
If TimeIntoInterval(0,24,Hr) then flag(2)=high '