07.12.2016, 14:38
The frame format you've specified is not ModBus, though from the documentation it looks like standard ModBus is supported.
Try this resident script (sleep time about 10 seconds), you should either get a value or an error message in Logs tab, don't forget to disable RTU in mapper and change port handle if your is different:
Try this resident script (sleep time about 10 seconds), you should either get a value or an error message in Logs tab, don't forget to disable RTU in mapper and change port handle if your is different:
Code:
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485', 9600, 'N', 8, 1, 'H')
mb:connect()
mb:setslave(1)
mb:setresponsetimeout(3)
log(mb:readregisters(40004))
mb:close()