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.

RS485 resident
#2
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
  value = grp.getvalue('13/1/21')
  grp.write('13/1/21', not value)
end
Reply


Messages In This Thread
RS485 resident - by rw_echo - 12.04.2023, 03:26
RE: RS485 resident - by admin - 12.04.2023, 05:19

Forum Jump: