Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Tipping bucket counter


Adriana Jul 18, 2014 12:04 PM

I have a TB4 tipping bucket. In the Loggernet program I get the rain accumulation in a scan loop every one minute. Is it possibe to get an event whenever the bucket tips ? I need a counter that counts whenever the bucket tips.


smile Jul 18, 2014 02:29 PM

Hi

You already have the total every minute or rain gauge is read every minute?
Do you want to know in what moment of this minute there was the first tilt or all the tilts? With what resolution? per second, half a second, tenths?

You write:
"I need a counter that counts whenever the bucket tips" but maybe it's just say "I need to store day, hour minute seconds and more, every time that there is a tilt" Correct?


Smile


Adriana Jul 18, 2014 03:51 PM

Smile,

I want to know the tilt the moment it happens.


smile Jul 18, 2014 06:19 PM

Hi Adriana,

which logger?

this program is for CR1000 logger and records every minute the secs (0..60) when the event occurs.
I believe that every second is a good compromise between the resolution and the amount of data stored, but is possible change.

In this mode it will be difficult to understand if in a second, there were more than one tilt

I tried it and it seems to work, perhaps there must be a way to not store all the zeros, but sometimes it is useful to know that the string does not change length.

Smile

This is the programm:

'CR1000

'Declare Variables and Units
Public BattV
Public PTemp_C
Public Rain_mm
Public tips
Public event_RG(60)
Public rtime(9), n, i


Units BattV=Volts
Units PTemp_C=Deg C
Units Rain_mm=mm

'Define Data Tables
DataTable(Table1,True,-1)
DataInterval(0,1,Min,10)
Sample(1,BattV,FP2)
Sample(1,PTemp_C,FP2)
Totalize(1,Rain_mm,FP2,False)
Sample (60,event_RG(),FP2)

EndTable

'Main Program
BeginProg
'Main Scan
Scan(1,Sec,1,0)
'Default Datalogger Battery Voltage measurement 'BattV'
Battery(BattV)
'Default Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,_50Hz)
'Generic Tipping Bucket Rain Gauge measurement 'Rain_mm'
PulseCount(Rain_mm,1,1,2,0,0.2,0)
RealTime (rtime)'store sec of clock in rtime(6)
tips=Rain_mm
If tips>0 Then
tips=0
n=n+1
event_RG(n)=rtime(6)
EndIf
'Call Data Tables and Store Data
CallTable(Table1)
If IfTime(0,1,min) Then
n=0
For i=1 To 60
event_RG(i)=0
Next i
EndIf
NextScan
EndProg

And this is a string of data (only the first 9 events of 60)


TIMESTAMP RECORD BattV PTemp_C Rain_mm_Tot event_RG(1) event_RG(2) event_RG(3) event_RG(4) event_RG(5) event_RG(6) event_RG(7) event_RG(8) event_RG(9)
TS RN Volts Deg C mm
Smp Smp Tot Smp Smp Smp Smp Smp Smp Smp Smp Smp
2007-09-13 23:25 0 13.72 27.18 0.2 26 0 0 0 0 0 0 0 0 in in this minute there was only one tilt at sec n° 26
2007-09-13 23:26 1 13.71 27.25 0 0 0 0 0 0 0 0 0 0 in this minute there was no tilt
2007-09-13 23:27 2 13.68 27.37 7 9 14 20 21 47 48 49 51 52 in this minute there was more tilt at sec n°7, 9, 14,20,21,47,48,49,51,52
2007-09-13 23:28 3 13.67 27.5 6.4 5 10 11 12 13 14 15 16 21

* Last updated by: smile on 7/18/2014 @ 12:37 PM *


Adriana Jul 18, 2014 06:54 PM

Smile,

I'm using Loggernet.
There's no function in Loggernet that generates an event
when the bucket tips, right ?

Thanks for your help.

Adriana


jtrauntvein Jul 18, 2014 07:13 PM

Bom Dia Adriana,

Using the pulse count instruction, you will not be able to detect tips any faster than the scan rate of your program. That said, once you have performed the pulse count instruction, your datalogger program can then look at the variable to determine whether it is non-zero. If it is greater than zero than the bucket has tipped at least once in the scan. You can then define an event driven table and call it under these conditions. As such, the table will only contain records for scans where the bucket has tipped at least once.


jra Jul 18, 2014 09:15 PM

Here is an article about the DataEvent() instruction:
https://www.campbellsci.com/tips-dataevent


smile Jul 19, 2014 10:29 AM

Hi Janet, Hi Adriana

