DataRefTool for X-Plane

Find and explore datarefs and commands in X-Plane:

Screenshot of DataRefTool
Screenshot of DataRefTool, with labels on the search options

Commands

Commands are an event, with a beginning and end; for example, a button being pushed, or a switch being flipped. To find a command, use the search window to search by name.

Command search UI

If you don't know the name, try opening the command history. When you use the command (by pressing a cockpit control, for example), you will see it in the command history.

Command history window

Clicking View… to find more details about commands and datarefs.

Command detail window

DataRefTool may not find all commands due to limitations of the X-Plane SDK. (details)


Datarefs

Datarefs are a quantity or value in the simulator. Like commands, you can find them by name in the search window.

If you know that a dataref is changing in value, use the ch change filter button.

Search window, while filtering for changing datarefs

To keep an eye on the value of a dataref, add it to the Watch window by clicking the Watch checkbox. When your mouse is close to the window, you can drag it around.

Watch window UI

Colors

DataRefTool uses different colors to indicate datarefs or commands in different states:

DefaultReduce colors
WhiteWhiteDataref: not changed recently
Light cyanSky blueDataref: recent small changes
Light magentaBlueDataref: recent large changes
GreenYellowCommand: not used recently
YellowOrange/vermillionCommand: used recently
Red-orangeVermillionDataref: deprecated
Red-orangeReddish purpleDataref or command: ignored
Screenshot of DataRefTool, showing coloring of result lines

Reduce colors

In an attempt to be accessible to colorblind users, an alternate color scheme is available.

Screenshot of DataRefTool, showing how to select an alternate color scheme

The colors are based on the Wong color palette (Figure 2).

Screenshot of DataRefTool, showing coloring of result lines

Font and UI scaling

Bigger fonts are available in DRT through X-Plane's accessibility settings:

Screenshot of X-Plane accessibility settingsAnimated screenshot sequence showing different font sizes in DRT.

Performance

DataRefTool reads datarefs every frame in order to detect changes to values. Other plugins and X-Plane take significant time to compute these values; DRT takes time to identify changing values. This extra work may lower your frame rate if you're CPU-limited.

Here are the best ways to make sure that DRT is having the smallest impact on your FPS:

  1. Close DataRefTool windows when you aren't using them. DRT does stop reading datarefs completely when all windows are closed; you should not lose any FPS at all when all windows are closed.

  2. Update values at a lower rate will lower the load on your system. You can configure this in the DataRefTool menu: DataRefTool menu, with the 'Update rate' submenu selected

  3. Ignore datarefs that are slow to read. Create a file called X-Plane 12/Resources/Plugins/drt_ignore.txt, and list the datarefs to ignore, one per line. Datarefs listed in this file will not be read by DataRefTool.

    Here are a few X-Plane datarefs which are known to be relatively slow:

     sim/airfoils/afl_cd
     sim/airfoils/afl_cm
     sim/airfoils/afl_cl
    
  4. Buy a faster CPU! 😀 DRT is written in a highly optimized and efficient manner; however, it does a lot of work, and that work takes CPU time.


Finding every dataref

DataRefTool 2.2.0 and later use a new API for finding datarefs (when used with X-Plane 12.04 and later), and no longer rely on scanning every file for datarefs (though scanning is still used for commands).


Keyboard shortcuts

In general, normal text editing shortcuts are respected:

In the search window, there are some additional things you can do:

Search field:

Search results:

Additional keyboard shortcuts (to open a search window, for instance) can be added by searching for "datareftool" in X-Plane's keyboard settings.


Comparison vs. DataRefEditor

The DataRefEditor plugin has been a critical part of X-Plane development for a long time. I designed DataRefTool to help me work more efficiently, adding features as I needed them:

More details about DataRefEditor at X-Plane.com.


Plugin developer notes

Adding custom datarefs: You can use DRT to display your plugin's custom datarefs or commands. Just send a message of type 0x01000000 with a pointer to the name as the payload. (This is exactly the same method that you use to add a custom dataref to Data Ref Editor.)

SDK addition wishlist

DRT would greatly benefit from some changes to the X-Plane SDK (Hello Laminar! 👋). Here is my SDK wishlist.


Author

DataRefTool is made by Lee C. Baker. If you benefitted from this plugin, please consider the PlaneCommand plugin, which provides a voice control for many command aircraft commands.