This guide details the plugin's AVNAVSIM.ini configuration options and override mechanisms for the K140 Autopilot. It is intended for advanced users looking to integrate, customize, and optimize the K140 to achieve an autopilot experience tailored to their specific aircraft and simulation needs.
The primary configuration parameter, K140_config, is encoded as a decimal value that results from converting a binary number. Each set bit activates a specific override function:
BIT 0 (Value = 1): Compatibility Mode – Try this mode if autopilot control or interfacing issues occur with your aircraft
BIT 1 (Value = 2): Sync Baro Settings – Synchronizes the autopilot’s BARO setting automatically with the aircraft’s BARO setting
BIT 2 (Value = 4): Disable Trim Voice Alerts – Suppresses trim-related alerts
BIT 3 (Value = 8): Disable Autopilot Disconnect/Altitude Alerts – Prevents audio alerts on autopilot disconnect or altitude capture
; K140_config
; BIT 0 : 1 = Compatibility Mode (use this if you have issues with the K140 and your aircraft)
; BIT 1 : 2 = Sync Autopilot Baro Setting with Aircraft Baro Setting
; BIT 2 : 4 = Disable Trim Voice Alerts
; BIT 3 : 8 = Disable Autopilot Disconnect and Altitude Voice Alerts
;Enable compatibility and disable trim voice alerts: 1 + 4 = 5
K140_config = 5
Backlight Colour
The backlight colour of your K140 panel is configurable via the backlight_colour parameter. This parameter accepts a decimal value derived from the panel’s RGB colour. A typical approach involves selecting your desired colour using an RGB colour picker like RGB Color Picker and converting the hex code to its decimal equivalent.
; Lets have a green backlight
; rgb(0, 255,0) = #00FF00 = 65280
backlight_colour = 65280
backlight_colour sets the initial value of the avnavsim/k140/backlight_colour dataref, which is the default mapping of Data_LIGHTING_INSTRUMENTS_COLOUR. You have the option of driving this dataref from something else, for example a Lua script, or even an entirely different dataref, maybe one driven by a cockpit colour picker?
NOTE: To switch on or adjust the backlight's brightness, either locate and tweak the cockpit lighting knob that controls the dataref mapped to Data_LIGHTING_INSTRUMENTS_BRIGHTNESS (see below), or override that mapping with an alternative dataref with a float value of between 0.0 and 1.0
Various data sources can be overridden. You can discover which data sources are used by the K140 by examining Log.txt in the X-Plane directory. After the X-Plane plugin has successfully connected to the K140. You will see similar messages to this:
AVNAV/SIM: RX: SUB: 202434 : 21 : Data_LIGHTING_INSTRUMENTS_BRIGHTNESS : sim/cockpit2/switches/instrument_brightness_ratio[0] : 0 : 2
AVNAV/SIM: RX: SUB: 202435 : 22 : Data_LIGHTING_INSTRUMENTS_COLOUR : avnavsim/k140/backlight_colour : 0 : 0
To change the source dataref of Data_LIGHTING_INSTRUMENTS_BRIGHTNESS to a different dataref you would add a line similar to this to the AVNAVSIM.ini file:
Data_LIGHTING_INSTRUMENTS_BRIGHTNESS = sim/cockpit2/switches/some_other_data_ref
To see any overrides that have been applied to the aircraft you are flying - overrides are reported in the logs each time an aircraft is loaded e.g.
AVNAV/SIM: Bound : Data_LIGHTING_INSTRUMENTS_BRIGHTNESS to override dataref: sim/cockpit2/switches/some_other_data_ref
NOTE: You must only override a dataref by mapping it to another with the same type (e.g. int, float) and value range see X-Plane datarefs
Customizing how hardware buttons trigger X‑Plane commands is another powerful feature of the K140 plugin. For instance, to have the autopilot FD button activate a specific X‑Plane command (e.g., laminar/c90/avionics/switch/fd) only for the specific_aircraft.acf, add the following configuration:
[specific_aircraft.acf]
Command_Action_AUTOPILOT_FD_BUTTON = laminar/c90/avionics/switch/fd
To see which Command_Actions the K140 activates on pressing a button, check X-Plane's Log.txt
Note: When the K140 is not in compatibility mode, some buttons may not trigger a Command_Action... In this case they can not be mapped to other X-Plane commands