diff --git a/rtu/startup.lua b/rtu/startup.lua index 2e2272d..76944c6 100644 --- a/rtu/startup.lua +++ b/rtu/startup.lua @@ -25,7 +25,7 @@ local sna_rtu = require("rtu.dev.sna_rtu") local sps_rtu = require("rtu.dev.sps_rtu") local turbinev_rtu = require("rtu.dev.turbinev_rtu") -local RTU_VERSION = "beta-v0.9.6" +local RTU_VERSION = "beta-v0.9.7" local rtu_t = types.rtu_t diff --git a/rtu/threads.lua b/rtu/threads.lua index 3d5b690..8027f34 100644 --- a/rtu/threads.lua +++ b/rtu/threads.lua @@ -341,10 +341,11 @@ function threads.thread__unit_comms(smem, unit) util.nop() end - -- check if multiblock is still formed if this is a multiblock if (type(unit.formed) == "boolean") and (util.time() - last_f_check > 1000) then - if (not unit.formed) and unit.device.isFormed() then + local is_formed = unit.device.isFormed() + + if (not unit.formed) and is_formed then -- newly re-formed local iface = ppm.get_iface(unit.device) if iface then @@ -394,6 +395,8 @@ function threads.thread__unit_comms(smem, unit) log.error("failed to get interface of previously connected RTU unit " .. detail_name, true) end end + + unit.formed = is_formed end -- check for termination request