'CR1000 Series Datalogger 'date: February 24, 2006 'program author: Colin Campbell const TE_Num = 2 'change this constant for the number of ECHO TE probes you are reading '4 is the maximum number of TE 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_RawVWC(TE_Num) as LONG Public Pos_RawEC(TE_Num) as LONG Public Pos_RawT(TE_Num) as LONG Public RawVWC(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_RawVWC(i) = InStr (1,TEout(i),"String",0) Pos_RawEC(i) = Instr(Pos_RawVWC(i) ,TEout(i),CHR(32),2)+1 Pos_RawT(i) = Instr(Pos_RawEC(i),TEout(i),CHR(32),2)+1 RawVWC(i)=mid (TEout(i),Pos_RawVWC(i),Pos_RawEC(i)-Pos_RawVWC(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 VWCm(i)= RawVWC(i)*.00109 - .629 ' Use for mineral soil VWCp(i)= 0.00104*RawVWC(i)-.499 ' Use for potting soil ECb(i) = RawEC(i)/100 eb(i) = 7.64E-8*RawVWC(i)^3 - 8.85E-5*RawVWC(i)^2 +4.85E-02*RawVWC(i)-10 ep(i) = 80.3 - 0.37*(Temp(i)- 20) if VWCm(i) > 0.10 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