'CR1000X Series Datalogger 'Example datalogger program for Apogee Instruments SO-410 oxygen sensor 'date: July 27, 2016 'Revised: Dec 29, 2020 'program author: Jacob Bingham / John Huber 'Wiring: 'White -> C1 Comm port (SDI12 signal) 'Black -> G port (Ground) 'Red -> Input Power (4.5-24 V DC) 'Clear -> Shield ground 'Before deploying the sensor, please make sure to calibrate it to ambient air using the XAMBR! command. 'Additional information regarding calibration procedures and other calibration commands can be found in the sensor's manual found here : https://www.apogeeinstruments.com/content/SO-400-manual.pdf 'Explanation of Constants and Variables Used in Datalogger Program 'BattV = datalogger battery voltage 'PanelT = datalogger panel temperature 'O2(3) = Array to hold output from SDI12Recorder function; location 1 = calibrated oxygen, location 2 = sensor mV, location 3 = sensor body temperature in degrees C 'O2_Concentration = amount of oxygen in percent or absolute concentration (determined during calibration) 'Sensor_mV = raw mV signal from O2 sensor 'Sensor_TC = sensor body temperature in degrees Celsius 'Declare Public Variables Public BattV, PanelT Public O2(3) 'Rename Variables Alias O2(1) = O2_Concentration Alias O2(2) = Sensor_mV Alias O2(3) = Sensor_TC 'Define Data Tables DataTable (Oxygen,1,-1) DataInterval (0,1,Min,10) Minimum(1,BattV,IEEE4,0,False) Sample(1,PanelT,IEEE4) Average(1,O2_Concentration,IEEE4,False) Average(1,Sensor_mV,IEEE4,False) Average(1,Sensor_TC,IEEE4,False) EndTable 'Main Program BeginProg Scan(5,Sec,0,0) Battery(BattV) PanelTemp(PanelT,_60Hz) 'Measure Surface Temperature SDI12Recorder (O2(),C1,0,"MC!",1.0,0) 'refer to the owner's manual for a list of relevant commands 'Call Output Tables CallTable Oxygen NextScan EndProg