25.01.2021, 12:29
(This post was last modified: 25.01.2021, 12:33 by Trond Hoyem.)
(19.01.2021, 15:00)tomnord Wrote:This worked fine. This script is eventbased and used in all fault GA's. Will have to enter the Alias for each damper, but that is a one time thing.Code:input = event.getvalue()
if input == true then
grp.removetags('Damper_1_Angle', 'Supply')
else
grp.addtags('Damper_1_Angle', 'Supply')
end
Could this have been done easier?
Hi
Just to give my toughts....
I am doing smililar things as you describe here in many projects. What I have found to be the best way is to aloways use a very strict naming policy. By doing that I can find the address for fault (as you mention here) by replacin the code for temp with the code for fault.
To find the address I need I can then do something like this;
Code:
adresse = string.gsub(grp.find(event.dst).name, 'TRIGGER_OUTPUT', 'TRIGGER_INPUT')
LOCK = grp.getvalue('32/1/2')
if not LOCK then
grp.write(adresse, event.getvalue())
end
Here I replace the TRIGGER_OUTPUT with TRIGGER_INPUT to find the address to forward the value to if the locking is not true.
You could do the same by simply replacing 'TEMPERATURE' with 'FAULT', or whatever would be your naming policy.
There are 10 kinds of people in the world; those who can read binary and those who don't
![Cool Cool](https://forum.logicmachine.net/images/smilies/cool.png)