27.08.2024, 10:07
See if you can lower the polling interval. The load is caused by the Scada system constantly polling the Modbus values.
Or you can add a short delay before each request:
Or you can add a short delay before each request:
Code:
local function handler(sock)
copas.setErrorHandler(log)
sock = copas.wrap(sock)
sock:settimeout(60)
while true do
copas.sleep(0.5) -- extra delay
local res, err = mb.tcphandler(sock)
if not res then
break
end
end
sock:close()
end