(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 !