This is an old revision of the document!
The COUNTNZ() function can be used to get the last time a variable was changed - it returns a human readable time.
Usage:
COUNTNZ(variable, options, val)
variable - the variable name to check
options - see below
val - optional - the threshold value to be greater than (0 is the default)
COUNTNZ('genset_on',1)
Get the number of minutes that genset_on was greater than 0 for the current day
COUNTNZ('voltage',5,100)
Get the number of minutes the voltage was greater than 100v for the selected period
For device specific variables use a . to separate the device name:
COUNTNZ('My Device.My Value',1)
The second parameter, [options] is a number and can be any of the following
1 | DAY - Number of minutes non-zero today |
2 | WEEK - Number of minutes non-zero for the week |
3 | MONTH - Number of minutes non-zero for during the month |
4 | YEAR - Number of minutes non-zero for during the current year |
5 | PERIOD - Number of minutes non-zero for the selected range |
6 | SLICE - Number of minutes non-zero for variable changed during the slice in the range (i.e. in a graph segment) |
Get the uptime in percent based on voltage for the day (1440 minutes per day)
100*(COUNTNZ('voltage',1)/1440
Possible return values: 0 - 100