• 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

    DataPoints previous values

    Scripting general Discussion
    2
    2
    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.
    • A
      arvand.owji
      last edited by

      Hi,
      Using JAvascript library, how can I return the previous values of a data point. I'm running the following code in my script and i get corect value when i alert the current value but im struggling to see how can i access the historical data, like the value 10 min ago in this script. Can you please guide me? I ahve already looked at the "About Mango Java Script" page but no breakthrough. Thanks.

      Util.getPointsValues({
                      done : function(){
                          chartData = [];						
                          alert(res['A1'][0].value);                    
                      },
                      scope : res,
                      from : dateRange.start,
                      to : dateRange.end,
                      points : graphPoints,
                      options : {
                          timePeriodType : 'DAYS',
                          timePeriods : 1,
                          rollup : 'AVERAGE'
                      }
                  });
      
      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi arvand,

        The functions in "About Mango JavaScript" will work in Mango scripting contexts only, so Scripting data sources, meta data points, point links, etc.

        Judging from that snippet, is it part of a dashboard you're designing? If so, you could check out the existing getPointValue.js file in the UI module powering the ma-get-point-value directive, or check out the NodeJS style use of the REST API for point values, here: https://github.com/infiniteautomation/node-mango-client

        If it really is in the Mango JavaScript environments, you can print(p123); to see the available functions on the context point.

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