• 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

    Assigning Event Handler (Set Point) output to multiple targets

    User help
    2
    4
    1.1k
    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.
    • W
      Wingnut2.0
      last edited by

      Re: Assigning event handlers

      Curious if its also possible to assign the output of an event handler set point to multiple target points via json?

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

        Hi Wingnut2.0,

        Sort of. It isn't possible using the return value, but you could add the points to context on the handler and do something like,

        for ( var varName in CONTEXT_POINTS ) {
          if("source" == varName)
            continue;
          this[varName].set(source.value);
        }
        return UNCHANGED; //don't set a value to the "target" point here, we already did
        

        And you could change up the context points via JSON (not sure how the JSON portion tied in).

        1 Reply Last reply Reply Quote 0
        • W
          Wingnut2.0
          last edited by

          Thanks Phillip.

          In your response here https://forum.infiniteautomation.com/topic/3282/assigning-event-handlers you mentioned making the change in the JSON to have multiple points reference a single event handler.

          "eventTypes":[
                      {
                         "sourceType":"DATA_POINT",
                         "dataPointXID":"DP_1234",
                         "detectorXID":"ED_1234"
                      }
                   ]
          

          I didnt know if the same approach might work by adding multiple target points in the JSON of the event handler

          "targetPointId":"DP_pointOne,
          "targetPointId":"DP_pointTwo,
          
          1 Reply Last reply Reply Quote 0
          • phildunlapP
            phildunlap
            last edited by

            That enables one to handle multiple event types with the same event handler, not only point event detector event types. There is not a way through the UI to configure that sort of situation yet, but you can import it already and it'll work. It would be many-events-to-single-handler instead of single-handler-to-many-points.

            Looping over points and using the set() function is the only way to set multiple values from a set point handler. You can still construct the context (which should work automatically with the snippet I shared) through JSON via the "additionalContext" property of the set point handler.

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