30.09.2023, 09:31
Try this:
Code:
require('luamodbus')
mb = luamodbus.rtu()
mb:open('/dev/RS485', 19200, 'N', 8, 1, 'H')
mb:connect()
mb:setslave(1)
value = mb:readregistervalue(1234,"float32","n")
-- n=no swap, w=word swap, b=byte swap, bw=byte and word swap
mb:close()