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.

Modbus RTU - "Response not from selected slave"
#2
Disable RTU port in mapper and use this script to show what LM sees during communication in Logs tab. Change port parameters, slave id and register address as needed.
Code:
require('luamodbus')
mb = luamodbus.rtu()

mb:open('/dev/RS485', 38400, 'E', 8, 1, 'H')
mb:connect()

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

mb:setslave(10)

mb:readregisters(1)

mb:close()

log(table.concat(buffer))
Reply


Messages In This Thread
RE: Modbus RTU - "Response not from selected slave" - by admin - 18.05.2018, 08:10

Forum Jump: