#31 PPM cannot assume that we will get a fault on failure, apparently sometimes we will only get a nil return so the system can no longer check ACCESS_OK, now each device has its own fault tracking

This commit is contained in:
Mikayla Fischler
2022-04-24 12:04:31 -04:00
parent 416255f41a
commit 86b0d155fa
6 changed files with 81 additions and 59 deletions

View File

@@ -10,7 +10,7 @@ os.loadAPI("scada-common/comms.lua")
os.loadAPI("config.lua")
os.loadAPI("plc.lua")
local R_PLC_VERSION = "alpha-v0.2.5"
local R_PLC_VERSION = "alpha-v0.2.6"
local print = util.print
local println = util.println
@@ -281,7 +281,8 @@ while true do
log._warning("terminate requested, exiting...")
if plc_state.init_ok then
plc_state.scram = true
if reactor.scram() ~= ppm.ACCESS_FAULT then
reactor.scram()
if reactor.__p_is_ok() then
println_ts("reactor disabled")
else
-- send an alarm: plc_comms.send_alarm(ALARMS.PLC_LOST_CONTROL) ?