• 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

    Problem setting dataPoint value from script or metadata

    Mango Automation general Discussion
    3
    6
    3.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.
    • B
      bitelxux
      last edited by

      Hi, I've a boolean point, and I', trying to set it's value from script.

      Let's say datapoint is added to script with name "var1" ...

      OK, I can access var1.value, but when I try to set it's value to other with

      var1.set(false);

      of corse, var1.value = false; doesn't work too ...

      I get an error regarding "object doesn't have method 'set'"

      I have read http://mango.serotoninsoftware.com/forum/posts/list/1462.page and <var>.set is what they are currently using so ...

      What am I doing wrong ??

      1 Reply Last reply Reply Quote 0
      • B
        bitelxux
        last edited by

        [SOLVED]

        It seems it must be done from pure script ( not possible from metadata script ? ) and use:

        var1.writeDataPoint( dataPointName, value);

        where var1 is datapoints commands context object.

        1 Reply Last reply Reply Quote 0
        • JoelHaggarJ
          JoelHaggar
          last edited by

          Yes you are correct. That's the major difference between the Meta Data souce and the Scripting. The scripting can be used to set any points you have configured in your point context where the Meta only returns a single value for it's own point. If you go through the help popup for the Scripting module it gives good example of how to use it but it sounds like you've got things figured out.

          Thanks,
          Joel.

          1 Reply Last reply Reply Quote 0
          • B
            bitelxux
            last edited by

            I tried to read scripts help but something wrong in my installation shows "scheduled events" help ...

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

              @bitelxux said:

              I tried to read scripts help but something wrong in my installation shows "scheduled events" help ...

              Most peculiar...

              Well, you can find the same documentation available in those help tips at our wiki. Specifically for the scripting module, the documentation can be found: http://wiki.infiniteautomation.com/doku.php?id=scripting_data_source

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