'CR1000 Series Datalogger 'date: May 7, 2008 'program author: Colin Campbell const TE_Num = 2 'change this constant for the number of 5TE probes you are reading '4 is the maximum number of 5TE probes readable without a multiplexer const eb0 = 6 'empirical constant loosely representing the dielectric of dry soil Public PTemp, batt_volt Public TEout(4,1) as string * 32 Public Pos_RawEb(TE_Num) as LONG Public Pos_RawEC(TE_Num) as LONG Public Pos_RawT(TE_Num) as LONG Public RawEb(TE_Num) as LONG,RawEC(TE_Num) as FLOAT,RawT(TE_Num) as LONG Public VWCm(TE_Num) as FLOAT,VWCp(TE_Num) as FLOAT ' VWCm for mineral soil, VWCp for potting soil public Temp(TE_Num) as FLOAT Public Eb(TE_Num) as float, ep(TE_Num) as float 'Eb is bulk dielectric and ep is the 'dielectric of the pore water Public ECb(TE_Num) as float ' this is bulk dielectric measured by the TE Public ECp(TE_Num) as float ' this is the pore water dielectric estimated by public x, i as float 'PROBE WIRING 'CR1000 ECHO TE 'SW12V ALL WHITE (EXCITATION) WIRES 'C2 TE #1 OUTPUT (RED) WIRE 'C4 TE #2 OUTPUT (RED) WIRE 'C6 TE #3 OUTPUT (RED) WIRE 'C8 TE #4 OUTPUT (RED) WIRE 'GND ALL BARE (GND) WIRES 'Define Data Tables ' Please setup data output to suit individual needs. You may want to save raw data as ' well as calculated values DataTable (TEData,1,-1) DataInterval (0,1,Min,0) sample (TE_Num,VWCm(),FP2) Sample (TE_Num,ECb(),FP2) sample (TE_Num,Temp(),FP2) EndTable SequentialMode 'Main Program BeginProg serialopen (Com1,1200,19,0,10000) serialopen(com2,1200,19,0,10000) serialopen(com3,1200,19,0,10000) serialopen(Com4,1200,19,0,10000) Scan (30,Sec,0,0) PanelTemp (PTemp,250) Battery (Batt_volt) ' delay (0,30,mSec) serialflush (Com1) serialflush (Com2) Serialflush(Com3) serialflush(Com4) Delay (0,1,Sec) portset (9,1) Delay (0,1,Sec) serialin (TEout(1),Com1,100,0,13) serialin (TEout(2),Com2,100,0,13) serialin (TEout(3),Com3,100,0,13) serialin (TEout(4),Com4,100,0,13) for i = 1 to TE_Num if TEout(i) <> "" then Pos_RawEb(i) = InStr (1,TEout(i),"String",0) Pos_RawEC(i) = Instr(Pos_RawEb(i) ,TEout(i),CHR(32),2)+1 Pos_RawT(i) = Instr(Pos_RawEC(i),TEout(i),CHR(32),2)+1 RawEb(i)=mid (TEout(i),Pos_RawEb(i),Pos_RawEC(i)-Pos_RawEb(i)) RawEC(i)=mid (TEout(i),Pos_RawEC(i),Pos_RawT(i)-Pos_RawEC(i)) RawT(i)=mid (TEout(i),Pos_RawT(i),3) Temp(i)= (RawT(i)-400)/10 Eb(i) = 2*RawEb(i)/100 VWCm(i)= -5.3e-2+2.92e-2*Eb(i)-5.5e-4*Eb(i)^2+4.3e-6*Eb(i)^3 ' Topp et al. (1980) ECb(i) = RawEC(i)/100 'Bulk electrical conductivity ep(i) = 80.3 - 0.37*(Temp(i)- 20) if Eb(i) > 6 then ECp(i) = (ep(i)*ECb(i))/(Eb(i)-Eb0) else ECp(i) = ECb(i) endif else TEout(i) = "No Probe" endif next i portset(9,0) calltable (TEData) NextScan EndProg