Modeling Failures
X-Plane controls the failure of any particular component or device by defining a list of failure related states. Each state is represented by a numerical value. These values, taken together as a group, is called the failure_enum, which is a programming term for an Enumerated list. The list of failure states and their values is shown below. Whenever you hear someone say "the failure enum", then they are referring to this group of values.
Inside X-Plane, you can access a failure dialog window (see image at right), and for each failure you can access a pulldown menu which mirrors these failure enum values.
0 = always working
1 = mean time until failure
2 = exact time until failure
3 = fail at exact speed KIAS
4 = fail at exact altitude AGL
5 = fail if CTRL f or JOY
6 = failed
The active failure_enum value of any particular failure are contained within X-Plane failure datarefs. Whenever you configure a failure using X-Plane's failures GUI, then X-Plane simply sets the relevant failure dataref to one of the above failure_enum values. These values are writable, so you can also set them yourself via plugin or script. The most common values are 0 and 6 for always working and failed respectively. The other values simply tell X-Plane when to implement the failure. Once the failure is triggered, the failure dataref value will always change to 6. Restoring operation is simply a matter of changing the failure dataref back to 0.
All default failure dataref names that are characterized by having the word /failures/ in the dataref name. Many dataref names also have the prefix "/rel_ in their dataref suffix (the last part of the datref name), but not all do. You can browse all of X-Plane's failure datarefs using Laminar's Dataref Browser and searching: /failures. There are over 800 failure datarefs available. Below are some representative examples of failure dataref names.
sim/flightmodel/failures/aoa_ice
sim/flightmodel/failures/window_ice
sim/operation/failures/rel_aftbur1
sim/operation/failures/rel_bad_mpr
sim/operation/failures/rel_bird_strike_eng1
Failures for OFF
Now even though these datarefs are called failures, it is sometimes better to think of them in terms of working and not working. From the pilot's perspective, a failure is simply something 'not working', and the root cause behind the failure does not matter during the flight in a lot of cases. X-Plane is not a maintenance simulator, its a flight simulator. If you want to simulate the root cause of some failure, you will have to do so yourself via plugin and set these failure datarefs yourself.
The benefit to thinking of these datarefs in this way, is that you can use these datarefs to simulate other things that may keep something from not working, like circuit breakers.
Its common for 3rd party devs, through plugin or script, to simulate internal control components X-Plane does not, such as magnetic relays or other switching logic, and determine their own working states and when appropriate, subsequently "fail" an affected X-Plane component by writing to these datarefs.