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"
#3
(18.05.2018, 08:10)admin Wrote: 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))

Hello, thank you for the feedback.

I have used your script and the frame received by the master is the same from Modbus Slave software Traffic log !

The result is here:

EDIT: The frame sent is the same, but the response from the slave is a bit strange, comparing with traffic log !

In those requests you can see an almost successful frame at 09:57:21.

There is a byte <FF> preceding the correct answer.

this is a bit strange !

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
RE: Modbus RTU - "Response not from selected slave" - by iJAF - 18.05.2018, 09:04

Forum Jump: