FSX & FSX: Steam Edition 7 min read

How do I create XML gauges for FSX?

Ian Stephens
In short

Learn how to create XML gauges for FSX and Steam Edition, with working XML, panel.cfg placement, SimVars, CAB packaging and blank-gauge fixes.

To create an XML gauge for FSX or FSX: Steam Edition, write a gauge definition in FSX’s XML/RPN format, place it with its bitmap assets in a folder under Gauges, then reference it from an aircraft’s panel.cfg. Start with a 2D panel; virtual-cockpit placement adds texture-mapping complications.

Anatomy of an FSX XML gauge

An FSX XML gauge consists of an XML definition, optional bitmap artwork and a panel entry that tells the simulator where to draw it. XML gauges can read simulator variables, maintain local variables, format text, animate images and trigger simulator events without a compiled DLL.

  • Container: a folder or CAB file inside the simulator’s Gauges directory.
  • Gauge XML: defines elements, expressions, images, text and mouse areas.
  • Artwork: usually BMP files addressed relative to the XML gauge.
  • Panel declaration: a gaugeNN= line under a [WindowXX] or [VcockpitXX] section in panel.cfg.

Before building a larger instrument, examine this small, readable XML information-gauge package. It demonstrates the relationship between the CAB contents, XML file and panel declaration without burying the essentials under a complex cockpit.

Build a first FSX XML gauge

A loose gauge folder containing one digital read-out is the quickest development setup because every change remains visible and editable.

  1. Back up the aircraft panel. Find the aircraft beneath SimObjects\Airplanes in your actual FSX installation and copy its panel folder somewhere safe. If panel.cfg contains an alias= line, it is borrowing another aircraft’s panel; edit the target panel or create a separate panel variant rather than changing the wrong file.
  2. Create the gauge container. Under the simulator’s Gauges directory, create FlyAway_Test. Avoid spaces and punctuation while testing.
  3. Add a background image. Create a plain 200-by-60-pixel BMP named background.bmp and save it in that folder. A conventional 24-bit BMP is a safe starting point; transparent and indexed artwork can wait until the gauge works.
  4. Create the XML file. Save the following as Airspeed.xml, not Airspeed.xml.txt. The example draws indicated airspeed in knots over the bitmap.

<Gauge Name="FlyAway Airspeed" Version="1.0"><Image Name="background.bmp" ImageSizes="200,60"/><Element><Position X="100" Y="30"/><Text X="190" Y="40" Length="10" Font="Arial" FontSize="20" Color="#FFFFFF" Adjust="Center" VerticalAdjust="Center"><String>%((A:AIRSPEED INDICATED, knots))%!3.0f! kt</String></Text></Element></Gauge>

  1. Add it to a 2D panel section. In an existing [WindowXX] section, add gauge00=FlyAway_Test!Airspeed, 0,0,200,60. Replace gauge00 with the next unused sequential gauge number; duplicate numbers can cause one entry to replace another.
  2. Reload the aircraft. Switch to its 2D cockpit and check the selected panel window. If FSX retains the previous panel state, load another aircraft and return, or restart the simulator.

In the panel entry, FlyAway_Test identifies the folder or CAB and Airspeed identifies the XML file without its extension. The remaining values are the X position, Y position, width and height in the panel section’s size_mm coordinate system.

How do FSX SimVars and RPN expressions work?

FSX XML gauges read aircraft state through simulator variables and process calculations with reverse Polish notation, where values appear before their operators. The sample’s (A:AIRSPEED INDICATED, knots) reads an aircraft variable in knots, while %!3.0f! formats the result as a whole number.

  • A: variables expose simulator and aircraft values such as speed, altitude, fuel and switch state. Most are read rather than written directly.
  • L: variables store custom gauge state. Prefix their names with an aircraft or project identifier to reduce collisions with other gauges.
  • P: variables provide selected panel or environment values supported by the gauge system.
  • K: events operate simulator controls. Interactive gauges usually trigger these from mouse areas instead of trying to write an A: variable.

Use the exact variable, event and unit names documented by the FSX SDK. When developing controls, you can also inspect FSX commands and variables with this SimConnect utility. A valid XML document can still fail as a gauge if its element names, attribute case or RPN expression do not match the FSX gauge schema.

Should I use XML, C++ or SimConnect?

Choose XML for normal cockpit instruments and controls; use compiled code only when the required logic or external integration exceeds the XML gauge system.

MethodBest suited toMain trade-off
XML gaugeDisplays, needles, annunciators, switches and moderate RPN logicLimited to the panel system and its supported variables and events
C++ gaugeComplex native processing or specialised SDK accessRequires a compatible 32-bit FSX build and introduces binary-loading issues
SimConnect applicationExternal programs, hardware interfaces and processes outside the panelRuns separately and is not a self-contained panel gauge

XML is also easier to inspect and redistribute when the artwork and source are yours. Never package modified default, freeware or commercial gauge assets unless their licence permits redistribution.

Should I package an XML gauge in a CAB file?

Develop with loose files and create a CAB only after the gauge works correctly. Loose folders make syntax, artwork and path errors much easier to isolate.

For release, package the XML and its assets with a gauge-cabinet tool supplied by a suitable FSX SDK installation. If the development folder is FlyAway_Test, name the package FlyAway_Test.cab so the existing FlyAway_Test!Airspeed panel reference remains valid. Do not introduce an extra enclosing directory inside the CAB.

Temporarily remove or rename the loose folder when testing the CAB; otherwise, you may not know which copy FSX loaded. For a more involved packaging example, inspect this F-4 2D panel with custom XML gauges.

Why does my FSX XML gauge appear blank?

A blank FSX XML gauge is usually caused by an incorrect container reference, malformed XML, a missing bitmap or panel coordinates outside the visible area.

  1. Check the reference first. For Gauges\FlyAway_Test\Airspeed.xml, the panel identifier must be FlyAway_Test!Airspeed. Do not add the XML extension.
  2. Show Windows file extensions. Text editors commonly produce an unseen .txt extension.
  3. Validate the XML structure. Look for mismatched tags, smart quotation marks and incorrect capitalisation. If the file otherwise looks correct, resave it as plain text without unusual characters or an encoding marker.
  4. Verify every asset name. Begin with the XML and BMP in the same folder. Paths inside a CAB must match its internal directory structure.
  5. Inspect the panel section. Use a unique, sequential gaugeNN number and test at 0,0 with an obvious size. Confirm that the section’s size_mm values make those coordinates visible.
  6. Test in a 2D window. A gauge added to [VcockpitXX] will only appear where the aircraft model maps that panel texture. Correct XML cannot create a missing virtual-cockpit display surface.
  7. Check aliases and permissions. Make certain FSX is reading the panel.cfg you edited and that Windows allowed the change to be saved in the simulator directory.
  8. Reload completely. Restart FSX after structural or CAB changes if merely reselecting the aircraft does not refresh the panel.

If the gauge itself works but the folder placement or panel.cfg syntax remains unclear, follow our separate FSX gauge-installation walkthrough.

FSX and Steam Edition compatibility

The XML gauge and panel.cfg formats are effectively the same in boxed FSX and FSX: Steam Edition. Their installation paths and available SDK tools can differ, so work from the simulator directory actually used by your installation rather than copying a presumed path.

AI Assistant New

Still stuck? Ask Fly Away

Ask Fly Away is our AI flight-sim assistant. Ask your exact question and get a direct, step-by-step answer in seconds — free to try.

Ask Fly Away Free preview · unlimited for PRO members