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.

Modbus diconnection (read failed)
#2
Hi
If you use profile here is how to check status of modbus device

Code:
function checkrtu(slave)
local res = db:getone('SELECT active FROM modbus_devices WHERE proto="rtu" AND slave=?', slave)
return toboolean(res)
end

function checktcp(ip, port)
local settings, res
settings = tostring(ip) .. ':' .. tostring(port)
res = db:getone('SELECT active FROM modbus_devices WHERE proto="tcp" AND settings=?', settings)
return toboolean(res)
end
BR
------------------------------
Ctrl+F5
Reply


Messages In This Thread
RE: Modbus diconnection (read failed) - by Daniel - 01.02.2019, 09:48

Forum Jump: