The tables file: one file that is the railroad

Every switch, sensor, block, signal and route the railroad has told JMRI (Java Model Railroad Interface) about lives in one XML file. Here is how it is laid out, and every object in it to browse.

Parked. Since the helix-join release (November 2026) the Entry/Exit pairs, the Dispatcher System with its sections and transits and the USS CTC (Centralized Traffic Control) machine with its CTC data are not in the active file; their data is kept in jmri/layouts/hart/parked/. The table below lists them in their place.

What the file is

JMRI, the free model-railroad software that runs this layout, keeps what it knows in "tables". There is a table of turnouts (the switches), a table of sensors, a table of blocks (stretches of track), and so on. When you save, JMRI writes all of them into one XML file. When it starts, it reads that file back, and the railroad is there again.

Ours is called tables.xml. It is about 1.1 MB and 13,082 lines long, and it has 20 top-level sections. It is in the ordinary JMRI format. build_tables.py generates it from the device master and a template, and PanelPro 5.16, the main JMRI program, loads it. It holds no connection settings: how JMRI reaches the layout lives in the profile, a separate set of preferences. Everything else is in here, including the four panels, of which the track diagram is the one shown on screen.

How the file is laid out

The file is one long list of sections, one after another. It falls into two broad parts. Objects are the things JMRI keeps track of: sensors, turnouts, masts, blocks and so on. Each has a system name, JMRI's internal id, and usually a user name, the public name people use. Panels are the drawn screens. They hold no objects of their own; they refer to the objects by name.

systemName  M2S100
userName    BS K-1

That is a real sensor. Many objects also carry a comment, a free note such as "Node: 1 Block: 1". A sensor icon on a panel carries only "BS K-1", and JMRI finds the sensor from that.

Mind the order. The panels are what you see first on screen, but in the file they come last: about 46% of the file is objects, then about 54% is panels. A short record of loads and stores closes the file. The largest single section is HART Railroad, at about 27% of the file.

The file from top to bottom A bar for the whole file. About 46% is objects, then about 54% panels. Objects Panels
The file from top to bottom, left to right, drawn to scale.
SectionWhat it holdsShare of the file
At the start
JMRI versionThe version of JMRI that stored the file.under 1%
Objects
SensorsInputs: occupancy and switch feedback from the layout, plus internal flags and helpers.4%
TurnoutsThe switches, their DCC twins, and internal turnouts for the main and upper levels.2%
MemoriesSmall stored values, such as the fast-clock time and the mimic page's requests.under 1%
Signal headsVirtual heads that carry each lamp's colour.3%
Signal mastsThe signals, real and virtual, all stock Basic.3%
BlocksStretches of track, each with an occupancy sensor and paths to its neighbours.8%
Layout blocksThe Layout Editor's view of each block.4%
SectionsDispatcher track pieces, mostly made from pairs of masts. Parked.parked
TransitsWhole moves that the Dispatcher builds from sections. Parked.parked
Signal Mast LogicThe rules that set a mast from the track ahead.8%
LogixOlder-style logic items. Parked.parked
ConditionalsThe conditions and actions inside those Logix. Parked.parked
Fast clockThe settings of JMRI's fast clock.under 1%
LogixNGNewer logic that hides windows and clears the main and upper block sensors at startup: the LogixNGs, their ConditionalNGs and their actions.14%
CTC dataThe USS CTC machine's code buttons and settings. Parked.parked
Entry/ExitPairs that line a route from a click on the panel. Parked.parked
Panels
USS CTCThe lever machine, a Panel Editor screen. Parked.parked
HART RailroadThe track diagram, a Layout Editor panel.27%
Staging LevelThe staging level alone, a copy of the track diagram; hidden when the file loads.9%
Main LevelThe main level alone, a copy of the track diagram; hidden when the file loads.7%
Upper LevelThe upper level alone, a copy of the track diagram; hidden when the file loads.11%
Dispatcher SystemA Layout Editor panel drawn by the Dispatcher System package. Parked.parked

Browse the tables

Here are the rows themselves, with their comments, for the tables that hold named objects. Pick a table, type to filter, and the list narrows to the rows that contain your text in any column.

Loading…

Each table points at the next by name, so a detector on the track ends up as a leg of a train's route. The figure follows the chain.

How the tables link A sensor feeds a layout block, which matches a block with paths that name turnouts. Two masts form a signal mast logic pair that creates a section. Sections chain into a transit, and Entry/Exit reuses the pair. Track Sensor BS Switch 13 Layout block OS Switch 13 Block paths name turnouts 185 layout blocks share 146 detectors Signals and the Dispatcher Mast A Mast B SML pair A to B Section A:B Transit Entry/Exit reuses the pair Masts stand at block boundaries; sections chain into transits
Top: from a detector to a block that knows its neighbours. Bottom: from two masts to a route a train can follow.

