Problem setting dataPoint value from script or metadata
-
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 ??
-
[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.
-
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. -
I tried to read scripts help but something wrong in my installation shows "scheduled events" help ...
-
@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