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.

Belimo UK24MOD
#3
Here is a sample code after quick view on reference manual. Just to help you find a right way.
Code:
require('luamodbus')
mb1 = luamodbus.rtu()
-- RS-485 port name and number. here is RS485, but it can be RS485-1, RS485-2, ttyUSB0
-- connection parameters must to accord device settings
mb1:open('/dev/RS485', 38400, 'E', 8, 1, 'H')
mb1:connect()

-- select modbus slave ID for read/write operations (55 here)
mb1:setslave(55)

--[[
read values
we need to read hold register (command #3)
modbus we can to assess:
#1 - coil
#2 - discrete input
#3 - hold register
#4 - input register
]]--

-- read all registers related to first MP
i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19 = mb1:readregisters(0, 20)

-- do something with this information

-- set setpoint to 50
mb1:writeregisters(0, 50)

mb1:close()

And my question to LM gurus: what will happens if there are device listed in 'ModBus' table located on the same RS485 bus. I assume that connection parameters are the same and there is no address conflict.
Reply


Messages In This Thread
Belimo UK24MOD - by benthoma - 18.11.2020, 12:00
RE: Belimo UK24MOD - by admin - 18.11.2020, 12:24
RE: Belimo UK24MOD - by benthoma - 18.11.2020, 13:14
RE: Belimo UK24MOD - by Andey - 18.11.2020, 12:33
RE: Belimo UK24MOD - by admin - 18.11.2020, 12:48
RE: Belimo UK24MOD - by Daniel - 18.11.2020, 14:22

Forum Jump: