• 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

    make set point stick in script

    Scheduled Pinned Locked Moved User help
    7 Posts 3 Posters 1.7k Views 3 Watching
    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.
    • P Offline
      Phillip Weeks
      last edited by Phillip Weeks

      I am attempting to set a metapoint value in script at the end of a loop. the result acknowledges the setpoint however the point value does not log and I am logging all data for that point? Shouldn't this be sticking?

      dataPoints[0].runtime.set(value,timestamp);
      Setting point Last_Unit_Processed to Velo-201 @12/09/2018 17:03:50

      When I look at this point it has no value logged.

      1 Reply Last reply Reply Quote 0
      • MattFoxM Offline
        MattFox
        last edited by

        I find that also, I somehow get the feeling the set value is only allowed for user input....
        One thing to note is if you're running the script using the green tick it won't physically set the values, only show you the outcomes of said script.
        If this is the script in the actual metapoint itself, use return with the value. Alternatvely, just for my curiosity and interest... can you try running the same script and using that to set a virtual datapoint instead? Just that from looking at what you've provided I have a feeling that you want to set a value at a given time...

        Fox

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

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

          Calling the set function from a meta point is the same as a user entering and setting that value to a point (during meta point runtime, history generation was recently changed to behave like a scripting data source that saves historical). That means it has a complicated relationship with logging type.

          But, you said it's on all data, so it should have saved it if the script tried to set a value while it was enabled. Note also that the target point will need to be enabled for the meta point to execute. Have you checked if there are events for the meta point? Does your meta point have sufficient set data point permissions?

          MattFoxM 1 Reply Last reply Reply Quote 0
          • MattFoxM Offline
            MattFox @phildunlap
            last edited by

            @phildunlap said in make set point stick in script:

            Does your meta point have sufficient set data point permissions?

            You mean even a script needs to have set permissions??

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

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

              Without getting too into it or the outstanding issues surrounding it, yes,

              0_1536787746761_scriptPermissions.png

              1 Reply Last reply Reply Quote 0
              • P Offline
                Phillip Weeks
                last edited by Phillip Weeks

                So I triggered it with a minute update event and YES it does log now. Wow thanks guys it is working this way. You are correct about the green check not really setting the value and something tells me I knew this last year.

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

                  The checkmark is intended to validate that the script is working as intended. It would strike me as rather unfortunate if mistakes during development made it to devices.

                  You can also trigger a meta point to execute using the "Force read (if supported)" circular arrow icon on the data point details page (formerly "Refresh" in the old pages), or from a running script body (not a validate) using
                  RuntimeManager.refreshDataPoint( dataPointXid );
                  if the script has permissions to the points' data source.

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