Overview
X-Plane provides a plugin system to allow hardware to interact with it. The plugin system provides a large number of Commands and Datarefs that can be used by the hardware to control the aircraft in X-Plane.
What are Commands?
When Commands are sent to X-Plane, it cause something to happen to the aircraft or X-Plane itself. An example of a Command is sim/magnetos/magnetos_off, which would set the currently loaded aircrafts starter switch to the magnetos off position. Assigning a Command to a Component, such as a button triggers the Command to be sent to X-Plane when the button is used e.g. pushing the button would set the aircrafts magnetos to the off position.
Sending Commands will almost certainly change the value of at least one Dataref (see below) and sometimes it may change the value of many Datarefs.
A full list of standard Commands and their meaning can be found in your <X-Plane directory>\Resources\plugins\Commands.txt
What are Datarefs?
Datarefs record the state of the aircraft and the virtual world in X-Plane. E.g. a real aircraft has actual moving flaps with sensors and hydraulic pressure readings etc. A flight simulator needs a way to mimic these things and record their state. An example of a Dataref is sim/cockpit/electrical/battery_on, which has a value of 1 when the aircrafts battery is on, and a value of 0 when the battery is off.
All Datarefs can be read i.e. their values retrieved and processed in some way. Some Datarefs can also be written to, i.e. their value forced to be a specific value.
Datarefs are ideal for Components such as LED's because they can be used in logical expressions that result in true or false (light on/state 1 or light off/state 0). For example if the Dataref sim/cockpit/electrical/battery_on, was assigned to an LED Component and the result of the logical expression returned true, the LED would be lit and you would know that their was battery power available in the aircraft.
Datarefs are also used for Component Displays. E.g. the Dataref sim/cockpit/autopilot/heading_mag, displays the desired heading programmed into the aircrafts autopilot. Using this Dataref on a Display would show the value in the display e.g. 020 degrees.