• 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

    How do I create (Meta) datapoints which do not log values under certain conditions?

    Scripting general Discussion
    3
    4
    2.1k
    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.
    • AldoRamosA
      AldoRamos
      last edited by

      I am creating a few datapoints intended to log only certain values.

      For example if x is false, for example, there is no valid data to log, so we'll try again next time y changes but no value now.

      Pseudo-code:

      if (x === true)
      then
      z = y;
      else
      // z does not get a value
      end if

      I find that when I don't return a value in a Meta datapoint, it gets logged as a zero (0.0). How do I accomplish this?

      Aldo

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        There has been a little discussion about making that possible, but currently it is not (to my knowledge). So, to do that, you can either use a scripting data source, or you can cause some errors and they won't produce values in that code path. For instance...

        if( a == 1 )
          return 50;
        else
          return "No value!";
        

        And you can do the same thing by throwing an error rather than returning the wrong datatype, i.e.

        throw "No Value";
        

        In either case you may wish to suppress the events for the point / source.

        1 Reply Last reply Reply Quote 0
        • AldoRamosA
          AldoRamos
          last edited by

          OK, I'll give that a try. Can you suggest any other approaches for filtering unwanted values?

          You mentioned using a scripting data source; how would that be different?

          1 Reply Last reply Reply Quote 0
          • JoelHaggarJ
            JoelHaggar
            last edited by

            You could try the Discard Extreme values option on the logging setting and return a high value when you don't want to log any data. So rather than throw no value through 999999 and have the data point set to discard any value over 1000.

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