04.11.2019, 10:41
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.
Change group address where you want to write it to.
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)
------------------------------
Ctrl+F5
Ctrl+F5