Our full technical support staff does not monitor this forum.
Please submit your question from our support page if you don't find an answer here.
Next Page

1

Previous Page

Created on: 04/05/12 05:44 PM

record rain only if non zero value

Replies: 1

dfunke King County


Posts: 2
Joined: 01/14/09

record rain only if non zero value
04/05/12 5:44 PM

Hi, we want to record rain from a TB3 at one minute intervals, but only write to the table those records with rain. Easy enough with a 1 minute scan, but it's nice to keep the scan at 10 seconds.

CR200
10 second scan

DataTable(Tips,Rain_in >0.00000,6000)
DataInterval(0,1,Min)
Totalize(1,Rain_in,False)
EndTable
I tried the above but it will write the total (since the previous write) only when a tip happened in the last scan of the minute.

'TB4 Rain Gauge measurement Rain_in:
PulseCount(Rain_in,P_SW,2,0,0.01,0)

We have been writing to the table when any scan has a tip, but we don't like having to deal with the seconds in our database.

DataTable(Tips2,Rain_in<>0.00000,6000)
Totalize(1,Rain_in,False)
EndTable

Thanks

Dave

[Report Inappropriate or Erroneous Content]

aps

United Kingdom


Campbell Scientific Ltd. Employee Campbell Scientific Ltd.

Posts: 669
Joined: 09/15/08

RE: record rain only if non zero value
04/06/12 2:07 AM

In the CR200 to do this you need to keep a running total of the rain within the main scan which is reset after data is stored.

This code should do this:

'CR200 Series Datalogger

Public rain_in, rain_in_min

'Define Data Tables
DataTable(Tips,rain_in_min >0,6000)
DataInterval(0,1,Min)
Totalize(1,rain_in,False)
EndTable


'Main Program
BeginProg
Scan (10,Sec)
PulseCount (rain_in,P_LL,0,0,1.0,0)
'Totalise the rain here for the test
rain_in_min=rain_in_min+rain_in
CallTable Tips
'Reset total after data stored (at end of the minute)
If Tips.output(1,1) Then rain_in_min=0
NextScan
EndProg

Andrew Sandford, Technical Director, Campbell Scientific Ltd., U.K.

[Report Inappropriate or Erroneous Content]

Next Page

1

Previous Page

Reply

Please login to post a response.