Logic Machine Forum
Calculate average value using tag - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Calculate average value using tag (/showthread.php?tid=3414)



Calculate average value using tag - Tokatubs - 10.06.2021

Hi

I would like to sum up 8 volume values. To know the actual values of the air flow in total. 
Earlier i have used this script with same tag on the adresses and the event script:
T1 = grp.getvalue('xx/x/xxx')
T2 = grp.getvalue('xx/x/xxx')
T3 = grp.getvalue('xx/x/xxx')
T4 = grp.getvalue('xx/x/xxx')
T5 = grp.getvalue('xx/x/xxx')
T6 = grp.getvalue('xx/x/xxx')
T7 = grp.getvalue('xx/x/xxx')
T8 = grp.getvalue('xx/x/xxx')
AV = math.round((T1 + T2 + T3 + T4 + T5 + T6 + T7 + T8) / 8, 0)
grp.write('xx/x/xxx', AV)


Just wondering if there is a simpler way, to do this?
Later using the total actual value on the total 8 supply vav. And converting it into a setpoint for one extract vav. But that is on a later point. 


RE: Calculate average value using tag - Daniel - 10.06.2021

Just use this
https://forum.logicmachine.net/showthread.php?tid=291&pid=1518#pid1518