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 that you accept these cookies being set.

mb:setregisters() and LM values
#4
You won't have event.getvalue() in a resident script. encode call should have correct data type set as the second argument.
Code:
value = grp.getvalue('32/1/1')

raw = knxdatatype.encode(value, dt.int64).dataraw

r1 = raw:byte(1) * 0x100 + raw:byte(2)
r2 = raw:byte(3) * 0x100 + raw:byte(4)
r3 = raw:byte(5) * 0x100 + raw:byte(6)
r4 = raw:byte(7) * 0x100 + raw:byte(8)

register = 3204
mb:setregisters(register, r4)
mb:setregisters(register+1, r3)
mb:setregisters(register+2, r2)
mb:setregisters(register+3, r1)
Reply


Messages In This Thread
mb:setregisters() and LM values - by SigmaTec - 08.08.2022, 05:55
RE: mb:setregisters() and LM values - by admin - 08.08.2022, 06:16

Forum Jump: