• 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

    Run Hours

    Mango General
    3
    8
    2.6k
    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.
    • G
      georgestefan
      last edited by

      Hi, I am using a binary point for a compressor, and I want to know if is any possibility to extract this data and to trigger an alarm after 1000h of running:

      0_1500280464572_run hours.JPG

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

        @georgestefan you can add an event detector to detect if it stays in the same state for x hours but that wont work if the compressor turns off and on obviously. I'm sure there is a way to do what you are asking via scripting. @phildunlap should be able to help you.

        Developer at Radix IoT

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

          Hi George,

          There is! Runtime information is available in the StartsAndRuntimes object returned from the past() and previous() functions on data points in scripts.

          So, i could have a meta point like,

          var stats = p.past(DAY); //p is the variable name of the binary point in the context
          for(var k = 0; k < stats.data.length; k+=1) {
              if(stats.data[k].value === true)
                  return my.value + stats.data[k].runtime/3600000; //runtime given in milliseconds
          }
          return my.value;
          

          running on a cron like 59 59 23 * * ? and it'll totalize once a day the hours run that day. Then you can put a limit detector on the meta point.

          G 1 Reply Last reply Reply Quote 1
          • G
            georgestefan
            last edited by

            Thanks, I'll try this.

            1 Reply Last reply Reply Quote 0
            • G
              georgestefan @phildunlap
              last edited by georgestefan

              @phildunlap I've created a meta point like this and when I run the script it shows me the right value, but the limit detector didn't worked

              This is the meta point:
              0_1500921881770_script.JPG

              And I've noticed this in my data base:
              0_1500921925387_point.JPG

              Comp_Run_H it's the meta point from above.
              Can you tel me why I don't have any value returned?

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

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  Have you let this run over night? With that cron pattern it should only run on the last second of the day to produce a value.

                  1 Reply Last reply Reply Quote 1
                  • G
                    georgestefan
                    last edited by

                    Yes, that's right, at the last second of the day produce that value, I'm starting to see how this is working.
                    Thanks again!

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