diff --git a/scada-common/util.lua b/scada-common/util.lua index 36761fd..bcab1b5 100644 --- a/scada-common/util.lua +++ b/scada-common/util.lua @@ -81,6 +81,12 @@ function new_watchdog(timeout) self._wd_timer = os.startTimer(self._timeout) end + local cancel = function () + if self._wd_timer ~= nil then + os.cancelTimer(self._wd_timer) + end + end + return { get_timer = get_timer, feed = feed diff --git a/supervisor/session/plc.lua b/supervisor/session/plc.lua index 810d8df..6f8cb5f 100644 --- a/supervisor/session/plc.lua +++ b/supervisor/session/plc.lua @@ -365,6 +365,7 @@ function new_session(id, for_reactor, in_queue, out_queue) -- close the connection local close = function () + self.plc_conn_watchdod.cancel() self.connected = false _send_mgmt(SCADA_MGMT_TYPES.CLOSE, {}) end