• 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 to implement metadata?

    User help
    2
    5
    1.8k
    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.
    • T
      tcontrada
      last edited by

      I have a Data point from a MODBUS device that I read on a periodic basis.
      The raw data from the device must be run through a calculation in order to display in the graphical view widget.

      I was trying the Metadata data point and was not able to get it to work.
      my calculation is simple in javascript:
      var my = (p1-640)/16.0;
      return my;

      does not seem to work, meaning the graphical widget does not update.

      What am I missing, is there an example similar to this?

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

        Hi tcontrada,

        i would have written that as

        return (p1.value - 640)/16.0;

        the "my" would probably be aliasing the variable name for the point to refer to itself, and one should call for the .value property of the context point.

        I do not know what you mean, "does not seem to work, meaning the graphical widget does not update." but I suspect the problem is the same. Check it on the data point details page if you are making a custom dashboard, just so one can more easily know where things are going wrong.

        1 Reply Last reply Reply Quote 0
        • T
          tcontrada
          last edited by

          I see, working now....Thanks!

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

            No problem! Just so you know, these calculations could probably be performed in the modbus point locator, which would probably be more efficient. It's value*multiplier + additive, so

            (value-640)/16 --> value*.0.0625 - 40 would be equivalent, so multiplier=0.0625 additive=-40 but there can be benefits to using a Meta point, if you're wanting to keep the raw values around too for some reason.

            1 Reply Last reply Reply Quote 0
            • T
              tcontrada
              last edited by

              OK, cool, I will try that as well...Thanks!

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