JMRI is...

Signaling

Adding signals to your layout with JMRI.

General Tools

JMRI provides powerful tools for working with your layout.

Layout Automation

JMRI can be used to automate parts of your layout, from simply controlling a crossing gate to running trains in the background.

JMRI: Aspect Signaling

Controling signaling in a prototypical manner

Protoypical signal systems present "aspects" to the engineer to tell him how to run his train. The "Stop" aspect, for example, is pretty simple: Stop the train. The "Approach medium" aspect indicates something more complicated: "Proceed approaching next signal at medium speed". Each aspect has an associated "indication", which is usually codified in the railroad's rule book.

Different signals may show an aspect using different combinations of lights, semaphore positions, and/or placards; these are called "appearances". For example, the "stop" aspect will be a single red light on a signal mast with one lamp, red over red lamps for a signal mast with two lamps, etc.

JMRI Support for Aspect Signaling

The original JMRI support for signals was via "Signal Heads", which could be set to specific appearances (colors).

Starting with JMRI 2.9.1 (early 2010), JMRI also contains "Signal Mast" objects that represent an entire signal, not just an individual head. A Signal Mast can operate multiple heads, as required to do full prototypical signaling based on aspects. When its "Aspect" is set to e.g. "Approach medium", it handles the layout operations needed to make the signals on the layout appear properly.

Signal Masts are configured through the Signal Mast Table You add new ones with the "Add..." button on the table, which takes you to the "Add Signal Mast" window. To add a new signal mast, you specify what kind of signaling system it uses (see below), the specific signal type like "double searchlight" or "double head dwarf", and what signal heads it's going to drive.

>From the table, you can set individual signal masts to any aspect that they're able to display by clicking in the "Aspect" column.

Signal Masts can be both tested (in Conditionals) and set (in Actions) via Logix. When you're editing a Logix Conditional or Action, you have to type the Signal Mast name and hit enter/return so that the program can look up the possible aspects for that particular signal mast.

You can also add a Signal Mast icon in the Panel Editor in the usual way. The icon will display the images from the appearance definition for that particular signal mast.

Signal Mast Logic

Starting with JMRI 2.11.7 (mid 2011), JMRI contains a "Signal Mast Logic" tool, that allows the Signalling logic to be built up between Signal Masts on the layout. The signal mast logic will use the states of blocks, turnouts, sensors and other Signal Masts to determine what appearance a Signal Mast should be displaying.

If the layout has been drawn up on the layout editor and the SignalMasts have been placed on the panel using the various tools, then it is possible for all the Signal Mast logic to be dynamically built, with little other user interaction.

Available Signaling Systems

JMRI users have provided a number of pre-defined signal systems:
basic
A non-prototypical set of aspects and appearances that most model railroaders will understand easily.
AAR-1946
American Association of Railroads 1946 rule book
BN-1989
Burlington Northern 1989 rule book
BR-2003
British Rail 2003 rule book
CSX-1998
CSX 1998 rule book
DB HV 1969
1969 Deutsche Bundesbahn "Einheitsbauform" Home Signal/Distant signal (Hauptsignal/Vorsignal) system revision
NYCS-1937
New York Central System 1937 rule book
NS-2008
Norfolk Southern Corporation Operating rules book (NORAC)
SLSF-1973
SLSF (Frisco) 1973 rule book
SPTCO-1930
Southern Pacific Railway and Transportation Company 1930 rule book
SPTCO-1960
Southern Pacific Railway and Transportation Company 1960 rule book
There are instructions for creating your own signal system definitions on a separate page. If you do create a new definition for another prototype railroad or era, please contribute it back to the JMRI project so we can distribute it with future releases of the project for others to use. Like decoder definitions in DecoderPro, the more signal system definitions we have, the more useful the program becomes, and the more people spend time to improve it. We all win that way!

Access to Aspect Information from Code

A program (in Java or Python) can get access to aspect information two ways. If it has a reference to a specific SignalMast "m", it can use
   m.getValidAspects()
to get the list of aspect names that this signal mast can display. The program can then access the signal system definition with
   SignalSystem sys = m.getSignalSystem()
and then enquire about properties of the aspect:
   sys.getProperty("Clear","speed");
where the first argument is the aspect name (use, for example, m.getAspect() to obtain the current one on the mast) and the second is a specific property. Properties can be defined programatically via e.g. m.setProperty("Clear","speed","69"); or get loaded automatically from elements in the aspect.xml file that defines the specific signal system.

In addition to the global properties for an aspect, there can also be properties local to a specific Signal Mast type. An example of this is the default icon image: The image for a two-head signal mast is different from that for a one-head signal mast, even if they both represent "Clear".

To get those:

   m.getAppearanceMap().getProperty("Clear","imagelink");
In words, this is saying "Get the appeance info for this mast, and then check the imagelink property of the Clear aspect".

Alternately, if you know the name of the signal system in use, you can go directly to it via the InstanceManager:

   SignalSystem sys = InstanceManager.signalSystemManagerInstance().getSystem("basic");