• 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 Enable/disable datasource by Script in active process command?

    Scripting general Discussion
    2
    5
    2.0k
    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.
    • T
      te36051
      last edited by

      How to Enable/disable datasource by Script in active process command?
      in Event handler
      My problem is when my mango restart modbus sierial datasource can't get data until i disable datasource and enable again. *i use usb to RS485 connect to my raspberry pi.

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

        Hi te36051, welcome to the forum!

        var dsxid = 'DS_Modbus'; //Change to your data source's XID
        RuntimeManager.disableDataSource(dsxid); 
        RuntimeManager.enableDataSource(dsxid);
        
        T 1 Reply Last reply Reply Quote 0
        • T
          te36051 @phildunlap
          last edited by

          @phildunlap
          Thank you for your code.i try to add event to datapoint .Set Event detectors Type "No update" and add code to Script at Active action . It not work for me. can you recommend me?

          mycode
          var dsxid = 'DS_7b18e9be-4329-41c0-b4af-a65de69c683d'; //Change to your data source's XID
          RuntimeManager.disableDataSource(dsxid);
          RuntimeManager.enableDataSource(dsxid);

          T 1 Reply Last reply Reply Quote 0
          • T
            te36051 @te36051
            last edited by

            @te36051

            Ok Thank 's a lot . It work! move code to Event type -> SystemEvents -> SystemstartUp

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

              Glad to hear it! It should work in any script set point event handler, but you may need to give the handler sufficient script permissions (add 'superadmin' to the script permissions fields on the event handler) and ensure the event is raised.

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