HOME Blog SimVimCockpit SimVimPanel Baron-58 sim ArdSimX About/Donate
OverviewFunction listCustom data I/OConfiguration file format

Details about Input Configuration File

!!! Data format described on this page are related to ArdSim library ONLY.

The latest ArdSimX Interface uses other configuration format.

The input configuration file is the list of commands or datarefs that will be sent to X-Plane on response to a button click or switch on/off action. Each direct input is represented by the prefix "D" with pin number and "+" or "-" symbols for on/off actions followed by the command/dataref controlled with this input.

Toggle switch configuration

To configure input as toggle switch use a pair of command lines with "+" for switch-On and "-" for switch-Off action:

D12+    sim/...../COMMAND_1
D12-     sim/...../COMMAND_2

Button configuration

To configure input as a button only one command line is needed with "+" or "-" sign depending of when the command will be executed - "on button push" or "on button release".

Example: Nav1 stanby/active flip button. Command is sent when button is clicked (on-push):

D2+     sim/radios/nav1_standy_flip

Example: Reset timer button. Command is sent when button is released after click :

D32-     sim/instruments/timer_reset

The "on-release" action for button can be useful for some parameters, when you can think a little after the button is already clicked before you decide to release it and send command.

Also, this can be useful when some command always needs to be sent just after the previously initiated command (both +/- actions are used for one button):

D6+    sim/...../COMMAND_1
D6-     sim/...../COMMAND_2

Multiple configurations for one switch/button

You can assign more that one command to one button or switch action. Just add the line with the same input ID and another command after it:

D7+    sim/...../COMMAND_1
D7+    sim/...../COMMAND_2

In this example the timer will reset every time the landing gear switch is turned UP (not practical, just for example):

D7+    sim/flight_controls/landing_gear_up
D7-     sim/flight_controls/landing_gear_down

D7+     sim/instruments/timer_reset

Using datarefs in input configuration

If there is no suitable command for some action or if you need to change the value of a specific dataref directly, you should specify the dataref string and its value in the config file (including custom datarefs). On the button or switch action the dataref will be set (changed) to this value or incremented.

In this example the button on digital pin 10 sets the dataref value (TOGA pith) to 15 degrees.

D10+     sim/cockpit2/autopilot/TOGA_pitch_deg    15

Adding the "+" or "-" sign at the end of the value you can increment or decrement the dataref by the given value with the assigned actuator, instead of setting the value. This is used for encoders, but sometimes you would need increment buttons for a dataref.

Example: Artificial horizon pitch-reference adjustment, pilot side, two buttons on Arduino pin #6,7 are used (increment by 1 degr.):

D6+    sim/cockpit2/gauges/actuators/artificial_horizon_adjust_deg_pilot     1+
D7+    sim/cockpit2/gauges/actuators/artificial_horizon_adjust_deg_pilot     1-

Actually, for this example with horizon reference there is a pair of commands:

D6+    sim/instruments/ah_ref_up
D7+    sim/instruments/ah_ref_down

In most cases to increment/decrement some parameter value you can choose commands.

If your chosen dataref is an array (such as engine data for a multi-engine aircraft), you can also add the array index number after the value (starting with 1). Otherwise, the default array number will be 1.

D12+     sim/cockpit2/engine/actuators/prop_mode    0   2

In this example we set the propeller of engine #2 to feather mode (0). And, there is no sutable command to replace this dataref.

Set "repeat" action for a button

This option can be useful for the "increment" command when a button sends the command once every time when it is clicked and starts to repeat the command continuously when held pressed for more than 1 second. For example, it can be a button to increment autopilot heading by 1 deg. ("sim/autopilot/heading_up").

Instead of "RepeatBtn" function previously used in the Arduino code, now you can just add one more "+" sign to the button ID that you want to act once on every click and then start repeating after 1 sec of hold. Here is example for the button on the pin #5 and button in the matrix node #23 ):