thanks to the valuable suggestion of Janet, I made these changes and it seems to work. In addition, with the value stored "tips", you can know, in that second, how many tilts were made.

Smile

CR1000 program
'CR1000
'Declare Variables and Units
Public BattV
Public PTemp_C
Public Rain_mm
Public tips
Units BattV=Volts
Units PTemp_C=Deg C
Units Rain_mm=mm
Units tips=mm
'Define Data Tables
DataTable(Table1,True,-1)
DataInterval(0,1,Min,10)
Sample(1,BattV,FP2)
Sample(1,PTemp_C,FP2)
Totalize(1,Rain_mm,FP2,False)
EndTable
DataTable(event,True,-1)
DataEvent (0,tips>0,1,0)
Sample (1,tips,FP2)
tips=0
EndTable
'Main Program
BeginProg
'Main Scan
Scan(1,Sec,1,0)
'Default Datalogger Battery Voltage measurement 'BattV'
Battery(BattV)
'Default Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,_50Hz)
'Generic Tipping Bucket Rain Gauge measurement 'Rain_mm'
PulseCount(Rain_mm,1,1,2,0,0.2,0)
'RealTime (rtime)'store sec of clock in rtime(6)
tips=Rain_mm
'Call Data Tables and Store Data
CallTable(Table1)
CallTable(event)
NextScan
EndProg

data example
TIMESTAMP,RECORD,tips
TS,RN,mm
Smp

"2014-07-19 11:57:18",4,0.2
"2014-07-19 11:57:19",5,0.4
"2014-07-19 11:57:20",6,0.4
"2014-07-19 11:57:21",7,0.6
"2014-07-19 11:57:22",8,0.2

* Last updated by: smile on 7/19/2014 @ 4:46 AM *


smile Jul 19, 2014 10:29 AM

Hi it is possible delete a duplicate post?

Smile

* Last updated by: smile on 7/19/2014 @ 4:48 AM *


PPeters Aug 4, 2014 01:36 AM

Hi Adriana
Just looking around post and thought I would add my code I use for event rain recording, will create a table entry for each tip on the rain gauge and includes a resettable count total

regards Paul

'Declare Public Variables
Public Batt_Volt
Public Rain1
Public Rain2
Public Rain1_Tot
Public Rain2_Tot
Public Version
Public Prog_Sig
Public J_Day
Public Flag(4) ' Sets up 4 flags for program control

'Declare Other Variables
Dim LoggerTime(9)

'Declare Constants
Const Software = 101
Const Edition = 0 ' Increment for changes in program, ie sensors added and offset changes (integer)
StationName ("Enter station name here")

'Define Data Tables
DataTable (Data_Rain1,Rain1,-1)
Rain1 = Rain1*500
Sample (1,Rain1,IEEE4)
EndTable

DataTable (Data_Rain2,Rain2,-1)
Rain2 = Rain2 *1000
Sample (1,Rain2,IEEE4)
EndTable

DataTable (Data_Status,Flag(1),100)
Sample (1,Batt_Volt,ieee4)
Sample (1,Prog_Sig,ieee4)
Sample (1,Version,ieee4)
EndTable


'Define Subroutines

'EndSub
'
'Main Program
BeginProg
Prog_Sig = status.ProgSignature
Version = (Software) + (Edition/100)
Flag(1) = 1

Scan (1,Sec,0,0) ' Event based rainfall code
'Setup sensor activation and measurement here
PulseCount (Rain1,1,1 ,2,0,1.0,0)
PulseCount (Rain2,1,2,2,0,1.0,0)

'Conditional processes
Rain1_Tot = Rain1 + Rain1_Tot
Rain2_Tot = Rain2 + Rain2_Tot

'Call Output Tables
CallTable Data_Rain1
CallTable Data_Rain2

NextScan

SlowSequence

Scan (15,Sec,0,0) 'Standard sensor activation
SW12 (1)
' Calculate Julian day
RealTime(LoggerTime())
J_Day = LoggerTime(9)

'Setup sensor activation and measurement here
Battery (Batt_Volt)
'Enter other measurement instructions
Batt_Volt = Round (Batt_Volt,3)

'Conditional processes
If IfTime (1,360,min) Then SW12 (0) 'Reset external GPRS every 6 hours via SW12 power

' If IfTime (7,15,min) Then PortSet (4 ,1 ) 'External relay Driver, suitable for running Turb pump
' If IfTime (8,15,min) Then PortSet (4 ,0 )

'Call Output Tables
If IfTime (0,6,Hr) Then Flag(1) = 1

CallTable Data_Status
Flag(1)=0

NextScan

EndProg

Log in or register to post/reply in the forum.