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.

AHU MODBUS TCP VALUE
#5
Is it a resident or a scheduled script? If it's resident then it will only work once because you are closing the connection via mb:close(). Setting slave id for TCP is optional by standard (255 is used when not set) but some devices might require it.

Start by logging each step return results:
Code:
require('luamodbus')
local mb = luamodbus.tcp()

local res, err = mb:open('192.168.201.53')
log('open', res, err)

local res, err = mb:connect()
log('connect', res, err)

local res, err = mb:readinputregisters(54)
log('read', res, err)

mb:close()
Reply


Messages In This Thread
AHU MODBUS TCP VALUE - by Elmyran - 01.11.2018, 19:42
RE: AHU MODBUS TCP VALUE - by CHOUAIBOU - 01.11.2018, 21:10
RE: AHU MODBUS TCP VALUE - by admin - 02.11.2018, 08:17

Forum Jump: