• 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

    Need advice on meta points

    Scheduled Pinned Locked Moved User help
    6 Posts 4 Posters 1.7k Views 4 Watching
    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.
    • P Offline
      Phillip Weeks
      last edited by Phillip Weeks

      I have two meta points P1 P2 that get logged when and if 2 input context points P1a, P2a are logged on change (they increment). I now want a third meta point P3 that logs the value of either P1 or P2 context points whenever either are logged. Only p1 or p2 can be logged at any one timestamp controlled at the source.
      My issue is real time and history recalculation must both work and I can get real time to work but not a history with the correct timestamp on p3.

      IN CONTEXT:p1,p2;
      var p3=0;
      var timestamp = Number(CONTEXT.getTimestamp());
      if (Math.abs(timestamp - Number(p1.time)) < 1000)
      p3 += p1.value;
      if(Math.abs(timestamp - Number(p2.time)) < 1000)
      p3 += p2.value;
      return p3;

      This logs all data and p1 or p2 updates p3 CONTEXT when either is logged and they are only logged if their CONTEXT points have logged and this only happens when they have changed. So the plan is that p3 will log the value and timestamp of either p1 or p2 whichever triggers the update. So far I cannot get this to work. Any advice would be helpful.

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

        Hrm...

        It's not super clear to me why it is doing what it is doing from what you described. It looks like p3 could be the sum of the value if there were logged values within 1 second of each other? I'm surprised everything is in Number() constructors too, you shouldn't need to do that.

        How're the timestamps in the history calculation wrong? It will use the timestamp of the point that triggered execution unless TIMESTAMP is assigned, and that applies to history calculations too.

        1 Reply Last reply Reply Quote 0
        • P Offline
          Phillip Weeks
          last edited by Phillip Weeks

          The time of p1a and p2a are controlled by a controller and uses system mode to increment one register or the other so it should not trigger together. I changed the CONTEXT update from logged to update on the p3 and this has made a difference I see after a single point test. times are lining up. now so I am re-running a few months across several hundred points to see the outcome. Input meter values are time correct, so when it finished and I will look close at the data timestamps and report back.

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

            I changed the CONTEXT update from logged to update on the p3 and this has made a difference I see after a single point test. times are lining up.

            There is no difference between the update types for history generation. I actually just opened a git issue on account of that, since the 'Changes' update event isn't really honored in history generation.

            1 Reply Last reply Reply Quote 0
            • A Offline
              andrewh
              last edited by

              Hi

              Can you please let me know what happened with this git issue?
              I'm working on a meta data point that works during a synchronization.

              Thanks

              1 Reply Last reply Reply Quote 0
              • Jared WiltshireJ Offline
                Jared Wiltshire
                last edited by

                @andrewh I am not sure which issue exactly Phillip was referring too -
                https://github.com/infiniteautomation/ma-core-public/issues?utf8=✓&q=is%3Aissue+history+generation

                Developer at Radix IoT

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