'CR3000 ' *****MULTIPLEXER SHOULD BE SET IN 4 X 16 MODE ***** 'Declare Variables and Units Dim LCount_3 Public Batt_Volt const TE_Num = 1 '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 Public TEout(TE_Num,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 float,RawEC(TE_Num) as FLOAT,RawT(TE_Num) as float 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 as long, i as float, j as float ' incrmenting integers public AM1632_Ports as float Units Batt_Volt=Volts 'AM16/32 Multiplexer WiringIs 'AM1632 CR3000 'COM ODD H SW 12V-1 'COM ODD L C4 (COM 2 RX) 'COM EVEN H C6 (COM 3 RX) 'COM EVEN L C8 (COM 4 RX) 'RES C1 'CLK C2 'GND G 'COM Ground G '12 V 12 V 'ECHO-TE WIRING 'AM1632 TE PROBE '1 H ALL 3 WHITE (EXITATION) WIRES (3 TE PROBES) '1 L PROBE 1 RED (OUTPUT) WIRE '2 H PROBE 2 RED (OUTPUT) WIRE '2 L PROBE 3 RED (OUTPUT) WIRE 'GND ALL 3 BARE (GND) WIRES (3 TE PROBES) '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,15,Min,0) sample (TE_Num,VWCm(),FP2) Sample (TE_Num,ECp(),FP2) sample (TE_Num,Temp(),FP2) EndTable ' This program MUST be run in sequential mode SequentialMode 'Main Program BeginProg If TE_Num mod 3 <>0 then AM1632_Ports = int(TE_Num/3) + 1 else AM1632_Ports = TE_Num/3 'AM1632_Ports = 2'(TE_Num/3) - (TE_Num mod 3) + 1 serialopen (Com2,1200,19,0,10000) serialopen(com3,1200,19,0,10000) serialopen(com4,1200,19,0,10000) ' THIS SCAN SHOULD BE SET AS A MULTIPLE OF THE # OF TE PROBES YOU ARE MEASURING ' i.e. if you are measuring 20 TE probes, you should set scan to 20 * 3 = 60 s Scan(30,Sec,1,0) 'Default Datalogger Battery Voltage measurement Batt_Volt: Battery(Batt_Volt) 'Turn AM16/32 Multiplexer On PortSet(1,1) 'Switch SW12 V port on portset (9,1 ) for i = 0 to AM1632_Ports-1 'Switch to next AM416 Multiplexer channel PulsePort(2,10000) 'delay (0,10,mSec) 'Clear com ports of any erroneous characters generated when turning TE on serialflush (Com2) serialflush (Com3) Serialflush(Com4) 'Wait for serial data to come into com ports Delay (0,1,Sec) 'ECHO Probe EC-TE measurement on the AM16/32 Multiplexer: serialin (TEout(i*3 +1),Com2,10,0,1000) serialin (TEout((i*3) + 2),Com3,10,0,1000) serialin (TEout((i * 3) + 3 ),Com4,10,0,1000) next i 'Turn off power to switched 12 V port portset(9,0) 'Turn AM16/32 Multiplexer Off PortSet(1,0) for j = 1 to TE_Num if TEout(j) <> "" then Pos_RawVWC(j) = InStr (1,TEout(j),"String",0) Pos_RawEC(j) = Instr(Pos_RawVWC(j) ,TEout(j),CHR(32),2)+1 Pos_RawT(j) = Instr(Pos_RawEC(j),TEout(j),CHR(32),2)+1 RawVWC(j)=mid (TEout(j),Pos_RawVWC(j),Pos_RawEC(j)-Pos_RawVWC(j)) RawEC(j)=mid (TEout(j),Pos_RawEC(j),Pos_RawT(j)-Pos_RawEC(j)) RawT(j)=mid (TEout(j),Pos_RawT(j),3) Temp(j)= (RawT(j)-400)/10 VWCm(j)= RawVWC(j)*.00109 - .629 ' Use for mineral soil VWCp(j)= 0.00104*RawVWC(j)-.499 ' Use for potting soil eb(j) = 7.64E-8*RawVWC(j)^3 - 8.85E-5*RawVWC(j)^2 +4.85E-02*RawVWC(j)-10 ep(j) = 80.3 - 0.37*(Temp(j)- 20) if VWCm(j) > 0.10 then ECp(j) = (ep(j)*ECb(j))/(eb(j)-eb0) else ECp(j) = ECb(j) endif else TEout(j) = "No Probe" endif next j 'Call Data Tables and Store Data CallTable(TEData) NextScan EndProg