meta data scripting - execution and setting
Using latest Mango version.
I have a BACnet device that reports data, then I essentially copy that data into a meta data point to run a script to scale its value. I do the same for both inputs and outputs.
One of my points takes data, and has an event handler so if it exceeds a value, the event is triggers and sends a binary value to the meta data point. The value of the point does change but does not run it's script and therefore the scaled value does not get sent to the BACnet.
When a meta data point is changed, shouldn't the script within execute? It will only run when I force it in Data Point Details (refresh counterclockwise arrow thingy).
If the script isn't supposed to execute, do you have any ideas on how to make it run when the meta data point value changes, or maybe a better way to approach how to scale BACnet data with event handlers?
You're approaching this wrong. The script of a meta point or a scripted datasource only fires if either two conditions are met:
- The timer set on it fires.
- The context points attached to the script trigger a context fire if they are ticked.
You're using a meta data point and am merely setting its value, not triggering a script execution.
I suggest you use the event to set a point value and make it run the script instead of setting the meta data point value. That way you'll trigger firing your script to send values back to your bacnet gear.
@MattFox sort of confused. How do I use the event to set a point value and trigger the script vs setting the meta data point value?
just not following what you mean..
ok i think i now understand (maybe). Do you mean that within the meta data point script, that adding itself as an external context point?
This seems to work partially. When the event gets triggered, it changes the meta point value but does not run the script. I try to add it from the external context point list but then it throws an error when trying to get the meta data point value.
No under events, there are different options when an event is triggered. Email, set point value, run external process,excel report, report -> Set to Set point
Then add the same context points you use in your meta data source script, the target point being what you normally send data down via your meta point -> your bacnet point
Set to scripted action:
Input the same code you would for your meta datapoint script and return the value that the bacnet point should receive.
This will then fire when the event is triggered.