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.
Script to enter last read when the read is zero, or NAN
-
I am reading a KWH point from a power meter. I am reading this point every 1 minute with it logging every 5. Sometimes in my log, I am getting a NAN, or rather a #NAN. I want to make a script that when this happens as it is logging, it will put in the last good reading.
Ive tried this script but its not working. Any one else, have something to do this?
if ((!p367.value)) return my.ago(MINUTE,5);
else return p367.value;Thanks
-
you use the meta datasource or scripting datasource? if logging every 5 minute,and read this point every 1 minute, just wasting resource,the value don't change, you can change you reading period to 5 minute,then ,will be avoid nan.
-
@hussam I am using a metadatasource to grab the point from an original BACNET in order to make a clean timestamp at 5 minute intervals. It is on this metadatasource point that I am using this script..