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.

KNX - Dali Device Diagnostic telegram Decoding
#1
Hello All,

Can anyone please help me decoding a 1 byte object as mentioned below?

1-byte object to transmit and read out the error status of individual DALI operating devices connected to the system. 
The following bit assignment is used:
Bit 0...5: Number of the DALI operating device (0...63)
Bit 6: Lamp error ("0" = No error, "1" = Error)
Bit 7: Electronic ballast error ("0" = No error, "1" = Error)

I could use the following code to get the status of the last two bits but I don't know how to convert the first 6 bits to integer and write the value to a virtual object. 

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

value = event.getvalue()

grp.checkupdate('32/1/1', getbit(value, 6))
grp.checkupdate('32/1/2', getbit(value, 7))

Thank you in andvance.
Reply


Messages In This Thread
KNX - Dali Device Diagnostic telegram Decoding - by manos@dynamitec - 08.05.2019, 13:38

Forum Jump: