This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Average 4 byte float
#1
Have used this with calculation with 2 byte float. But now i wanted it to calculate  L2, since my Kampstup meter only shows value on L1 and L2. 
But not getting any values. Guess its could be because it is 4 byte float and not 2 byte. But what would be the correct value to use. 


T1 = grp.getvalue('26/0/100')
T2 = grp.getvalue('26/0/101')
AV = math.round((T1 + T2) / 2, 0)
grp.write('27/7/12', AV)




I solved it in FBEditor using addition and division block but seems a bit "old fashion". Smile 
Reply
#2
Try logging the values in your script:
Code:
T1 = grp.getvalue('26/0/100')
T2 = grp.getvalue('26/0/101')
AV = math.round((T1 + T2) / 2, 0)
log(T1, T2, AV)
grp.write('27/7/12', AV)
Reply


Forum Jump: