• Recent
    • Tags
    • Popular
    • Register
    • Login

    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.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Script to enter last read when the read is zero, or NAN

    Scripting general Discussion
    2
    3
    2.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      catkins
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • hussamH
        hussam
        last edited by

        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.

        C 1 Reply Last reply Reply Quote 0
        • C
          catkins @hussam
          last edited by

          @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..

          1 Reply Last reply Reply Quote 0
          • First post
            Last post