RS485 resident - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10) +--- Thread: RS485 resident (/showthread.php?tid=4708) |
RS485 resident - rw_echo - 12.04.2023 When I press the RS485 panel button, I can use the LM resident script to read the command message of the panel. The message received every time I press the button is the same. I want to control the light switch, and my script has implemented the light on action. How can I turn off the light? Can anyone help me? Thank you in advance. button cmd(hex): 02 20 10 11 00 01 00 80 4E E3 02 20 10 11 00 01 00 FF 0F 03 code: Code: if not port then RE: RS485 resident - admin - 12.04.2023 For loop after if is not needed otherwise you write might run 20 times in a row. To invert the current value use this: Code: if #res == 20 and res[4] == 0x11 and (res[8] == 0x80 or res[18] == 0xFF) then |