I'm trying to read an apogee weighing bucket rain gage (SG-410) from either an CR800 or CR1000X. The rain gauge reads cumulative rainfall (the amount that's in the bucket). I want the data table to record not the total accumulation in the bucket, but the amount of rainfall accumulated during the data table interval (in this case we have a 15-minute and a daily table). Would there be a way to do this?
I actually think I came up with a solution on my own. Here's the program I wrote:
Public Rain_initial
Public Rain(9)
Public Rain_in
Alias Rain(1) = Rain_in_total 'Temp-corrected cum. precip (in), avg. of past minute, incl. tare
Alias Rain(2) = Rain_in_filtered 'Filtered cum precip (in)
Alias Rain(3) = Rain_rate 'Precip rate (inm/hr)
Alias Rain(4) = Rain_rate_filtered 'Filtered precip rate (in/hr)
Alias Rain(5) = Rain_in_cum 'Cum. precip (in), avg. of past minute, does not incl. tare
Alias Rain(6) = Bucket_total 'Bucket total (%)
Alias Rain(7) = Mass 'Mass from load cell (kg)
Alias Rain(8) = Signal 'Signal from load cell (mV/V), voltage output by load cell circuit divided by excitation voltage input to load cell circuit
Alias Rain(9) = Circuit_temp 'Ciruitry temperature (C)
DataTable(Table_15min,True,-1)
DataInterval(0,15,Min,10)
Totalize(1,Rain_in,FP2,False)
EndTable
DataTable(Daily,True,-1)
DataInterval(0,1440,Min,10)
Totalize(1,Rain_in,FP2,False)
EndTable
BeginProg
SlowSequence
Scan(10,Sec,0,0)
'Set Initial rain amount using last Rain_in_total value
Rain_initial = Rain_in_total
'Apogee SG-410 Weighted Bucket Rain Gage
SDI12Recorder(Rain(),3,0,"M1!",1.0,0)
'Compare rain accumulation amount to previous value
If Rain_in_total > Rain_initial
Rain_in = Rain_in_total - Rain_initial
Else
Rain_in = 0
EndIf
'Call Data Tables and Store Data
CallTable Table_15min
CallTable Daily
NextScan
EndProg