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.

Comment Rainly Data


MCTT Aug 1, 2011 05:16 AM

Dear All,

I have two softwares for Rain gauge,

This is code for it.

1. First program

'Declare Variables and Units
Public Ptemp, Batt_volt
Public Rain_mm, Rain_H_mm, Rain_D_mm

'Define Data Tables
DataTable (R_Hourly,1,-1)
Sample (1,Rain_H_mm,FP2)
Sample (1,Batt_volt,FP2)
Sample (1,Ptemp,FP2)
EndTable

DataTable (R_Daily,1,-1)
Sample (1,Rain_D_mm,FP2)
EndTable

'Main Program
BeginProg
Scan (15,Min,0,0)
PanelTemp (PTemp,250)
Battery (Batt_volt)
'Read CS700 Rain Gauge measurement Rain_mm:
PulseCount(Rain_mm,1,1,2,0,0.2,0)
Rain_H_mm=Rain_H_mm+Rain_mm
Rain_D_mm=Rain_D_mm+Rain_mm

'Record Rain hourly
if IfTime (0,60,Min) then
Calltable (R_Hourly)
Rain_H_mm=0
endif
'Record Rain dayly
if IfTime (0,1440,Min) then
CallTable R_Daily
Rain_D_mm=0
endif
NextScan
EndProg

2. Second program

'Declare Public Variables
Public Ptemp, Batt_volt
Public Rain_mm

Units Rain_mm=mm

'Data Tables

DataTable (R_Hourly,1,-1)
DataInterval(0,60,Min,10)
Totalize(1,Rain_mm,FP2,False)
EndTable

DataTable (R_Daily,1,-1)
DataInterval(0,1440,Min,10)
Totalize(1,Rain_mm,FP2,False)
EndTable


'Main Program
BeginProg
Scan (15,Min,0,0)

PanelTemp (PTemp,250)
Battery (Batt_volt)

'Read CS700 Rain Gauge measurement Rain_mm:
PulseCount(Rain_mm,1,1,2,0,0.2,0)
'Call Table Hourly and Daily and store data
CallTable (R_Hourly)
CallTable (R_Daily)

NextScan
EndProg

The all softwares worked with R_Hourly function well but, if the R_Daily raining data show today’s date that means it was the record of yesterday.

Please help me support fix this issue

Thanks
Nguyen Van Hung


Sam Aug 1, 2011 05:36 AM

There is no "fix" for the issue. The data is being recorded correctly.

In regards to hourly rain fall, you'll see that rain accumulated between 12:00 DATE#1 and 13:00 DATE#1 is recorded with a time stamp of 13:00 DATE#1. Similarly, rain accumulated between 23:00 DATE#1 and 00:00 DATE#2 is recorded with a time stamp of 00:00 DATE#2. So, daily rain fall accumulated between 00:00 DATE#1 and 00:00 DATE#2 is recorded as 00:00 DATE#2.

0 minutes into a 1440 minute interval is 00:00:00. This is the representation used for midnight (0 minutes into a day).

You could use a tools like SPLIT or a spreadsheet macro to post-process the data changing 00:00 DATE#2 timestamps to 24:00 DATE#1.

Our you could ask the logger to save data 1 second before the end of the period.

1. First program
...
Scan (1,Sec,0,0)
...
'Record Rain hourly
if IfTime (3599,3600,Sec) then
Calltable (R_Hourly)
Rain_H_mm=0
endif
'Record Rain dayly
if IfTime (86399,86400,Sec) then
CallTable R_Daily
Rain_D_mm=0
endif
...

2. Second program
...
DataTable (R_Hourly,1,-1)
DataInterval(3599,3600,Sec,10)
Totalize(1,Rain_mm,FP2,False)
EndTable

DataTable (R_Daily,1,-1)
DataInterval(86399,86400,Sec,10)
Totalize(1,Rain_mm,FP2,False)
EndTable
...
Scan (1,Sec,0,0)
...


MCTT Aug 1, 2011 08:39 AM

Thanks for your support.

I will test it as your guide.


MCTT Aug 1, 2011 11:59 AM

Dear Sam,

I would like to ask you about save power, because if I set Scan (1,Sec,0,0) function in the software, we will lost power faster, I used 12 vdc/6Ah battery for the station, it is very far the office and we only go there one time per month.

infact, I am using scan(15, Min,0,0) function


Thanks.
Nguyen Van Hung


Sam Aug 1, 2011 04:29 PM

With your program, I doubt you will be able to tell a difference in power consumption.

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