Sim/cockpit/autopilot/autopilot state

From X-Plane SDK
Revision as of 13:15, 15 April 2009 by Gjmxplane (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This page was imported from the previous wiki engine. It needs a review and cleanup of formatting. Please see this page for more information.
! Enum Values

This dataref summarizes all of the possible state for the autopilot. The return value is a series of bit flags, as follows:

1	autothrottle
2	heading hold
4	wing leveler on
8	airspeed hold
16	vvi climb
32	altitude hold armed*
64	level change
128	auto-sync
256	hnav armed
512	hnav engaged
1024	gls armed**
2048   gls engaged**
(X-Plane 8.11 and newer only)
4096   fms vnav armed
8192   fms vnav engaged
16384  altitude hold engaged
  • Before 8.11 altitude was always 'armed'. In 8.11 the altitude becomes 'engaged' when level and not climbing to that altitude.
    • Before 8.11 FMS vertical was the same as glide slope.

Some bitflags will never occur together. For example, vnav cannot be engaged and armed at the same time.

In X-Plane 7.10-7.30 you __cannot__ change the autopilot mode by writing this dataref. Instead use XPLMCommandKeyStroke to send the appropriate key stroke commands to the sim to engage the autopilot in various ways.

X-Plane 860: airspeed hold no longer exists separately from level change. For now airspeed mode is aliased to level change.

! Setting the autopilot in 7.40.

Starting with X-PLane 7.40 you can write to this dataref to activate the autopilot. Write to the dataref with the bit set for each function you want to simulate a press to. (In other words, if alt hold is on and you want to turn on heading, just write the heading bit; you don't need to set the alt hold bit too.) Some functions will toggle depending on the autopilot...the rules are the same as for users hand-controlling the autopilot. For HNAV and VNAV, write using the "armed" enums, because you are arming the autopilot. (You can't engage it, that happens when the signal is picked up and GS/loc are passed.)

Generally if a command key press and a dataref exist for the autopilot - use the command key press. It will be compatible with more versions of X-Pane.

! Deprecated Datarefs

These are the enum mappings for the older datarefs. Please avoid using them whenever possible; they will be discontinued!

  9 = discon
 10 = autothrottle
 13 = airspeed via pitch
  9 = discoin
 11 = heading mode
 12 = wing leveler
  9 = discon
 14 = vvi
 15 = alt mode arm
 16 = alt hold engage
 17 = fms arm
 18 = fms engage
 19 = lca
 20 = pitch sync
  9 = discon
 21 = loc arm
 22 = loc engage
  9 = discon
 23 = gls arm
 24 = gls engage