How to get total alarm number of a data source?
-
For example, there is a data source has 20 data points, I want to know how many data points' value are out of range, any scripts for that?
-
I mean that you can use the scripting and evaluated differentents data points. How the scripting is the Data source you can asociate data points with a counter the number the data point original that is out range.
-
Hi youland1900,
As @Fabier suggested, you can use a scripting data source for this purpose, running on either a cron or on an update from one point on the polling data source you wish to check this on. You can add all the points to the context or you can query for them, like,
var dataSourcePoints = DataPointQuery.query('eq(dataSourceXid,DS_1234)'); var totalOutOfRange = 0; for(var k = 0; k < dataSourcePoints.length; k+=1) { //isOutOfRange() not provided if(dataSourcePoints[k].runtime !== null && isOutOfRange(dataSourcePoints[k].runtime.value)) totalOutOfRange+=1; } outputPoint.set(totalOutOfRange); //some point in context to set the result to
-
Thank you! I am working on it. By the way, are there any scripts to read the highlimit or lowlimit of a certain XID?