• 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 set HighLimit/LowLimit in mass?

    Mango Automation general Discussion
    3
    11
    2.9k
    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.
    • phildunlapP
      phildunlap
      last edited by phildunlap

      Hi timkk880,

      If you already have the limit detectors created, you can use the /data_sources.shtm page, the data points tab, to filter the points to only points with the limit detectors in question. Then you can export them, perform modifications and import them.

      If you need to add a heap of them, manipulating the JSON or making programmatic API calls is the current way to go. For instance, this Python script will add a high limit detector to all data points in the input:

      import json
      from StringIO import StringIO
      #import copy
      
      inputFile = open("/path/to/mango-configuration.json")
      config = json.load(inputFile)
      inputFile.close()
      
      newDetector = json.load(StringIO("""{
                     "type":"HIGH_LIMIT",
                     "sourceType":"DATA_POINT",
                     "alias":"",
                     "alarmLevel":"NONE",
                     "durationType":"SECONDS",
                     "duration":15,
                     "limit":50.0,
                     "notHigher":false
                  }"""))
      
      #can use thisPointsDetector = copy.deepcopy(newDetector) (or reload json)
      # if you need to change something for the ideal, like the alias
      for dp in config["dataPoints"] :
        dp["eventDetectors"].append(newDetectorJson)
      
      outputFile = open("/path/to/output.json", "w+")
      outputFile.write(json.dumps(config, indent=4, sort_keys=False, separators=(",",": ")))
      outputFile.close()
      
      1 Reply Last reply Reply Quote 0
      • T
        timkk880
        last edited by

        that's useful function, thanks.
        By the way, how to set point update periode? it seems only data source can set update periode, one data source may have many points need different frequency to update, is that possible to set point by point?

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

          That depends on the data source but generally no, you cannot set the update interval on a per-point basis. What type of data source?

          If you need to poll a Modbus device at multiple rates for instance, you can do this if it is Modbus IP by creating multiple data sources. If it's Modbus serial, it is not efficient but you could create a scripting data source that calls

          RuntimeManager.refreshDataPoint(p123.getDataPointWrapper().getXid());
          

          And then schedule that cron for whatever update rate you need. If that were a third of the points or more, I would just increase the polling rate of the data source and ensure the ones you don't need that density on have interval logging types.

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

            yes, it's modbus datasource. the reason why ask this, is because I have many datasource, each of them have 20 points, only one of these points need poll immediately, for example, motor, I want to set it 50ms for poll interval, and other points I accept 5 minutes, if I set them all 50ms, I worry about bandwidth and hardware resource etc.

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

              I was asking if it is a Modbus IP data source, but I can guess from the other thread that it probably is. In that case, I would put the point(s) that you need to read that quickly onto a second data source with the faster polling rate.

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

                thanks for your proposal, the only thing I worry about is if I set two Modbust IP master to poll data from the same Modbust IP salve, do they conflict or not? for example, I set Master A to poll data every 50ms, Master B poll data every 2 minutes, sometimes, A and B poll data at exactly same timestamp from the same PLC, what will happen?

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

                  That will depend on the device you are reading. Most devices will support a few concurrent IP connections without issue. Some are configurable.

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

                    ok, I will try.

                    1 Reply Last reply Reply Quote 0
                    • P
                      Peter_John48115
                      last edited by Peter_John48115

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

                        Hi Peter_John48115, welcome to the forum.

                        I have no idea what you're asking. That appears to mostly be a copied portion of my second post. Were you asking for some clarification?

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