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.
Scripting Data Source
-
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?
-
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.
-
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
}
]
} -
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. -
Joel,
Thank You. That puts me on the right track.
Paul
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login