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.

Viewing a running total of rainfall on RTMC


zachhow9 Jul 25, 2024 09:21 PM

I am attempting to set up a way to view a running rainfall total for the current day, that resets every 24hrs (midnight). What I have thus far...

Public DailyTotal

If TimeIntoInterval(0,24,Hr) Then TotalRun(DailyTotal,1,BucketsTips,8640),24,Hr
DailyTotal = DailyTotal * .01

I am not recieving anything when it is raining. The program has a 10 second data interval. DailyTotal paramter selected in the Digital output on my RTMC. I'm a novice, and have been staring at this far to long. What am i missing?


JDavis Jul 26, 2024 07:39 PM

Don't use TotalRun() within an If statement. That was tripping you up. Make use of the RunReset parameter of TotalRun.

 Note that is the program scan rate changes, the count for TotalRun and the TimeIntoInterval need to change.

Public BucketTips , DailyTotal
Public RunReset As Boolean

BeginProg
  Scan (10,Sec,0,0)

    RunReset = 	TimeIntoInterval (10,86400,Sec)
    TotalRun (DailyTotal,1,BucketTips * 0.01,8640, RunReset)

  NextScan
EndProg

 

Here is another way to solve the problem.

 

Public BucketTips , DailyTotal

DataTable (Table1,True,-1 )
  DataInterval (0,1,Hr,10)
  Totalize (1,BucketTips,Long,False)
  Sample (1,DailyTotal,IEEE4)
EndTable

BeginProg
  Scan (10,Sec,0,0)

    PulseCount (BucketTips,1,P1 ,1,0,1.0,0)
    DailyTotal += BucketTips * 0.01
    CallTable Table1
    'Must be after CallTable
    If TimeIntoInterval (0,24,Hr)Then DailyTotal = 0

    NextScan
  EndProg

 


zachhow9 Jul 27, 2024 06:10 PM

The first option eliminates the need for the  DailyTotal = DailyTotal * .01 line correct?

Thank you for the help!


JDavis Jul 30, 2024 04:29 PM

Do not use:

  DailyTotal = DailyTotal * .01

Every scan, your total would get smaller.

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