Thanks for the reply.
Can you please be more spesific on how i should build it to my purpose? (I am at best Poorly experienced with LULA).
If I have given the tag "Supply" to all valves, and the tag SupplySUM to the adress I want the summing value to be written to. How should I do it?
You need only tag for the 'Supply' values and the you can use event script with your tag as event or resident script with interval as often you need the calculation.
Code:
function tag_sum(tag)
local objects, result
result = 0
objects = grp.tag(tag)
for _, object in ipairs(objects) do
result = result + object.data
end
return result
end
sum = tag_sum('Supply')
grp.checkwrite('1/1/1', sum)
Change group address where you want to write it to.
Daniel, since you are on a roll
I see that the first example is air values and i guess to sum them up.
But lets say you have some supply air vav but only one central extract vav. And then want to convert the supply sum to an control value 0-100 % to control the Extract vav.
Given you know the Min/Max/Nom values of the Vav.
Been searching forum, but have not seen anything.