User Tools

Site Tools


wiki:countnz

This is an old revision of the document!


COUNTNZ() Function

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)

Generic Variables (per device type)

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

Device - Specific Variables

For device specific variables use a . to separate the device name:

COUNTNZ('My Device.My Value',1)

Option Parameters

The second parameter, [options] is a number and can be any of the following

0 Returns No Change
1 DAY - Last time the variable changed during the day
2 WEEK - Last time the variable changed during the week
3 MONTH - Last time the variable changed during the month
4 YEAR - Last time the variable changed during the current year
5 PERIOD - Last time the variable changed during the selected range
6 SLICE - Last time the variable changed during the slice in the range (i.e. in a graph segment)

Example

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

wiki/countnz.1531722536.txt.gz · Last modified: 2018/07/16 06:28 by admin