• 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

    Server-Side Script to output a table with latest n values of a datapoint

    How-To
    2
    7
    6.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.
    • Z
      zumiani
      last edited by

      Hello all,
      I'm trying to create a server-side script to retrieve latest n values for selected datapoint and present it in tabular shape.
      Is there a way to retrieve archived values from a server-side script?

      Thank you for your help.

      1 Reply Last reply Reply Quote 0
      • O
        oja
        last edited by

        Hello,

        I solved this. But, I modified ScadaBR 0.9 (fork Mango). When you able to modify source code of Mango, I can send my code. It is a few classes.

        Ondrej

        1 Reply Last reply Reply Quote 0
        • Z
          zumiani
          last edited by

          Thank you Ondrej!
          I thought there is a server-side script to do dirty work but I haven't find anything.. :)
          I'll keep your contact in case I'll decide to rebuild mango too..
          Thank you for now

          1 Reply Last reply Reply Quote 0
          • O
            oja
            last edited by

            You can see some demo on http://kraken.alarex.net:8080/scada_orlik/public_view.htm?viewId=14

            This is combination serverscript, javascript and Flash.

            Code, which is used in View. "dataPoint.getLatestPointValues(10)" is own added method to ScadaBR.

            
            var data_series =  dataPoint.getLatestPointValues(10);
            var pole = "[";
            for (i=0;i<data_series.size();i++) {
                 pole+=""+data_series.get(i).getDoubleValue();
                 if (i!=data_series.size()-1) pole+=",";
            }
            pole+="]";
            
            s = "<script>try {document.getElementById(\"AXLED\")._ax_setChartValues("+pole+");} catch (e){};</script>";
            return s;
            
            

            On http://kraken.alarex.net:8080/scada_orlik/public_view.htm?viewId=15
            is some test of JavaScript chart.

            ServerScript is non-standard, but can be strong in Mango, when some change be provided. I like it and I think, that this is best on Mango.

            Ondrej

            1 Reply Last reply Reply Quote 0
            • Z
              zumiani
              last edited by

              Great job!

              You use your mod in order to retrieve datas for the little graph on the right, don't you?

              1 Reply Last reply Reply Quote 0
              • O
                oja
                last edited by

                Yes, I can use data for graph or table of values. I have method in Server - javascript (View) for last X values or values between time interval.
                Similar method I have in javascript (dataPoint). Now I can get last of values and calculate weightedd average, moving average for example.

                Ondrej

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