This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
wiki:countnz [2018/07/16 06:28] admin created |
wiki:countnz [2024/12/24 09:25] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== COUNTNZ() Function ====== | + | ====== COUNTNZ() Function |
- | The COUNTNZ() function can be used to get the last time a variable was changed - it returns | + | The COUNTNZ() function can be used to get the number of minutes |
Usage: | Usage: | ||
- | '' | + | '' |
**variable** - the variable name to check | **variable** - the variable name to check | ||
Line 12: | Line 12: | ||
**val** - optional - the threshold value to be greater than (0 is the default) | **val** - optional - the threshold value to be greater than (0 is the default) | ||
+ | |||
+ | **start_hour** - option for 'diff in range (option 5) when period is 1 day - start hour (0-23) | ||
+ | |||
+ | **end_hour** - option for 'diff in range (option 5) when period is 1 day - end hour (0-23) - set start and end to 0 to ignore this | ||
+ | |||
+ | **start_min** - optional start minute if using a start hour | ||
+ | |||
+ | **end_min** - optional end minute if using end hour (ie. 18:43 for hour=18 and end_min=43) | ||
===== Generic Variables (per device type) ===== | ===== Generic Variables (per device type) ===== | ||
Line 35: | Line 43: | ||
The second parameter, [options] is a number and can be any of the following | The second parameter, [options] is a number and can be any of the following | ||
- | |0 | Returns //No Change// | | + | |1 | DAY - Number of minutes non-zero today| |
- | |1 | DAY - Last time the variable changed during the day | | + | |2 | WEEK - Number of minutes non-zero for the week | |
- | |2 | WEEK - Last time the variable changed during | + | |3 | MONTH - Number of minutes non-zero for during the month | |
- | |3 | MONTH - Last time the variable changed | + | |4 | YEAR - Number of minutes non-zero for during the current year | |
- | |4 | YEAR - Last time the variable changed | + | |5 | PERIOD - Number of minutes non-zero for the selected range | |
- | |5 | PERIOD - Last time the variable changed during | + | |6 | SLICE - Number of minutes non-zero for variable changed during the slice in the range (i.e. in a graph segment) | |
- | |6 | SLICE - Last time the variable changed during the slice in the range (i.e. in a graph segment) | | + | |
Line 47: | Line 54: | ||
Get the uptime in percent based on voltage for the day (1440 minutes per day) | Get the uptime in percent based on voltage for the day (1440 minutes per day) | ||
- | '' | + | '' |
Possible return values: 0 - 100 | Possible return values: 0 - 100 | ||
+ | |||
+ | ===== Example2 ===== | ||
+ | Get the minutes the DG was running for between 6am and 6 pm (18) | ||
+ | |||
+ | '' | ||
+ | |||
+ | |||
+ | |||