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.
event detection scripting
-
Hi all,
can I set a datapoint trough Meta Data Point?I have tried to set datapoint getting value from meta data point variable (my) but it seems no work.
This is the code:LOG.fatal("before if: " + my.value);
p399.set('f');
return my.value;Is it possible to manage this kind of logic?
Regards,
Matteo. -
Hi Matteo,
No, only scripting data sources can call set(). In a scripting data source things like
p1.set(p2.value);
are supported. The trade off with scripts is that they execute on cron only, so once per second is the most often it will run.
If you need to use a single input to determine what to set a particular point, you can use a point link. The variable name for the source point is 'source' and simply "return" the value you wish the target to be set to.
-
...but you could use a meta point computing a value from multiple inputs, returning that as its value, and a point link using the meta point as a source and setting the target point.
Or you could put a 'set point' event handler on a change event detector on the meta point if it's a static value or the value of the meta point you need to set to the control point. There are lots of options.
-
Hi Phil,
Thanks for the quick answer.
There is some documentation about point links? -
There is the help (?) within Mango for the Point Links and there are a couple examples around the forum: http://infiniteautomation.com/forum/search/"point link"?in=titlesposts&sortBy=timestamp&sortDirection=desc&showAs=posts