#43 rename ISS to RPS
This commit is contained in:
@@ -6,7 +6,7 @@ local util = require("scada-common.util")
|
||||
|
||||
local plc = {}
|
||||
|
||||
local iss_status_t = types.iss_status_t
|
||||
local rps_status_t = types.rps_status_t
|
||||
|
||||
local PROTOCOLS = comms.PROTOCOLS
|
||||
local RPLC_TYPES = comms.RPLC_TYPES
|
||||
@@ -18,10 +18,10 @@ local println = util.println
|
||||
local print_ts = util.print_ts
|
||||
local println_ts = util.println_ts
|
||||
|
||||
-- Internal Safety System
|
||||
-- Reactor Protection System
|
||||
-- identifies dangerous states and SCRAMs reactor if warranted
|
||||
-- autonomous from main SCADA supervisor/coordinator control
|
||||
plc.iss_init = function (reactor)
|
||||
plc.rps_init = function (reactor)
|
||||
local self = {
|
||||
reactor = reactor,
|
||||
cache = { false, false, false, false, false, false, false },
|
||||
@@ -37,7 +37,7 @@ plc.iss_init = function (reactor)
|
||||
local damage_percent = self.reactor.getDamagePercent()
|
||||
if damage_percent == ppm.ACCESS_FAULT then
|
||||
-- lost the peripheral or terminated, handled later
|
||||
log.error("ISS: failed to check reactor damage")
|
||||
log.error("RPS: failed to check reactor damage")
|
||||
return false
|
||||
else
|
||||
return damage_percent >= 100
|
||||
@@ -49,7 +49,7 @@ plc.iss_init = function (reactor)
|
||||
local hc_needed = self.reactor.getHeatedCoolantNeeded()
|
||||
if hc_needed == ppm.ACCESS_FAULT then
|
||||
-- lost the peripheral or terminated, handled later
|
||||
log.error("ISS: failed to check reactor heated coolant level")
|
||||
log.error("RPS: failed to check reactor heated coolant level")
|
||||
return false
|
||||
else
|
||||
return hc_needed == 0
|
||||
@@ -61,7 +61,7 @@ plc.iss_init = function (reactor)
|
||||
local w_needed = self.reactor.getWasteNeeded()
|
||||
if w_needed == ppm.ACCESS_FAULT then
|
||||
-- lost the peripheral or terminated, handled later
|
||||
log.error("ISS: failed to check reactor waste level")
|
||||
log.error("RPS: failed to check reactor waste level")
|
||||
return false
|
||||
else
|
||||
return w_needed == 0
|
||||
@@ -74,7 +74,7 @@ plc.iss_init = function (reactor)
|
||||
local temp = self.reactor.getTemperature()
|
||||
if temp == ppm.ACCESS_FAULT then
|
||||
-- lost the peripheral or terminated, handled later
|
||||
log.error("ISS: failed to check reactor temperature")
|
||||
log.error("RPS: failed to check reactor temperature")
|
||||
return false
|
||||
else
|
||||
return temp >= 1200
|
||||
@@ -86,7 +86,7 @@ plc.iss_init = function (reactor)
|
||||
local fuel = self.reactor.getFuel()
|
||||
if fuel == ppm.ACCESS_FAULT then
|
||||
-- lost the peripheral or terminated, handled later
|
||||
log.error("ISS: failed to check reactor fuel level")
|
||||
log.error("RPS: failed to check reactor fuel level")
|
||||
return false
|
||||
else
|
||||
return fuel == 0
|
||||
@@ -98,7 +98,7 @@ plc.iss_init = function (reactor)
|
||||
local coolant_filled = self.reactor.getCoolantFilledPercentage()
|
||||
if coolant_filled == ppm.ACCESS_FAULT then
|
||||
-- lost the peripheral or terminated, handled later
|
||||
log.error("ISS: failed to check reactor coolant level")
|
||||
log.error("RPS: failed to check reactor coolant level")
|
||||
return false
|
||||
else
|
||||
return coolant_filled < 0.02
|
||||
@@ -119,7 +119,7 @@ plc.iss_init = function (reactor)
|
||||
|
||||
-- check all safety conditions
|
||||
local check = function ()
|
||||
local status = iss_status_t.ok
|
||||
local status = rps_status_t.ok
|
||||
local was_tripped = self.tripped
|
||||
|
||||
-- update cache
|
||||
@@ -137,34 +137,34 @@ plc.iss_init = function (reactor)
|
||||
if self.tripped then
|
||||
status = self.trip_cause
|
||||
elseif self.cache[1] then
|
||||
log.warning("ISS: damage critical!")
|
||||
status = iss_status_t.dmg_crit
|
||||
log.warning("RPS: damage critical!")
|
||||
status = rps_status_t.dmg_crit
|
||||
elseif self.cache[4] then
|
||||
log.warning("ISS: high temperature!")
|
||||
status = iss_status_t.high_temp
|
||||
log.warning("RPS: high temperature!")
|
||||
status = rps_status_t.high_temp
|
||||
elseif self.cache[2] then
|
||||
log.warning("ISS: heated coolant backup!")
|
||||
status = iss_status_t.ex_hcoolant
|
||||
log.warning("RPS: heated coolant backup!")
|
||||
status = rps_status_t.ex_hcoolant
|
||||
elseif self.cache[6] then
|
||||
log.warning("ISS: no coolant!")
|
||||
status = iss_status_t.no_coolant
|
||||
log.warning("RPS: no coolant!")
|
||||
status = rps_status_t.no_coolant
|
||||
elseif self.cache[3] then
|
||||
log.warning("ISS: full waste!")
|
||||
status = iss_status_t.ex_waste
|
||||
log.warning("RPS: full waste!")
|
||||
status = rps_status_t.ex_waste
|
||||
elseif self.cache[5] then
|
||||
log.warning("ISS: no fuel!")
|
||||
status = iss_status_t.no_fuel
|
||||
log.warning("RPS: no fuel!")
|
||||
status = rps_status_t.no_fuel
|
||||
elseif self.cache[7] then
|
||||
log.warning("ISS: supervisor connection timeout!")
|
||||
status = iss_status_t.timeout
|
||||
log.warning("RPS: supervisor connection timeout!")
|
||||
status = rps_status_t.timeout
|
||||
else
|
||||
self.tripped = false
|
||||
end
|
||||
|
||||
-- if a new trip occured...
|
||||
local first_trip = false
|
||||
if not was_tripped and status ~= iss_status_t.ok then
|
||||
log.warning("ISS: reactor SCRAM")
|
||||
if not was_tripped and status ~= rps_status_t.ok then
|
||||
log.warning("RPS: reactor SCRAM")
|
||||
|
||||
first_trip = true
|
||||
self.tripped = true
|
||||
@@ -172,22 +172,22 @@ plc.iss_init = function (reactor)
|
||||
|
||||
self.reactor.scram()
|
||||
if self.reactor.__p_is_faulted() then
|
||||
log.error("ISS: failed reactor SCRAM")
|
||||
log.error("RPS: failed reactor SCRAM")
|
||||
end
|
||||
end
|
||||
|
||||
return self.tripped, status, first_trip
|
||||
end
|
||||
|
||||
-- get the ISS status
|
||||
-- get the RPS status
|
||||
local status = function () return self.cache end
|
||||
local is_tripped = function () return self.tripped end
|
||||
|
||||
-- reset the ISS
|
||||
-- reset the RPS
|
||||
local reset = function ()
|
||||
self.timed_out = false
|
||||
self.tripped = false
|
||||
self.trip_cause = iss_status_t.ok
|
||||
self.trip_cause = rps_status_t.ok
|
||||
end
|
||||
|
||||
return {
|
||||
@@ -201,7 +201,7 @@ plc.iss_init = function (reactor)
|
||||
end
|
||||
|
||||
-- reactor PLC communications
|
||||
plc.comms = function (id, modem, local_port, server_port, reactor, iss)
|
||||
plc.comms = function (id, modem, local_port, server_port, reactor, rps)
|
||||
local self = {
|
||||
id = id,
|
||||
seq_num = 0,
|
||||
@@ -210,7 +210,7 @@ plc.comms = function (id, modem, local_port, server_port, reactor, iss)
|
||||
s_port = server_port,
|
||||
l_port = local_port,
|
||||
reactor = reactor,
|
||||
iss = iss,
|
||||
rps = rps,
|
||||
scrammed = false,
|
||||
linked = false,
|
||||
status_cache = nil,
|
||||
@@ -411,7 +411,7 @@ plc.comms = function (id, modem, local_port, server_port, reactor, iss)
|
||||
local sys_status = {
|
||||
util.time(), -- timestamp
|
||||
(not self.scrammed), -- enabled
|
||||
iss.is_tripped(), -- overridden
|
||||
rps.is_tripped(), -- overridden
|
||||
degraded, -- degraded
|
||||
self.reactor.getHeatingRate(), -- heating rate
|
||||
mek_data -- mekanism status data
|
||||
@@ -425,22 +425,22 @@ plc.comms = function (id, modem, local_port, server_port, reactor, iss)
|
||||
end
|
||||
end
|
||||
|
||||
-- send safety system status
|
||||
local send_iss_status = function ()
|
||||
-- send reactor protection system status
|
||||
local send_rps_status = function ()
|
||||
if self.linked then
|
||||
_send(RPLC_TYPES.ISS_STATUS, iss.status())
|
||||
_send(RPLC_TYPES.RPS_STATUS, rps.status())
|
||||
end
|
||||
end
|
||||
|
||||
-- send safety system alarm
|
||||
local send_iss_alarm = function (cause)
|
||||
-- send reactor protection system alarm
|
||||
local send_rps_alarm = function (cause)
|
||||
if self.linked then
|
||||
local iss_alarm = {
|
||||
local rps_alarm = {
|
||||
cause,
|
||||
table.unpack(iss.status())
|
||||
table.unpack(rps.status())
|
||||
}
|
||||
|
||||
_send(RPLC_TYPES.ISS_ALARM, iss_alarm)
|
||||
_send(RPLC_TYPES.RPS_ALARM, rps_alarm)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -581,9 +581,9 @@ plc.comms = function (id, modem, local_port, server_port, reactor, iss)
|
||||
else
|
||||
log.debug("RPLC set burn rate packet length mismatch")
|
||||
end
|
||||
elseif packet.type == RPLC_TYPES.ISS_CLEAR then
|
||||
-- clear the ISS status
|
||||
iss.reset()
|
||||
elseif packet.type == RPLC_TYPES.RPS_RESET then
|
||||
-- reset the RPS status
|
||||
rps.reset()
|
||||
_send_ack(packet.type, true)
|
||||
else
|
||||
log.warning("received unknown RPLC packet type " .. packet.type)
|
||||
@@ -647,8 +647,8 @@ plc.comms = function (id, modem, local_port, server_port, reactor, iss)
|
||||
close = close,
|
||||
send_link_req = send_link_req,
|
||||
send_status = send_status,
|
||||
send_iss_status = send_iss_status,
|
||||
send_iss_alarm = send_iss_alarm,
|
||||
send_rps_status = send_rps_status,
|
||||
send_rps_alarm = send_rps_alarm,
|
||||
parse_packet = parse_packet,
|
||||
handle_packet = handle_packet,
|
||||
is_scrammed = is_scrammed,
|
||||
|
||||
@@ -11,7 +11,7 @@ local config = require("config")
|
||||
local plc = require("plc")
|
||||
local threads = require("threads")
|
||||
|
||||
local R_PLC_VERSION = "alpha-v0.6.0"
|
||||
local R_PLC_VERSION = "alpha-v0.6.1"
|
||||
|
||||
local print = util.print
|
||||
local println = util.println
|
||||
@@ -55,14 +55,14 @@ local __shared_memory = {
|
||||
|
||||
-- system objects
|
||||
plc_sys = {
|
||||
iss = nil,
|
||||
rps = nil,
|
||||
plc_comms = nil,
|
||||
conn_watchdog = nil
|
||||
},
|
||||
|
||||
-- message queues
|
||||
q = {
|
||||
mq_iss = mqueue.new(),
|
||||
mq_rps = mqueue.new(),
|
||||
mq_comms_tx = mqueue.new(),
|
||||
mq_comms_rx = mqueue.new()
|
||||
}
|
||||
@@ -100,13 +100,13 @@ function init()
|
||||
-- just booting up, no fission allowed (neutrons stay put thanks)
|
||||
smem_dev.reactor.scram()
|
||||
|
||||
-- init internal safety system
|
||||
smem_sys.iss = plc.iss_init(smem_dev.reactor)
|
||||
log.debug("iss init")
|
||||
-- init reactor protection system
|
||||
smem_sys.rps = plc.rps_init(smem_dev.reactor)
|
||||
log.debug("rps init")
|
||||
|
||||
if __shared_memory.networked then
|
||||
-- start comms
|
||||
smem_sys.plc_comms = plc.comms(config.REACTOR_ID, smem_dev.modem, config.LISTEN_PORT, config.SERVER_PORT, smem_dev.reactor, smem_sys.iss)
|
||||
smem_sys.plc_comms = plc.comms(config.REACTOR_ID, smem_dev.modem, config.LISTEN_PORT, config.SERVER_PORT, smem_dev.reactor, smem_sys.rps)
|
||||
log.debug("comms init")
|
||||
|
||||
-- comms watchdog, 3 second timeout
|
||||
@@ -131,7 +131,7 @@ init()
|
||||
|
||||
-- init threads
|
||||
local main_thread = threads.thread__main(__shared_memory, init)
|
||||
local iss_thread = threads.thread__iss(__shared_memory)
|
||||
local rps_thread = threads.thread__rps(__shared_memory)
|
||||
|
||||
if __shared_memory.networked then
|
||||
-- init comms threads
|
||||
@@ -142,19 +142,19 @@ if __shared_memory.networked then
|
||||
local sp_ctrl_thread = threads.thread__setpoint_control(__shared_memory)
|
||||
|
||||
-- run threads
|
||||
parallel.waitForAll(main_thread.exec, iss_thread.exec, comms_thread_tx.exec, comms_thread_rx.exec, sp_ctrl_thread.exec)
|
||||
parallel.waitForAll(main_thread.exec, rps_thread.exec, comms_thread_tx.exec, comms_thread_rx.exec, sp_ctrl_thread.exec)
|
||||
|
||||
if plc_state.init_ok then
|
||||
-- send status one last time after ISS shutdown
|
||||
-- send status one last time after RPS shutdown
|
||||
smem_sys.plc_comms.send_status(plc_state.degraded)
|
||||
smem_sys.plc_comms.send_iss_status()
|
||||
smem_sys.plc_comms.send_rps_status()
|
||||
|
||||
-- close connection
|
||||
smem_sys.plc_comms.close(smem_sys.conn_watchdog)
|
||||
end
|
||||
else
|
||||
-- run threads, excluding comms
|
||||
parallel.waitForAll(main_thread.exec, iss_thread.exec)
|
||||
parallel.waitForAll(main_thread.exec, rps_thread.exec)
|
||||
end
|
||||
|
||||
println_ts("exited")
|
||||
|
||||
@@ -13,13 +13,13 @@ local println_ts = util.println_ts
|
||||
local psleep = util.psleep
|
||||
|
||||
local MAIN_CLOCK = 1 -- (1Hz, 20 ticks)
|
||||
local ISS_SLEEP = 500 -- (500ms, 10 ticks)
|
||||
local RPS_SLEEP = 500 -- (500ms, 10 ticks)
|
||||
local COMMS_SLEEP = 150 -- (150ms, 3 ticks)
|
||||
local SP_CTRL_SLEEP = 250 -- (250ms, 5 ticks)
|
||||
|
||||
local BURN_RATE_RAMP_mB_s = 5.0
|
||||
|
||||
local MQ__ISS_CMD = {
|
||||
local MQ__RPS_CMD = {
|
||||
SCRAM = 1,
|
||||
DEGRADED_SCRAM = 2,
|
||||
TRIP_TIMEOUT = 3
|
||||
@@ -45,7 +45,7 @@ threads.thread__main = function (smem, init)
|
||||
local networked = smem.networked
|
||||
local plc_state = smem.plc_state
|
||||
local plc_dev = smem.plc_dev
|
||||
local iss = smem.plc_sys.iss
|
||||
local rps = smem.plc_sys.rps
|
||||
local plc_comms = smem.plc_sys.plc_comms
|
||||
local conn_watchdog = smem.plc_sys.conn_watchdog
|
||||
|
||||
@@ -84,7 +84,7 @@ threads.thread__main = function (smem, init)
|
||||
elseif event == "timer" and networked and param1 == conn_watchdog.get_timer() then
|
||||
-- haven't heard from server recently? shutdown reactor
|
||||
plc_comms.unlink()
|
||||
smem.q.mq_iss.push_command(MQ__ISS_CMD.TRIP_TIMEOUT)
|
||||
smem.q.mq_rps.push_command(MQ__RPS_CMD.TRIP_TIMEOUT)
|
||||
elseif event == "peripheral_detach" then
|
||||
-- peripheral disconnect
|
||||
local device = ppm.handle_unmount(param1)
|
||||
@@ -103,7 +103,7 @@ threads.thread__main = function (smem, init)
|
||||
|
||||
if plc_state.init_ok then
|
||||
-- try to scram reactor if it is still connected
|
||||
smem.q.mq_iss.push_command(MQ__ISS_CMD.DEGRADED_SCRAM)
|
||||
smem.q.mq_rps.push_command(MQ__RPS_CMD.DEGRADED_SCRAM)
|
||||
end
|
||||
|
||||
plc_state.degraded = true
|
||||
@@ -119,14 +119,14 @@ threads.thread__main = function (smem, init)
|
||||
-- reconnected reactor
|
||||
plc_dev.reactor = device
|
||||
|
||||
smem.q.mq_iss.push_command(MQ__ISS_CMD.SCRAM)
|
||||
smem.q.mq_rps.push_command(MQ__RPS_CMD.SCRAM)
|
||||
|
||||
println_ts("reactor reconnected.")
|
||||
log.info("reactor reconnected.")
|
||||
plc_state.no_reactor = false
|
||||
|
||||
if plc_state.init_ok then
|
||||
iss.reconnect_reactor(plc_dev.reactor)
|
||||
rps.reconnect_reactor(plc_dev.reactor)
|
||||
if networked then
|
||||
plc_comms.reconnect_reactor(plc_dev.reactor)
|
||||
end
|
||||
@@ -171,7 +171,7 @@ threads.thread__main = function (smem, init)
|
||||
-- check for termination request
|
||||
if event == "terminate" or ppm.should_terminate() then
|
||||
log.info("terminate requested, main thread exiting")
|
||||
-- iss handles reactor shutdown
|
||||
-- rps handles reactor shutdown
|
||||
plc_state.shutdown = true
|
||||
break
|
||||
end
|
||||
@@ -181,20 +181,20 @@ threads.thread__main = function (smem, init)
|
||||
return { exec = exec }
|
||||
end
|
||||
|
||||
-- ISS monitor thread
|
||||
threads.thread__iss = function (smem)
|
||||
-- RPS operation thread
|
||||
threads.thread__rps = function (smem)
|
||||
-- execute thread
|
||||
local exec = function ()
|
||||
log.debug("iss thread start")
|
||||
log.debug("rps thread start")
|
||||
|
||||
-- load in from shared memory
|
||||
local networked = smem.networked
|
||||
local plc_state = smem.plc_state
|
||||
local plc_dev = smem.plc_dev
|
||||
local iss = smem.plc_sys.iss
|
||||
local rps = smem.plc_sys.rps
|
||||
local plc_comms = smem.plc_sys.plc_comms
|
||||
|
||||
local iss_queue = smem.q.mq_iss
|
||||
local rps_queue = smem.q.mq_rps
|
||||
|
||||
local was_linked = false
|
||||
local last_update = util.time()
|
||||
@@ -203,14 +203,14 @@ threads.thread__iss = function (smem)
|
||||
while true do
|
||||
local reactor = plc_dev.reactor
|
||||
|
||||
-- ISS checks
|
||||
-- RPS checks
|
||||
if plc_state.init_ok then
|
||||
-- SCRAM if no open connection
|
||||
if networked and not plc_comms.is_linked() then
|
||||
plc_state.scram = true
|
||||
if was_linked then
|
||||
was_linked = false
|
||||
iss.trip_timeout()
|
||||
rps.trip_timeout()
|
||||
end
|
||||
else
|
||||
-- would do elseif not networked but there is no reason to do that extra operation
|
||||
@@ -223,38 +223,38 @@ threads.thread__iss = function (smem)
|
||||
reactor.scram()
|
||||
end
|
||||
|
||||
-- if we are in standalone mode, continuously reset ISS
|
||||
-- ISS will trip again if there are faults, but if it isn't cleared, the user can't re-enable
|
||||
-- if we are in standalone mode, continuously reset RPS
|
||||
-- RPS will trip again if there are faults, but if it isn't cleared, the user can't re-enable
|
||||
if not networked then
|
||||
plc_state.scram = false
|
||||
iss.reset()
|
||||
rps.reset()
|
||||
end
|
||||
|
||||
-- check safety (SCRAM occurs if tripped)
|
||||
if not plc_state.no_reactor then
|
||||
local iss_tripped, iss_status_string, iss_first = iss.check()
|
||||
plc_state.scram = plc_state.scram or iss_tripped
|
||||
local rps_tripped, rps_status_string, rps_first = rps.check()
|
||||
plc_state.scram = plc_state.scram or rps_tripped
|
||||
|
||||
if iss_first then
|
||||
println_ts("[ISS] SCRAM! safety trip: " .. iss_status_string)
|
||||
if rps_first then
|
||||
println_ts("[RPS] SCRAM! safety trip: " .. rps_status_string)
|
||||
if networked and not plc_state.no_modem then
|
||||
plc_comms.send_iss_alarm(iss_status_string)
|
||||
plc_comms.send_rps_alarm(rps_status_string)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- check for messages in the message queue
|
||||
while iss_queue.ready() and not plc_state.shutdown do
|
||||
local msg = iss_queue.pop()
|
||||
while rps_queue.ready() and not plc_state.shutdown do
|
||||
local msg = rps_queue.pop()
|
||||
|
||||
if msg.qtype == mqueue.TYPE.COMMAND then
|
||||
-- received a command
|
||||
if msg.message == MQ__ISS_CMD.SCRAM then
|
||||
if msg.message == MQ__RPS_CMD.SCRAM then
|
||||
-- basic SCRAM
|
||||
plc_state.scram = true
|
||||
reactor.scram()
|
||||
elseif msg.message == MQ__ISS_CMD.DEGRADED_SCRAM then
|
||||
elseif msg.message == MQ__RPS_CMD.DEGRADED_SCRAM then
|
||||
-- SCRAM with print
|
||||
plc_state.scram = true
|
||||
if reactor.scram() then
|
||||
@@ -264,10 +264,10 @@ threads.thread__iss = function (smem)
|
||||
println_ts("failed reactor SCRAM")
|
||||
log.error("failed reactor SCRAM")
|
||||
end
|
||||
elseif msg.message == MQ__ISS_CMD.TRIP_TIMEOUT then
|
||||
elseif msg.message == MQ__RPS_CMD.TRIP_TIMEOUT then
|
||||
-- watchdog tripped
|
||||
plc_state.scram = true
|
||||
iss.trip_timeout()
|
||||
rps.trip_timeout()
|
||||
println_ts("server timeout")
|
||||
log.warning("server timeout")
|
||||
end
|
||||
@@ -284,24 +284,24 @@ threads.thread__iss = function (smem)
|
||||
-- check for termination request
|
||||
if plc_state.shutdown then
|
||||
-- safe exit
|
||||
log.info("iss thread shutdown initiated")
|
||||
log.info("rps thread shutdown initiated")
|
||||
if plc_state.init_ok then
|
||||
plc_state.scram = true
|
||||
reactor.scram()
|
||||
if reactor.__p_is_ok() then
|
||||
println_ts("reactor disabled")
|
||||
log.info("iss thread reactor SCRAM OK")
|
||||
log.info("rps thread reactor SCRAM OK")
|
||||
else
|
||||
println_ts("exiting, reactor failed to disable")
|
||||
log.error("iss thread failed to SCRAM reactor on exit")
|
||||
log.error("rps thread failed to SCRAM reactor on exit")
|
||||
end
|
||||
end
|
||||
log.info("iss thread exiting")
|
||||
log.info("rps thread exiting")
|
||||
break
|
||||
end
|
||||
|
||||
-- delay before next check
|
||||
last_update = util.adaptive_delay(ISS_SLEEP, last_update)
|
||||
last_update = util.adaptive_delay(RPS_SLEEP, last_update)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -331,9 +331,9 @@ threads.thread__comms_tx = function (smem)
|
||||
if msg.qtype == mqueue.TYPE.COMMAND then
|
||||
-- received a command
|
||||
if msg.message == MQ__COMM_CMD.SEND_STATUS then
|
||||
-- send PLC/ISS status
|
||||
-- send PLC/RPS status
|
||||
plc_comms.send_status(plc_state.degraded)
|
||||
plc_comms.send_iss_status()
|
||||
plc_comms.send_rps_status()
|
||||
end
|
||||
elseif msg.qtype == mqueue.TYPE.DATA then
|
||||
-- received data
|
||||
|
||||
Reference in New Issue
Block a user