Start at the top. An occupancy sensor reports a train on the track. A layout block (the Layout Editor's view of a block) names that sensor, and a block of the same name joins its neighbours through paths. The file stores no paths: JMRI works them out from the Layout Editor panel when it loads the file. Several blocks can share one detector; since the hidden yard throats were dropped (November 2026) each yard track is one block on its own detector. 34 detectors are shared. That leaves 185 layout blocks on 146 detectors. On the main and upper levels each block's sensor is an internal one for now, since those levels have no detectors yet.

Here is the block for OS Switch 13, trimmed to the parts that matter:

<block>
  <userName>OS Switch 13</userName>
  <occupancysensor>BS Switch 13</occupancysensor>
</block>

The paths JMRI works out for it read as a sentence: from OS Switch 13 you can go to Track Barn when Switch 13 is closed, and to OS Switch 11 when it is thrown. Every block gets paths like these, and together they are the map.

Masts sit at block boundaries. Signal Mast Logic takes two masts and works out what lies between them from the Layout Editor, using those paths. Here is one destination, trimmed:

<signalmastlogic source="Mast 40LA">
  <destinationMast destination="Mast 24L">
    <enabled>yes</enabled>
    <useLayoutEditor>yes</useLayoutEditor>
    <useLayoutEditorTurnouts>yes</useLayoutEditorTurnouts>
    <useLayoutEditorBlocks>yes</useLayoutEditorBlocks>
    <associatedSection>Mast 40LA:Mast 24L</associatedSection>
  </destinationMast>
</signalmastlogic>

The pair creates a section named "Mast 40LA:Mast 24L", which is why the Dispatcher's sections are named after masts. The Dispatcher chains sections into a transit, a whole move from one mast to another via the switches in between. Entry/Exit reuses the same pairs rather than inventing its own. Sections, transits and Entry/Exit are parked since the helix-join release (November 2026); the masts and pairs stay live.

Switches have a link of their own. This one reports its position through two sensors, one for each side, so JMRI can tell "thrown" from "not yet arrived":

<turnout feedback="TWOSENSOR"
         sensor1="FB Switch 35 R"
         sensor2="FB Switch 35 N">
  <userName>Switch 35</userName>
</turnout>

Who writes what

build_tables.py writes the file from the device master and the template. Anything you do on screen in PanelPro, such as renaming a mast, comes back into those sources when the Store is pulled. A few jobs are done by script, and each does one thing:

The scripts that edit the file directly run only with PanelPro and CATS closed. Discover is the exception: it runs inside a one-shot PanelPro, with no other JMRI session open, then stores and quits.

The LogixNGs

Two pieces of logic are little programs rather than tables of things. They are LogixNGs (JMRI's newer logic tool), both listed in the Initialization Table, which is why they run when the tables load. One hides windows; the other sets the main and upper block sensors and turnouts to a known state, described below the table.

"Hide windows on start" has three ConditionalNGs, each with one stock action:

ConditionalNGStock action
Hide WiThrottleWindow Management: hides the WiThrottle window
Hide HART Railroad under CATSRun Script: runs hide_cats_desk_windows.py
Hide the band panelsRun Script: runs hide_band_panels.py

The two Run Script actions call ordinary Jython files, described among the scripts. A LogixNG runs wherever the tables load, so it fires under both PanelPro and CATS with no condition of its own. hide_cats_desk_windows.py does the checking: it looks at how JMRI was started and at the open windows, and if CATS is not running it does nothing. hide_band_panels.py waits for the three level windows to open, then hides them. A window action ignores a window that is not there, so if one is missing, nothing happens.

The second LogixNG, "Main and upper block sensors clear on start", sets the 103 occupancy sensors of the main and upper blocks to clear when the tables load. Those levels have no detectors yet, so each block has an internal sensor of its own, and JMRI starts an internal sensor in an unknown state. A signal does not clear into a block whose state is unknown, so without this step every main and upper signal would show Stop. It also sets the 39 internal main and upper turnouts to their normal position, except Switches 227 and 229, which start thrown so the main route runs round the peninsula loop.

What is in the file

The file uses JMRI's standard format. The content is specific to this railroad: the names, the comments and the main and upper levels' internal turnouts. The data for the CTC lever machine is parked.

More: What we added to JMRI · How the signals work · LCOS and the Arduino bridge · Device viewer · Dispatcher guides · Bringing the Railroad Together · jmri.org