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.

CR1000, IfTime monthly


Naia Feb 2, 2011 01:03 PM

Hello,

I would like to reset my cumulative rain gauge readings on the first of each month. The IfTime command would be perfect, but doesn't seem to work for monthly increments. Do you have any other recommendations?

Thanks.


mjb Feb 2, 2011 03:20 PM

Hi, we require the same functionality.

Our solution uses the output of RealTime(), like so:

- Variable declarations:
Public rTime(9)
Alias rTime(1)= Time_Year
Alias rTime(2)= Time_Month
Alias rTime(3)= Time_DayOfMonth
Alias rTime(4)= Time_HourOfDay
Alias rTime(5)= Time_Minutes
Alias rTime(6)= Time_Seconds
Alias rTime(7)= Time_Microseconds
Alias rTime(8)= Time_DayOfWeek
Alias rTime(9)= Time_DayOfYear


- At start of scan cycle:
RealTime(rTime)


- later in scan cycle:
If Time_DayOfMonth = 1 AND IfTime(0,1,Day) Then
... Do Monthly stuff
EndIf


HTH,
mjb

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