01.02.2019, 09:48
Hi
If you use profile here is how to check status of modbus device
BR
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
------------------------------
Ctrl+F5
Ctrl+F5