D5++    sim/...../COMMAND_1
B23++    sim/...../COMMAND_12

Now you don't need to configure "continued actions" with RepeatBtn() function, the commands that need to be sent repeatedly (such as starter and test buttons) are now handled automatically.

Note: You can use your old sketches written with previous library versions and compile them with library >3.4

Deprecated function "RepeatBtn" (not needed since library version 3.4)

"Repeat" function with pin number was used for continuously repeated command for this button: RepeatBtn ( 11 ),
or for repeat after 1 sec. hold button (before ver. 3.4): RepeatBtn ( 5, HOLD )

D11+    sim/starters/engage_starter_1
D5+    sim/radios/obs_HSI_up

Input configuration file format for encoders

In the input configuration file each encoder has two lines that configure action for both rotation direction (the prefix 'E' with number of this encoder and "+" or "-" symbol that defines rotation direction and the command (dtaref) for each direction

E6+    sim/...../COMMAND_1
E6-     sim/...../COMMAND_2

If the encoder has additional modes switched by internal button the ID should include: the letter 'E' with number of this encoder, then the symbol "/" followed by mode number and "+" or "-" symbol. For example, for encoder #1 with two modes for adjusting Com1 frequency insert two pairs of lines in the config file:

E1/1+    sim/radios/actv_com1_coarse_up
E1/1-     sim/radios/actv_com1_coarse_down
E1/2+    sim/radios/actv_com1_fine_up
E1/2-     sim/radios/actv_com1_fine_down

This example with two modes is the same for both "push and hold" and "click to switch" button modes. Encoder with 3-8 modes (E1/8+, E1/8- ) is configuring for "click to switch" button.

Using DataRefs
Generally, you can choose suitable command for your input control in most cases. Full list of commands currently used you can find in the text file Commands.txt in the Resources/plugins folder. A dataref always used to read parameters value for data output, but you can use it for input and change it's value if this dataref is writable.

If you have to use a dataref for encoder instead of a command (or if there is no suitable command) write this dataref after the ID and add the value of increment with "+" or "-" which will be added to this dataref value on each step of encoder rotation:

E2+    sim/cockpit2/...../...../DATAREF_1    0.01-
E2-     sim/cockpit2/...../...../DATAREF_1    0.01+

For encoder with additional modes add pair of lines for each mode, as described above, with alternative increment value for this dataref.

Configuration for encoders having external mode switching buttons
When you use external buttons for switching between various modes of the encoder the ID for such encoder includes letters instead of numbers.

With the Encoder Mode function you can assign several buttons that will set different modes for the chosen encoder, for example the Cirrus instrument panel with the Avidyne primary flight display has encoders with four switchable modes:

One of the encoders adjusts four parameters: 1) Autopilot Heading Bug, 2) Autopilot Altiude, 3) Autopilot VS and 4) Barometer set.
You can set these 4 modes (named as 'H', 'A', 'V', 'B') with the function "EncModeBtn" for the buttons connected to Arduino pins or matrix nodes: Mode change buttons.

Add four pairs of lines to your input config file - for each mode button. The ID should consist of the letter 'E' with encoder number (E3 here for example) and the chosen mode letter after the '/' symbol with "+" or "-" for rotation direction:

       # . . . 'H' mode - Heading change . . . :
E3/H+    sim/autopilot/heading_up
E3/H-     sim/autopilot/heading_down
       # . . . 'A' mode - Altitude change . . . :
E3/A+    sim/autopilot/altitude_up
E3/A-     sim/autopilot/altitude_down
       # . . . 'V' mode - Vertical speed change . . . :
E3/V+    sim/autopilot/vertical_speed_up
E3/V-     sim/autopilot/vertical_speed_down
       # . . . 'B' mode - Barometer change . . . :
E3/B+    sim/instruments/barometer_up
E3/B-     sim/instruments/barometer_down

© Copyright 2012-2016 - SimVim Design