Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
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?