• 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

    Scripting Data Source

    User help
    2
    6
    2.2k
    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
      pfs109
      last edited by

      I have created a new script data source with a new point. I have the script scheduled to run every minute but can not get the point to update the value. I am new to this system and am just trying to figure out the capabilities at this time. I am monitoring my home with the system as a test site. I do not get any errors in the script module as there is only 1 line of code where I am incrementing the point value by adding 1 to it. When I view the point in the Watchers list, it never updates. I have set the point to an odd value from the watchers list but it doesn't change. Is there any documentation available that may help me?

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

        Hi,

        Can you post the script you are using so we can test. There is quite good documentation in the "?" pop up on the Scripting page but I'm guessing you have already found that.

        Thanks,

        Joel.

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

          scriptVar = scriptVar + 1 ;

          Joel,

          Below is the export of the point.

          {
          "dataPoints":[
          {
          "loggingType":"ON_CHANGE",
          "intervalLoggingPeriodType":"MINUTES",
          "intervalLoggingType":"INSTANT",
          "purgeType":"YEARS",
          "pointLocator":{
          "dataType":"NUMERIC",
          "settable":true,
          "varName":"scriptVar"
          },
          "eventDetectors":[
          ],
          "engineeringUnits":"No units",
          "plotType":"STEP",
          "chartColour":null,
          "chartRenderer":null,
          "dataSourceXid":"DS_240092",
          "defaultCacheSize":1,
          "deviceName":"testScript",
          "discardExtremeValues":false,
          "discardHighLimit":1.7976931348623157E308,
          "discardLowLimit":-1.7976931348623157E308,
          "enabled":true,
          "intervalLoggingPeriod":15,
          "name":"scriptVar",
          "purgeOverride":true,
          "purgePeriod":1,
          "textRenderer":{
          "type":"PLAIN",
          "suffix":""
          },
          "tolerance":0.0,
          "xid":"DP_472381"
          }
          ]
          }

          Below is the export of the script data source.

          {
          "dataSources":[
          {
          "xid":"DS_240092",
          "type":"SCRIPTING",
          "alarmLevels":{
          "SCRIPT_ERROR":"URGENT",
          "DATA_TYPE_ERROR":"URGENT",
          "LOG_ERROR":"URGENT"
          },
          "purgeType":"YEARS",
          "context":[
          {
          "dataPointXid":"DP_320492",
          "varName":"p7"
          }
          ],
          "logLevel":"DEBUG",
          "cronPattern":"0 * * * * ?",
          "executionDelaySeconds":0,
          "script":"scriptVar = scriptVar + 1 ;",
          "enabled":true,
          "name":"testScript",
          "purgeOverride":true,
          "purgePeriod":1
          }
          ]
          }

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

            Thanks for the export of the point and data source.

            You are not implementing your script correctly. Please refer to the documentation for examples.

            For your scrip this will work: ```
            scriptVar.set(scriptVar.value + 1 );

            
            Hope that helps,
            
            Joel.
            1 Reply Last reply Reply Quote 0
            • P
              pfs109
              last edited by

              Joel,

              Thank You. That puts me on the right track.

              Paul

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