Skip to content

Supervisor Legacy Config

Mikayla edited this page May 4, 2024 · 2 revisions

Warning

ARCHIVED PAGE: The supervisor no longer uses a config.lua file. Please see the page on the Supervisor Configurator.

For details on common fields, see this page. Supervisor specific fields are identified below.

This config file includes all 5 networking channels as the supervisor is the center of all the action. It therefor has four COMMS_TIMEOUT-like fields, one per each device type that can connect.

Here you must define the number of reactors (4 in the below example) and their cooling configurations. This system supports a maximum of 2 boilers and 3 turbines per unit, because as per the Mekanism documentation, this is what is required to operate a max size reactor (plus, the UI was designed around that so it won't fit any more). If you have more than this, that isn't supported as of now. Additionally, you may specify if this unit has a dynamic tank used for emergency cooling. If your tanks aren't per unit, see the advanced facility dynamic tank configuration below.

This example is for four units, so with two for example you would only have two rows in REACTOR_COOLING. This configuration is sent to the coordinator on connection establish so that the coordinator knows how many units there are and how they are cooled, so it knows what to render.

local config = {}

-- supervisor comms channel
config.SVR_CHANNEL = 16240
-- PLC comms channel
config.PLC_CHANNEL = 16241
-- RTU/MODBUS comms channel
config.RTU_CHANNEL = 16242
-- coordinator comms channel
config.CRD_CHANNEL = 16243
-- pocket comms channel
config.PKT_CHANNEL = 16244
-- max trusted modem message distance 
-- (0 to disable check)
config.TRUSTED_RANGE = 0
-- time in seconds (>= 2) before assuming a remote
-- device is no longer active
config.PLC_TIMEOUT = 5
config.RTU_TIMEOUT = 5
config.CRD_TIMEOUT = 5
config.PKT_TIMEOUT = 5
-- facility authentication key 
-- (do NOT use one of your passwords)
-- this enables verifying that messages are authentic
-- all devices on this network must use this key
-- config.AUTH_KEY = "SCADAfacility123"

-- expected number of reactors
config.NUM_REACTORS = 4
-- expected number of devices for each unit
config.REACTOR_COOLING = {
-- reactor unit 1
{ BOILERS = 1, TURBINES = 1, TANK = false },
-- reactor unit 2
{ BOILERS = 1, TURBINES = 1, TANK = false },
-- reactor unit 3
{ BOILERS = 1, TURBINES = 1, TANK = false },
-- reactor unit 4
{ BOILERS = 1, TURBINES = 1, TANK = false }
}
-- advanced facility dynamic tank configuration
-- (see wiki for details)
-- by default, dynamic tanks are for each unit
config.FAC_TANK_MODE = 0
config.FAC_TANK_DEFS = { 0, 0, 0, 0 }

-- log path
config.LOG_PATH = "/log.txt"
-- log mode
--  0 = APPEND (adds to existing file on start)
--  1 = NEW (replaces existing file on start)
config.LOG_MODE = 0
-- true to log verbose debug messages
config.LOG_DEBUG = false

return config

Advanced Facility Dynamic Tank Configuration

-- advanced facility dynamic tank configuration
-- (see wiki for details)
-- by default, dynamic tanks are for each unit
config.FAC_TANK_MODE = 0
config.FAC_TANK_DEFS = { 0, 0, 0, 0 }

These two options allow assigning dynamic tanks as facility devices, then indicating which units they are connected to. There are a total of 8 facility tank modes, not including mode 0, which is just unit-only tanks. Each mode defines both how many dynamic tanks are expected, and which units are connected to which. There are limits to how the modes work, since devices need to be in order to allow them to be rendered properly, so you may have to re-index your units if you have creative cooling layouts.

Example layout: A A B C

That defines that there are 3 total facility tanks (A, B, C) and facility tank 1 (A) is connected to units 1 & 2. Tank 2 (B) is connected to unit 3, then tank 3 is connected to unit 4.

The tank modes are as follows ('Mode' is the value to use for FAC_TANK_MODE):

Mode Total Facility Tanks Layout
1 1 A A A A
2 2 A A A B
3 2 A A B B
4 2 A B B B
5 3 A A B C
6 3 A B B C
7 3 A B C C
8 4 A B C D

For the FAC_TANK_DEFS, it must be a table with the same length as the number of units. Each entry defines how that unit should be connected, so in conjunction with the mode, the system is then able to determine your layout.

  • A 0 means that unit has no connection to any dynamic tank.
  • A 1 means that unit is connected to its own tank. This can be done for any unit in any facility mode.
  • A 2 means that unit is connect to a facility dynamic tank.

For example, if Unit 1 in mode 2 is set to 1 and the rest are set to 2, the system would interpret that as one dynamic tank for reactor 1, then two dynamic tanks for the facility. Facility tank 1 would connect to units 2 and 3, and tank 2 would connect to unit 4. That would look like:

config.FAC_TANK_MODE = 2
config.FAC_TANK_DEFS = { 1, 2, 2, 2 }
Clone this wiki locally