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.

KNX - Dali Device Diagnostic telegram Decoding
#3
(08.05.2019, 13:59)admin Wrote: You need to apply a bit mask like this:
Code:
addr = bit.band(value, 0x3F)

Thank you admin. It works perfectly. So the final code to get the dali device address starting with 1->64 it will be likeĀ  this :

Code:
value = event.getvalue()
addr = bit.band(value, 0x3F)

function getbit(value, nr)
value = bit.rshift(value, nr)
return bit.band(value, 1) == 1
end

grp.checkupdate('32/1/50', (addr + 1))
grp.checkupdate('32/1/51', getbit(value, 6))
grp.checkupdate('32/1/52', getbit(value, 7))
Reply


Messages In This Thread
RE: KNX - Dali Device Diagnostic telegram Decoding - by manos@dynamitec - 08.05.2019, 15:32

Forum Jump: