Legacy Electrical System
This section controls everything related to the aircraft electrical systems. An electrical system is defined by its components, of which there are 5 types:
- circuits: A circuit consumes power, requiring current to function (see Circuits for governing SimVars).
- batteries: A battery is a power source with a set capacity in ampere hours (see Batteries for governing SimVars).
- alternators: The alternator is a power source dependent on an engine/APU’s RPM (see Alternators for governing SimVars).
- external power: This is an external power source which delivers power as long as it is available (see External Power for governing SimVars).
- buses: a bus is what creates connections between systems and sub-systems (see General / Buses for governing SimVars).
Each of these components can be defined multiple times as parameters within the [ELECTRICAL] configuration header. For how to access the information that these parameters add to an aircraft, please see the section on SimVars And RPN.
Parameter
Description
Type
Required
Major
What version of the electrical system you are using. Can be one of the following:
- 0: This is for aircraft using the legacy FSX electrical system. When using this version, none of the components are used, only the parameters listed here: Deprecated FSX Parameters
- 1: This should be used for those aircraft imported from Microsoft Flight Simulator 2020. When using this version, all the parameters listed below are valid, but only the following components can be used - circuits, batteries, alternators, external power, buses.
- 2: This is the most up to date version of the electrical system only the components listed here can be used to define the electrical system.
Integer
Yes
Minor
Not currently used. Should be set to 0.
Integer
Yes
circuit.N
The aircraft circuit hash table. You can define multiple circuits for an aircraft, starting at N = 1. Details on the circuit map contents are given here: circuit.N
Yes
battery.N
The aircraft battery hash table. You can define multiple batteries for an aircraft, starting at N = 1. Details on the map contents are given here: battery.N
(see for more information)
Yes
alternator.N
The aircraft alternator hash table. You can define multiple alternators for an aircraft, starting at N = 1. Details on the map contents are given here: alternator.N
Yes
externalpower.N
The aircraft external power supply hash table. You can define multiple external power supplies for an aircraft, starting at N = 1. Details on the map contents are given here: externalpower.N
Yes
bus.N
The aircraft bus hash table. You can define multiple buses for an aircraft, starting at N = 1. Details on the map contents are given here: bus.N
Yes
curve.N
A list of values. You can define multiple curves for an aircraft, starting at N = 1, and the curves can be used in multiple different parameters. Details on the table contents are given here: curve.N
List of Values
Yes
procedure.N
A List of values used to create a set of actions that can either be manually triggered or triggered when entering a given context. You can define multiple procedures for an aircraft, starting at N = 1. Details on the table contents are given here: procedure.N
No
max_battery_voltage
The maximum battery voltage.
Float
Yes
generator_alternator_voltage
The generator alternator voltage.
Float
Yes
max_generator_alternator_amps
The maximum alternator amperage.
Float
Yes
alternators
Set to TRUE (1) to indicate that alternators are available, or FALSE (0) otherwise.
Bool
Yes
num_batteries
The number of batteries available.
Integer
Yes
electric_always_available
Set to TRUE(1) to always enable electrical equipment, otherwise set to FALSE(0).
Bool
Yes
battery_capacity_pct_to_voltage
Can be used to override default settings for correspondence between % Max Battery Capacity and voltage.
Table
No
battery_max_capacity_amph
Can be used to override the default Battery Capacity (in AH). Default is 24 or 42 depending on Battery Voltage.
Float
No
battery_charging_current
Controls the battery’s charging current (In Amps). Default is 10% of the capacity.
Float
No
apu_pct_rpm_per_second
Controls the speed at which the APU’s RPM increases. Default is 0.4.
Float
No
navcom1
Can be used to override default settings for the NAVCOM1 electrical circuit.
List of Values
Defines the electrical circuit used by the given system. Requires a list of three values where:
- the first is the bus on which this circuit was connected, one fo the following values:
- 0: MAIN BUS
- 1: AVIONICS BUS
- 2: BATTERY BUS
- 3: HOT BATTERY BUS
- 4: GENALT 1 BUS
- 5: GENALT 2 BUS
- 6: GENALT 3 BUS
- 7: GENALT 4 BUS
- 8: GENALT 5 BUS
- 9: GENALT 6 BUS
- 10: GENALT 7 BUS
- 11: GENALT 8 BUS
- the second is the Max Amps supported by the circuit.
- the third is the min voltage for the circuit to be operative.
Default values are: 0, 15, 0.7 * max_battery_voltage
No
navcom2
Can be used to override default settings for the NAVCOM2 electrical circuit.
navcom3
Can be used to override default settings for the NAVCOM3 electrical circuit.
flap_motor
Can be used to override default settings for the flaps motor circuit.
gear_motor
Can be used to override default settings for the landing gear motor circuit.
autopilot
Can be used to override default settings for the autopilot circuit.
avionics_bus
Can be used to override default settings for the avionics bus circuit.
avionics
Can be used to override default settings for the avionics circuit.
pitot_heat
Can be used to override default settings for the pitot heat circuit.
additional_system
Can be used to override default settings for the additional systems circuit.
marker_beacon
Can be used to override default settings for the marker beacon circuit.
gear_warning
Can be used to override default settings for the gear warning circuit.
fuel_pump
Can be used to override default settings for the fuel circuit.
starter1
Can be used to override default settings for the engine 1 starter circuit.
starter2
Can be used to override default settings for the engine 2 starter circuit.
starter3
Can be used to override default settings for the engine 3 starter circuit.
starter4
Can be used to override default settings for the engine 4 starter circuit.
light_nav
Can be used to override default settings for the navigation light circuit.
light_beacon
Can be used to override default settings for the beacon light circuit.
light_landing
Can be used to override default settings for the landing light circuit.
light_taxi
Can be used to override default settings for the taxi light circuit.
light_strobe
Can be used to override default settings for the strobe light circuit.
light_panel
Can be used to override default settings for the panel light circuit.
light_cabin
Can be used to override default settings for the cabin light circuit.
light_recognition
Can be used to override default settings for the recognition light circuit.
light_wing
Can be used to override default settings for the wing light circuit.
light_logo
Can be used to override default settings for the logo light circuit.
prop_sync
Can be used to override default settings for the prop-sync circuit.
auto_feather
Can be used to override default settings for the auto-feather circuit.
auto_brakes
Can be used to override default settings for the auto-brake circuit.
standby_vacuum
Can be used to override default settings for the standby vacuum circuit.
hydraulic_pump
Can be used to override default settings for the hydraulic pump circuit.
fuel_transfer_pump
Can be used to override default settings for the fuel transfer pump circuit.
propeller_deice
Can be used to override default settings for the propellor de-ice circuit.
directional_gyro
Can be used to override default settings for the directional gyro circuit.
directional_gyro_slaving
Can be used to override default settings for the directional gyro slaving circuit.
circuit.N
Circuits are the most used electrical components, and the circuit hash map is comprised of the following multiple key:value pairs, separated by the # symbol. This hash map takes the following form:
circuit.N = Type:<circuit_type>:<index> #Connections:<bus:max_amp> #Power:<table> #Name:<debug_name>
``<code>
Note that you may have more than one circuit of the same type, in which case you would increment the </code><index><code> parameter, starting from 1. A full example of a single circuit definition would be like this:
</code>`<code> language-cpp
circuit.1 = Type:CIRCUIT_GENERAL_PANEL:1 #Connections:bus.1 #Power:0.5,1,20.0 #Name:General_Panel_Main
</code>``
<table><thead><tr class="header"><th>Key</th><th>Value</th><th>Description</th><th>Required</th></tr></thead><tbody><tr class="odd"><td><code>Type</code></td><td>List</td><td><p>List that contains the type of circuit being created along with an identifying index for the circuit type (in case you wish to define multiple circuits of the same type). You can find a complete list of the available variables here: <a href="electrical-system-setup-information/#Type">Circuit Types</a>.</p><p>Additionally, when defining a type, you also give it an index value so that different circuits of the same type can be identified. For example:</p><pre class="codeblock"><code>circuit.15 = Type:CIRCUIT_FUEL_PUMP:1#Connections:bus.2#Power:3,5,20#Name:Fuel_P_L1
circuit.16 = Type:CIRCUIT_FUEL_PUMP:2#Connections:bus.2#Power:3,5,20#Name:Fuel_P_L2
circuit.17 = Type:CIRCUIT_FUEL_PUMP:3#Connections:bus.2#Power:3,5,20#Name:Fuel_P_R1
circuit.18 = Type:CIRCUIT_FUEL_PUMP:4#Connections:bus.2#Power:3,5,20#Name:Fuel_P_R2</code></pre></td><td>Yes</td></tr><tr class="even"><td><code>Connections</code></td><td>List</td><td><p><a href="../cfg-files-general-information/#list">List</a> of the different buses that this circuit is connected to, eg:</p><p><code>Connections: bus.1, bus.3</code></p><p>You can find more information from the following section: <a href="#Connections">Connections</a></p></td><td>Yes</td></tr><tr class="odd"><td><code>Power</code></td><td>List</td><td><p>This list of three values is related to the power consumption, where:</p><ul><li>1st value: A minimum Watt consumption</li><li>2nd value: A maximum/ideal Watt consumption</li><li>3rd value: A minimum voltage</li></ul><p>Here is an example of how this key/value pair is structured:</p><pre class="language-cpp"><code>Power:10.0, 15.0, 20.0</code></pre><p>You can find a full and detailed explanation of what these values refer to from the following section: <a href="#Power">circuit.N - Power</a></p></td><td>Yes</td></tr><tr class="even"><td><code>Name</code></td><td>String</td><td>The name of the circuit. This is an identifier name and is only added for debugging purposes. Cannot contain special characters or spaces.</td><td>No</td></tr></tbody></table>
#### [circuit.N](#circuit) - Type
When defining circuits for the electrical system, the first parameter of the hash-map that is a variable that defines the **type** of circuit. The table below shows all the variables that correspond to each of the available types as well as a brief description of what that circuit controls.
<table><thead><tr class="header"><th>Type</th><th>Description</th></tr></thead><tbody><tr class="odd"><td><code>CIRCUIT_ADC_AHRS</code></td><td><p>Circuit checked for <a href="#" class="glossterm">ADC</a> and <a href="#" class="glossterm">AHRS</a> system availability, no effect on sim</p></td></tr><tr class="even"><td><code>CIRCUIT_ADF_DME</code></td><td><p>Circuit checked for <a href="#" class="glossterm">ADF</a> and <a href="#" class="glossterm">DME</a> system availability, no effect on sim</p></td></tr><tr class="odd"><td><code>CIRCUIT_APU_STARTER</code></td><td><p>Circuit controlling <a href="#" class="glossterm">APU</a> starter state</p></td></tr><tr class="even"><td><code>CIRCUIT_AUDIO</code></td><td><p>Circuit checked for audio system availability</p></td></tr><tr class="odd"><td><code>CIRCUIT_ATTITUDE_INDICATOR</code></td><td>Circuit checked for attitude indicator availability (if electrical)</td></tr><tr class="even"><td><code>CIRCUIT_AUTO_BRAKES</code></td><td><p>Circuit controlling auto brakes</p></td></tr><tr class="odd"><td><code>CIRCUIT_AUTO_FEATHER</code></td><td><p>Circuit controlling auto feathering</p><p><strong></strong><strong>NOTE</strong>: Please see the <a href="../engines_cfg/#note_autofeather"></a> for more information.</p></td></tr><tr class="even"><td><code>CIRCUIT_AUTOPILOT</code></td><td><p>Circuit checked for autopilot availability</p></td></tr><tr class="odd"><td><code>CIRCUIT_AVIONICS</code></td><td><p>Circuit checked for avionics availability</p></td></tr><tr class="even"><td><code>CIRCUIT_AVNFAN</code></td><td><p>Circuit checked for avionics fan system availability, no effect on sim</p></td></tr><tr class="odd"><td><code>CIRCUIT_COM</code></td><td><p>Circuit checked for COM system availability</p></td></tr><tr class="even"><td><code>CIRCUIT_DIRECTIONAL_GYRO</code></td><td><p>Circuit checked for directional gyro system availability</p></td></tr><tr class="odd"><td><code>CIRCUIT_DIRECTIONAL_GYRO_SLAVING</code></td><td><p>Circuit checked for directional gyro slaving system availability</p></td></tr><tr class="even"><td><code>CIRCUIT_ELECTRIC_ENGINE</code></td><td>Circuit controlling the electric engine (if available).</td></tr><tr class="odd"><td><code>CIRCUIT_FIS</code></td><td><p>Circuit checked for <a href="#" class="glossterm">FIS</a> system availability, no effect on sim</p></td></tr><tr class="even"><td><code>CIRCUIT_FLAP_MOTOR</code></td><td><p>Circuit turned on when flaps are moving (if electrical)</p></td></tr><tr class="odd"><td><code>CIRCUIT_FUEL_PUMP</code></td><td><p>Circuit controlling electrical fuel pumps. See the section on <code> </code> for more information.</p></td></tr><tr class="even"><td><code>CIRCUIT_FUEL_TRANSFER_PUMP</code></td><td><p>Circuit controlling electrical fuel transfer pumps</p></td></tr><tr class="odd"><td><code>CIRCUIT_FUEL_VALVE</code></td><td>Circuit controlling a <a href="../Flight_Model/fuel_system.htm"><code>[FUEL_SYSTEM]</code></a> valve. See the section on <code> </code> for more information.</td></tr><tr class="even"><td><code>CIRCUIT_GEAR_MOTOR</code></td><td><p>Circuit turned on when landing gears are moving (if electrical)</p></td></tr><tr class="odd"><td><code>CIRCUIT_GEAR_WARNING</code></td><td><p>Circuit checked for gear warning system availability</p></td></tr><tr class="even"><td><code>CIRCUIT_GENERAL_PANEL</code></td><td><p>Circuit checked for general power availability</p></td></tr><tr class="odd"><td><code>CIRCUIT_GPS</code></td><td><p>Circuit checked for avionics <a href="#" class="glossterm">GPS</a> system availability</p></td></tr><tr class="even"><td><code>CIRCUIT_HYDRAULIC_PUMP</code></td><td><p>Circuit controlling electric hydraulic pumps</p></td></tr><tr class="odd"><td><code>CIRCUIT_INVALID</code></td><td><p>Invalid circuit which has no direct impact on sim state</p></td></tr><tr class="even"><td><code>CIRCUIT_LIGHT_BEACON</code></td><td><p>Circuit controlling beacon light state</p></td></tr><tr class="odd"><td><code>CIRCUIT_LIGHT_CABIN</code></td><td><p>Circuit controlling cabin light state</p></td></tr><tr class="even"><td><code>CIRCUIT_LIGHT_GLARESHIELD</code></td><td><p>Circuit controlling glareshield light state</p></td></tr><tr class="odd"><td><code>CIRCUIT_LIGHT_LANDING</code></td><td><p>Circuit controlling landing light state</p></td></tr><tr class="even"><td><code>CIRCUIT_LIGHT_LOGO</code></td><td><p>Circuit controlling logo light state</p></td></tr><tr class="odd"><td><code>CIRCUIT_LIGHT_NAV</code></td><td><p>Circuit controlling navigation light state</p></td></tr><tr class="even"><td><code>CIRCUIT_LIGHT_PANEL</code></td><td><p>Circuit controlling panel light state</p></td></tr><tr class="odd"><td><code>CIRCUIT_LIGHT_PEDESTAL</code></td><td><p>Circuit controlling pedestal light state</p></td></tr><tr class="even"><td><code>CIRCUIT_LIGHT_RECOGNITION</code></td><td><p>Circuit controlling recognition light state</p></td></tr><tr class="odd"><td><code>CIRCUIT_LIGHT_STROBE</code></td><td><p>Circuit controlling strobe light state</p></td></tr><tr class="even"><td><code>CIRCUIT_LIGHT_TAXI</code></td><td><p>Circuit controlling taxi light state</p></td></tr><tr class="odd"><td><code>CIRCUIT_LIGHT_WING</code></td><td><p>Circuit controlling wing light state</p></td></tr><tr class="even"><td><code>CIRCUIT_MARKER_BEACON</code></td><td><p>Circuit checked for beacon marker system availability</p></td></tr><tr class="odd"><td><code>CIRCUIT_MFD</code></td><td><p>Circuit checked for <a href="#" class="glossterm">MFD</a> system availability, no effect on sim</p></td></tr><tr class="even"><td><code>CIRCUIT_NAV</code></td><td><p>Circuit checked for NAV system availability</p></td></tr><tr class="odd"><td><code>CIRCUIT_PFD</code></td><td><p>Circuit checked for <a href="#" class="glossterm">PFD</a> system availability, no effect on sim</p></td></tr><tr class="even"><td><code>CIRCUIT_PITOT_HEAT</code></td><td><p>Circuit controlling pitot heat state</p></td></tr><tr class="odd"><td><code>CIRCUIT_PROP_DEICE</code></td><td><p>Circuit controlling prop deicing</p></td></tr><tr class="even"><td><code>CIRCUIT_PROP_SYNC</code></td><td><p>Circuit controlling prop sync</p></td></tr><tr class="odd"><td><code>CIRCUIT_STALL_WARNING</code></td><td><p>Circuit checked for stall warning availability (if electrical)</p></td></tr><tr class="even"><td><code>CIRCUIT_STANDBY_VACUUM</code></td><td><p>Circuit controlling standby vacuum</p></td></tr><tr class="odd"><td><code>CIRCUIT_STARTER</code></td><td><p>Circuit controlling electrical starter state</p></td></tr><tr class="even"><td><code>CIRCUIT_TURN_COORDINATOR</code></td><td><p>Circuit checked for turn coordinator system availability</p></td></tr><tr class="odd"><td><code>CIRCUIT_WING_FOLD</code></td><td>Circuit controlling the wing folding system (if available).</td></tr><tr class="even"><td><code>CIRCUIT_XML</code></td><td><p>Generic circuit which has no direct impact on sim state</p></td></tr><tr class="odd"><td><code>CIRCUIT_XPNDR</code></td><td><p>Circuit checked for transponder system availability</p></td></tr></tbody></table>
#### [circuit.N](#circuit) - Power
This parameter takes a table of three values to define the power consumption, where:
- 1st value: A minimum Watt consumption
- 2nd value: A maximum/ideal Watt consumption
- 3rd value: A minimum voltage
These wattage values and minimum voltage let us define a range for the resistance (Ohm) used for interpolation when selecting a power setting for a circuit. By default a circuit aims for the maximum power setting (maximum/ideal Watt consumption).
In the simulation, an aircraft circuit functions in a similar way as they do in real life. The load (in amps) drawn by a circuit is defined by the received voltage divided by it's internal resistance. Below is an example of how this key/value pair is structured:
#Power:10.0, 15.0, 20.0Here the values represent: MinW=10W, MaxW=15W, MinV=20.0V.
Generated values for resistance are:
ResMin(Ohm) = 20.0/(10.0/20.0) # MinV / (MinW/MinV)-> resistance for min power settingResMax(Ohm) = 20.0/(15.0/20.0) # MinV / (MaxW/MinV)-> resistance for max power setting
Which means (using Ohm’s law(opens in a new tab)) that the circuit will consume:
I(Amps) = (Voltage / Resistance)I(Amps) = 20.0 / ResMax(Ohm) = 0.75A(at 20.0V and max power setting)I(Amps) = 28.0 / ResMax(Ohm) = 1.05A(at 28.0V and max power setting)I(Amps) = 20.0 / ResMin(Ohm) = 0.5A(at 20.0V and min power setting)I(Amps) = 28.0 / ResMin(Ohm) = 0.7A(at 28.0V and min power setting)
The power setting lets us have a variable resistance which can be used for any purposes. For example interior lights use this power setting for dimming. Moreover, in some situations, power might be limited. If the whole system is working using alternators then the power generated might not be enough to sustain every circuit. The power allocated to each circuit is then balanced as a proportion of the circuit MaxW value. A circuit will stay powered as long as the received power is higher than the MinW value and voltage is higher than MinV. This let us define priority in which system gets turned off first by lack of power. Reducing a circuit power setting will give more energy to the other circuits.
battery.N
A battery is a power supplier with a set capacity that decreases over time depending on the load it must sustain. The battery hash map is comprised of a set of key:value pairs, separated by the # symbol and takes the following form:
battery.N = Connections:<buses> #Capacity:<value> #Voltage:<curve_ref> #Name:<debug_name>A full example of a single battery definition would be like this:
battery.1 = Connections:bus.3 #Capacity:13.6 #Voltage:curve.1 #Name:Main_BatteryKey
Value
Description
Required
Connections
List
List of the different buses that this battery is connected to, eg:
Connections: bus.1, bus.3
You can find more information from the following section:
Yes
Capacity
Float
The battery capacity, in ampere hours.
VoltageCurve.N
The voltage for capacity percentage, defined using a curve (explained in the curve.N section).
Name
String
The name of the battery. This is an identifier name and is only added for debugging purposes. Cannot contain special characters or spaces.
No
alternator.N
This defines an alternator power source dependent on an engine/APU’s RPM, and the appended number corresponds to its unique ID (N, starting at 1). The alternator hash map is comprised of key:value pairs, separated by the # symbol, and takes the following form:
alternator.N = Connections:<buses> #iEng:<value> #Voltage:<curve_ref> #load:<curve_ref> #Name:<debug_name>or:
alternator.N = Connections:<buses> #iEng:<value> #RatedVoltage:<value> #load:<curve_ref> #Name:<debug_name>A full example of a single alternator definition would be like this:
alternator.1 = Connections:bus.3 #iEng:0 #RatedVoltage:28 #Load:curve.3 #Name:LH_Alternator| Key | Value | Description | Required |
|---|---|---|---|
Connections | List | List of the different buses that this alternator is connected to, eg:
You can find more information from the following section: Connections | Yes |
iEng | Integer | An engine index to get it's power from (starting at 0). This is only required if IsOnAPU is used and set to FALSE (0). | No |
Voltage | Curve.N | The voltage for the given RPM or %RPM, defined using a curve (explained in the curve.N section). This should only be supplied if the RatedVoltage parameter is not used. | No |
RatedVoltage | Float | The voltage that the alternator is rated for. This should only be supplied if the Voltage parameter is not used. | No |
Load | Curve.N | The load values based on RPM, defined using a curve (explained in the curve.N section). | Yes |
IsOnAPU | Bool | When this is set to TRUE (1), the alternator is linked to the APU instead of an engine. For an engine this can be omitted or set to FALSE (0). Note that if set to true, the iEng key should be omitted. | No |
Name | String | The name of the alternator. This is an identifier name and is only added for debugging purposes. Cannot contain special characters or spaces. | No |
externalpower.N
An external power source is a power supplier with a constant and infinite power output, and the appended number corresponds to its unique ID (N, starting at 1). The external power hash map is comprised of key:value pairs, separated by the # symbol, and takes the following form:
externalpower.N = Connections:<buses> #RatedVoltage:<value> #Load:<value> #Name:<debug_name>A full example of a single external power source definition would be like this:
externalpower.1 = Connections:bus.8 #RatedVoltage:28.5 #Load:400Key
Value
Description
Required
Connections
List
List of the different buses that this alternator is connected to, eg:
Connections: bus.1, bus.3
You can find more information from the following section: Connections
Yes
RatedVoltage
Float
The voltage that the alternator is rated for.
Integer
The load output, which is constant.
Name
String
The name of the external power source. This is an identifier name and is only added for debugging purposes. Cannot contain special characters or spaces.
No
bus.N
A bus is a hub for connecting different components (and other buses) to each other, and the appended number corresponds to its unique ID (N, starting at 1). The bus hash map is comprised of key:value pairs, separated by the # symbol, and takes the following form:
bus.N = Connections:<buses> #Name:<debug_name>A full example of a single bus definition would be like this:
bus.3 = Connections:bus.1, bus.2 #Name:Hot_Battery_BUS
| Key | Value | Description | Required |
|---|---|---|---|
Connections | List | List of the different buses that this bus is connected to, eg:
You can find more information from the following section: Connections | No |
Name | string | The name of the bus. This is an identifier name and is only added for debugging purposes. Cannot contain special characters or spaces. | No |
curve.N
The curve parameter is defined as a list of paired values, and the parameter is appended with a number that corresponds to its unique ID (N, starting at 1). The exact number of paired values that are in the curve will depend on the use the curve is going to get, since curves are used by other parameters to store information. For example, you may have defined a battery like this:
battery.1 = Connections:bus.3,bus.5 #Capacity:15.5 #Voltage:curve.1 #Name:Battery_MainIn this case, curve.1 references the battery voltage capacity, and would have been defined like this:
curve.1 = 0:21, 0.1:10.5, 0.5:12, 0.9:13, 1:13.4
procedure.N
Procedures are a set of actions that can either be manually triggered or triggered when entering a given context. Procedures are created one at a time and appended with a number that corresponds to its unique ID (N, starting at 1). They consist of a context and then a series of paired values telling the simulation what procedures (actions) to carry out within that context. The general structure for a procedure is as follow:
procedure.1 = <Context> #<action:id>,<value> #<action:id>,<value> #<action:id>,<value> #...When creating the procedure, the context can only be one of the following three constants:
| Context | Description |
|---|---|
None | No context, can only be manually triggered. |
Autostart | Triggered manually, or automatically when auto-starting the engines. |
Autoshutdown | triggered manually, or automatically when auto-shutting down the engines. |
Once you have the given context, you can add in the actions to be performed when the procedure is triggered (either manually or automatically) with each action separated by a #. Every action takes a given number of arguments and will manipulate the state of the system, and the actions themselves can only be one of the following constants:
| Action | Parameters | Description |
|---|---|---|
SetCir | ID, Bool | Set the circuit with the specified ID switch state to the specified Bool value |
SetBat | ID, Bool | Set the battery with the specified ID switch state to the specified Bool value |
SetAlt | ID, Bool | Set the alternator with the specified ID switch state to the specified Bool value |
SetExt | ID, Bool | Set the external power with the specified ID switch state to the specified Bool value |
SetCir2Bus_Con | ID(Bus), ID, Bool | Set the circuit with the specified ID to bus with the specified bus ID connection state to the specified Bool value |
SetBat2Bus_Con | ID(Bus), ID, Bool | Set the battery with the specified ID to bus with the specified bus ID connection state to the specified Bool value |
SetAlt2Bus_Con | ID(Bus), ID, Bool | Set the alternator with the specified ID to bus with the specified bus ID connection state to the specified Bool value |
SetExt2Bus_Con | ID(Bus), ID, Bool | Set the external power with the specified ID to bus with the specified bus ID connection state to the specified Bool value |
SetBus2Bus_Con | ID(Bus), ID, Bool | Set the bus with the specified ID to bus with the specified bus ID connection state to the specified Bool value |
SetCir2Bus_Brk | ID(Bus), ID, Bool | Set the circuit with the specified ID to bus with the specified bus ID breaker state to the specified Bool value |
SetBat2Bus_Brk | ID(Bus), ID, Bool | Set the battery with the specified ID to bus with the specified bus ID breaker state to the specified Bool value |
SetAlt2Bus_Brk | ID(Bus), ID, Bool | Set the alternator with the specified ID to bus with the specified bus ID breaker state to the specified Bool value |
SetExt2Bus_Brk | ID(Bus), ID, Bool | Set the external power with the specified ID to bus with the specified bus ID breaker state to the specified Bool value |
SetBus2Bus_Brk | ID(Bus), ID, Bool | Set the bus with the specified ID to bus with the specified bus ID breaker state to the specified Bool value |
SetCirPwr | ID, Percent | Set the circuit with the specified ID power setting to the specified percent value (0 to 100%) |
To see how this works in practice, let’s look at the following example:
procedure.1 = None#SetCir:5,0 #SetBat:1,1 #SetBus2Bus_Con:1,4,1In this example, the procedure will perform the following three actions when it is manually triggered (the context None will only work with manual triggers):
SetCir:5,0: Turn off the circuit with ID 5SetBat:3,1: Turn on the battery with ID 3SetBus2Bus_Con:1,4,1: Sets the bus with ID 1 to transfer electricity to the bus with ID 4
Triggering Procedures
As mentioned above, procedures can be manually triggered and/or auto triggered. Auto triggering is performed on engine start or shutdown - assuming the correct context is used - but manual triggering requires using the key event ELECTRICAL_EXECUTE_PROCEDURE (in WebAssembly or RPN or any other source). This key event requires 2 arguments to be passed with it, although the second one is optional:
- [0] = Procedure ID: This is the ID of the procedure to be triggered, for example to to trigger
procedure.3the index would be 3. - [1] = bInverse: This is a boolean value that, if omitted, will default to 0 (FALSE). If it is set to 1 (TRUE) then the procedure boolean values will be inverted when executing the procedure. For example, if the procedure has the action
SetCir:5,0, it will then becomeSetCir:5,1.
Connections
Connections define links between buses and power suppliers/consumers, and they are used in the circuit.N, battery.N, alternator.N, externalpower.N and bus.N parameters within the electrical system.
When defining a connection you need to give at least one target bus, specifying the ID value, eg:
Connections:bus.1, bus.3You may also, optionally, give a maximum amp value for the bus, separating it from the bus ID using a “:”. For example:
Connections:bus.1:3.25, bus.3:2.66This amp value is the amperage above which the breaker will automatically trigger, cutting the power flow through the bus. If this amp value is not defined, then the default behaviour is for the connection to sustain an infinite current.