#601 reset RPS if the triggering condition is a timeout on PLC session establish

This commit is contained in:
Mikayla Fischler
2025-02-09 11:59:03 -05:00
parent f32855084e
commit 4e31b33b09
2 changed files with 18 additions and 4 deletions

View File

@@ -23,8 +23,7 @@ local AUTO_ACK = comms.PLC_AUTO_ACK
local RPS_LIMITS = const.RPS_LIMITS
-- I sure hope the devs don't change this error message, not that it would have safety implications
-- I wish they didn't change it to be like this
-- specific errors thrown when scram/start is used that still count as success
local PCALL_SCRAM_MSG = "Scram requires the reactor to be active."
local PCALL_START_MSG = "Reactor is already active."

View File

@@ -61,6 +61,7 @@ function plc.new_session(id, s_addr, i_seq_num, reactor_id, in_queue, out_queue,
local log_tag = "plc_session(" .. id .. "): "
local self = {
initial_reset = true,
commanded_burn_rate = 0.0,
auto_cmd_token = 0,
ramping_rate = false,
@@ -379,7 +380,14 @@ function plc.new_session(id, s_addr, i_seq_num, reactor_id, in_queue, out_queue,
if pkt.length == 14 then
local status = pcall(_copy_rps_status, pkt.data)
if status then
-- copied in RPS status data OK
-- copied in RPS status data OK, try initial reset if applicable
if self.initial_reset then
self.initial_reset = false
if self.sDB.rps_trip_cause == "timeout" then
_send(RPLC_TYPE.RPS_AUTO_RESET, {})
log.debug(log_tag .. "initial RPS reset on timeout status sent")
end
end
else
-- error copying RPS status data
log.error(log_tag .. "failed to parse RPS status packet data")
@@ -392,7 +400,14 @@ function plc.new_session(id, s_addr, i_seq_num, reactor_id, in_queue, out_queue,
if pkt.length == 13 then
local status = pcall(_copy_rps_status, { true, table.unpack(pkt.data) })
if status then
-- copied in RPS status data OK
-- copied in RPS status data OK, try initial reset if applicable
if self.initial_reset then
self.initial_reset = false
if self.sDB.rps_trip_cause == "timeout" then
_send(RPLC_TYPE.RPS_AUTO_RESET, {})
log.debug(log_tag .. "initial RPS reset on timeout alarm sent")
end
end
else
-- error copying RPS status data
log.error(log_tag .. "failed to parse RPS alarm status data")