MaxRunOverTimeWithReset
This function returns the maximum of all values since the function was reset.
Syntax
MaxRunOverTimeWithReset ( number, valueTimestamp, resetOption, doReset [optional])
Remarks
The number parameter specifies the data value for which the maximum is to be calculated. The valueTimestamp is the timestamp for this data value. (The Timestamp function can be used to obtain this timestamp.) The resetOption specifies when the maximum will be reset. This parameter must contain one of the following predefined constants: RESET_HOURLY, RESET_DAILY, RESET_WEEKLY, RESET_MONTHLY, RESET_YEARLY, or RESET_CUSTOM. For example, RESET_MONTHLY will cause the maximum to be reset whenever there is a change in the month in the value's timestamp. RESET_CUSTOM will cause the maximum to be reset whenever the doReset parameter is set to a non-zero value.
Any value that evaluates to –INF, INF, or NAN will be ignored. If there are no valid values stored, this function will return NAN.
Examples
Example #1
The following example will return the maximum value of the variable Temp_F. The value will be reset at the beginning of each month.
MaxRunOverTimeWithReset("Server:CR1000.Second.Temp_F",Timestamp("Server:CR1000.Second.Temp_F"),Reset_Monthly)
Example #2
The following example will return the maximum value of the variable Rain. The value will be reset on October 01.
MaxRunOverTimeWithReset("Server:CR1000.Minute.Rain",Timestamp("Server:CR1000.Minute.Rain"),RESET_CUSTOM,
ToInt(FormatTime(Timestamp("Server:CR1000.Minute.Rain"), $"%m%d%H%M")) = 10010000)