Run Hours
-
Hi, I am using a binary point for a compressor, and I want to know if is any possibility to extract this data and to trigger an alarm after 1000h of running:
-
@georgestefan you can add an event detector to detect if it stays in the same state for x hours but that wont work if the compressor turns off and on obviously. I'm sure there is a way to do what you are asking via scripting. @phildunlap should be able to help you.
-
Hi George,
There is! Runtime information is available in the StartsAndRuntimes object returned from the past() and previous() functions on data points in scripts.
So, i could have a meta point like,
var stats = p.past(DAY); //p is the variable name of the binary point in the context for(var k = 0; k < stats.data.length; k+=1) { if(stats.data[k].value === true) return my.value + stats.data[k].runtime/3600000; //runtime given in milliseconds } return my.value;
running on a cron like
59 59 23 * * ?
and it'll totalize once a day the hours run that day. Then you can put a limit detector on the meta point. -
Thanks, I'll try this.
-
@phildunlap I've created a meta point like this and when I run the script it shows me the right value, but the limit detector didn't worked
This is the meta point:
And I've noticed this in my data base:
Comp_Run_H it's the meta point from above.
Can you tel me why I don't have any value returned? -
This post is deleted! -
Have you let this run over night? With that cron pattern it should only run on the last second of the day to produce a value.
-
Yes, that's right, at the last second of the day produce that value, I'm starting to see how this is working.
Thanks again!