Emergency Light, decoding of status - 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: Emergency Light, decoding of status (/showthread.php?tid=1511) |
Emergency Light, decoding of status - eirik - 02.08.2018 Hello I've been testing some emergency lights with a KNX/DALI-gateway. There are two status-objects from each converter: - DPT244.600 DALI converter status - DPT245.600 DALI converter test result In the manual the 2byte and the 6byte object are divided into several results, like converter status, hardware status and so on. Here are the full explanation on the content of these two objects:
DALIBOX Interface Emergency.pdf (Size: 643.53 KB / Downloads: 74)
Anyone made a solution for this in LM5/SL/Wiser?? Or maybe another post on this forum I've overlooked? I would like to have one GA for each status/result in these objects, but can't get it to work. I've managed to get some HEX-value, but somehow the part in the string with 00 get "lost in translation " Have been testing with some of the solutions in this forum, but not sure if I understand it right. I'm working with a Zennio DALIBOX KNX-gateway at the moment. Would appreciate all input on this matter RE: Emergency Light, decoding of status - admin - 03.08.2018 You can convert event hex-encoded data to table with bytes like this: Code: hex = event.datahex Then you can use bit operations to extract specific bits from bytes: Code: cm = bit.band(bit.rshift(bytes[ 1 ], 4), 0x0F) RE: Emergency Light, decoding of status - manos@dynamitec - 21.09.2018 (03.08.2018, 06:18)admin Wrote: You can convert event hex-encoded data to table with bytes like this: Hello admin and anyone that may help, Could you please give me a full example of the script. I would like to have this script in general for anykind of bitset decoding. In my case I need to decode a 1byte message to 8 bits (boolean) and then visualize them so to be able to write a KNX Object or Virtual for each bit. (Please have a look at the attached photo) But I also have a big project where emergency dali lights are insalled and I would like to be able to decode the status of the converter (1byte and 3bytes) bit by bit. Regards, RE: Emergency Light, decoding of status - admin - 21.09.2018 Use this event script to get specific bits from an integer value. Make sure to create bit objects manually before running it. Code: function getbit(value, nr) RE: Emergency Light, decoding of status - manos@dynamitec - 21.09.2018 (21.09.2018, 10:04)admin Wrote: Use this event script to get specific bits from an integer value. Make sure to create bit objects manually before running it. Thank you for your quick reply. What about decoding 2 or 3 byte objects? RE: Emergency Light, decoding of status - admin - 21.09.2018 You can access any value up to 4 bytes the same way. Second argument for getbit function is bit number (starting from 0, up to 31). You can also access bytes separately by using the code from the first example: Code: hex = event.datahex RE: Emergency Light, decoding of status - manos@dynamitec - 21.09.2018 (21.09.2018, 10:54)admin Wrote: You can access any value up to 4 bytes the same way. Second argument for getbit function is bit number (starting from 0, up to 31). Thank you again for the great support. Excellent!!! RE: Emergency Light, decoding of status - chriscroko - 13.12.2019 What would I piece together from this thread to read out the "DPT245.600 DALI converter test result"? The 6byte signal. Could you explain in "layman's terms"? RE: Emergency Light, decoding of status - admin - 13.12.2019 Use this script: Code: hex = event.datahex RE: Emergency Light, decoding of status - chriscroko - 10.01.2020 (13.12.2019, 11:59)admin Wrote: Use this script: The script works and logs the right datasets. What I need now is a way to write out the different parts to different group addresses for BMS purposes. Could you give a hint on how to do this also? And also thanks for the base script. RE: Emergency Light, decoding of status - Daniel - 10.01.2020 Just add this for every value on the end grp.checkupdate('32/1/1', ltrf ) RE: Emergency Light, decoding of status - chriscroko - 10.01.2020 (10.01.2020, 09:34)Daniel. Wrote: Just add this for every value on the end Awesome! Thanks for the tip. |