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.

read value from two modbus adresses
#1
hi please how can i read the value in 32bit format which use 2 modbus adresses one for lsb and other fr msb in logic magine
Reply
#2
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()
Reply


Forum Jump: