'CR200/CR200X Series 'Created by Short Cut (3.2) ' 4-14-2017 Changed radio on/off time to every 10 mins at the top of the hour, if quality is less greater than 300 and batt > 12.6 then average 4 readings ' 4-07-2019 removed average of 4 readings, changed to read once, check quality, read 2nd time check quality, if both measurments are bad 0 is the result Const SR50A_HEIGHT = 810 'Declare Variables and Units Dim MinIntoDay Public BattV Public AT Public CS450(2) Public SR50A(2) Public SR50A_1(2) Public SR50_TCDT Public SR50_Level_CM Public SR50_Level_M Public SR50_Level_ft Public SW12State Alias CS450(1)=Level Alias CS450(2)=WT Alias SR50A(1)=SR50_DT Alias SR50A(2)=SR50_Q Alias SR50A_1(1)=SR50_1_DT Alias SR50A_1(2)=SR50_1_Q Units BattV=Volts Units AT=Deg C Units Level=cm Units WT=deg C Units SR50_Level_CM = cm Units SR50_Level_M = m Units SR50_Level_ft = ft 'Define Data Tables DataTable(SagBridg,True,-1) DataInterval(0,15,Min) Average(1,BattV,False) Sample(1,AT) Sample(1,Level) Average(1,Level,False) Sample(1,WT) Average(1,WT,False) Sample(1,SR50_DT) Sample(1,SR50_Q) Sample(1,SR50_TCDT) Sample(1,SR50_Level_CM) Sample(1,SR50_Level_M) Sample(1,SR50_Level_ft) Average(1,SR50_Level_CM,False) Average(1,SR50_Level_M,False) Average(1,SR50_Level_ft,False) EndTable 'Main Program BeginProg 'Main Scan Scan(300,Sec) 'Default CR200 Series Datalogger Battery Voltage measurement 'BattV' Battery(BattV) '109 Temperature Probe measurement 'AT' Therm109(AT,1,1,1,1,0) 'CS450/CS451/CS455/CS456 Pressure Transducer measurements 'Level' and 'WT' ' SDI12Recorder(Level,"0M1!",1,0) ' Level=Level*70.307 'SR50A Sonic Ranging Sensor (SDI-12 Output) measurements 'SR50_DT', 'SR50_Q', 'SR50_TCDT', and 'SR50_Level' SDI12Recorder(SR50A(),"1M1!",1,0) If (SR50_Q > 211 OR SR50_Q <150 AND BattV > 12.6) Then SDI12Recorder(SR50A_1(),"1M1!",1,0) If (SR50_1_Q > 211 OR SR50_1_Q <150 AND BattV > 12.6) Then SR50_DT = 0 Else SR50_DT = SR50_1_DT SR50_Q = SR50_1_Q EndIf Else SR50_DT = SR50_DT EndIf SR50_DT=SR50_DT*100 SR50_TCDT=SR50_DT*SQR((AT+273.15)/273.15) SR50_Level_CM=SR50A_HEIGHT-SR50_TCDT SR50_Level_M=SR50_Level_CM/100 SR50_Level_ft=SR50_Level_CM*0.0328 'SW12 Timed Control 'Get minutes into current day MinIntoDay=Public.TimeStamp(4,1)/60 'Turn ON SW12 for 10 minutes every 60 minutes If (MinIntoDay MOD 60 < 10) Then SW12State=True Else SW12State=False EndIf 'Always turn OFF SW12 if battery drops below 12.4 volts If BattV<12.4 Then SW12State=False 'Set SW12 to the state of 'SW12State' variable SWBatt(SW12State) 'Call Data Tables and Store Data CallTable SagBridg NextScan EndProg