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.

Wiser for KNX and modbus problem
#19
Try reading values in a loop and see if anything appears in Logs:
Code:
require('luamodbus')
mb = luamodbus.rtu()

mb:open('/dev/RS485', 9600, 'N', 8, 1, 'H')
mb:connect()

buffer = {}

mb:setdebug(function(msg)
  buffer[ #buffer + 1 ] = msg
end)

mb:setslave(8)

for i = 1, 1000 do
  buffer = {}
  res = mb:readregisters(6500, 2)
  if not res then
    log(table.concat(buffer))
  end
end

mb:close()
Reply


Messages In This Thread
RE: Wiser for KNX and modbus problem - by admin - 18.02.2021, 08:44

Forum Jump: