JMRI is...

Signaling

Adding signals to your layout with JMRI.

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.

Entry Exit and Interlocking

This brief tutorial is designed to explain how the Entry Exit and Interlocking is set up and works within JMRI. It is based upon the Signal Mast Logic clinic held in the UK and follows on from that.

The panel file for this tutorial was taken from the "Logix and Feathers" section of the Signal Mast tutorial. The only difference is that the Signal Mast Logic has been removed from all the Signal Masts apart from the "up outer mast" and the "down platform mast" as these are used to represent signals in automatically controlled areas.

In addition the file has been modified to use Internal Sensors and Turnouts only, thus allowing it to be opened with any system configured in the preferences.

As a prerequisite the clinic on Signal Mast Logic should be followed before attempting this one as it provides the foundation on how to build your panel ready for use with the Signal Mast Logic and also Interlocking.

The track plan for this is the same as in the Signal Mast Logic clinic and could be considered a typical scenario where the Down Approach, Up Platform and Bay Signals would be under the control of the SignalMan, while the Up Outer and Down Platform would be automatically controlled.

The panel file for this tutorial can be found here

The NX buttons all work in pairs and must be selected in the correct order, also it is not possible to leap-frog a NX button to set a Route between two non-adjacent buttons. I.e. if you have buttons A-B-C it is not possible to set a route from A to C, the order of selection must be A-B B-C.

Setting up the layout editor

In the Signal Mast Logic tutorial each block was configured with a different colour to show occupied and unoccupied (Building a Layout). In addition it is possible to assign an alternative colour to each block. When using Full Interlocking, this alternative colour is used to highlight Routes that have been set, when a Block is using the alternative colour it also prevents another route from being set using that block.

The eNtry eXit (NX) utilises sensors for each NX location, typically associated with a signal or an End Bumper/Buffer stop, these sensors would act in the same way as a button on a physical panel, setting the button active to start the selection with the setting Active of a second sensor completing the route or path selection. If a matching Sensor is not activated within 10 seconds then the initial Sensor will be reset back to Inactive.

A sensor needs to be configured for each NX location. As a suggestion to help keep track of things prefix the user name with "NX" followed by the associated signal. So for example if the NX Sensor will be associated with the "Down Appr" signal, then make the Sensor User Name "NX Down Appr".

Once the Sensors have been created they can associate and positioned with locations on the Layout Editor, in the same way that the signal masts were done in part 6 of the Signal Mast Logic clinic. Bring up the context menu (right click) on the Block boundary and select "Set Sensors" from the list.

Remember that the Block which the Sensor is assigned to will determine the direction of travel; if the Sensor is assigned to the incorrect Block then it will not get picked up and the interlocks will not work.
The panel file with the Sensors already assigned can be found here

Creating the NX Rules

Open up the Entry Exit window, which can be found in the tools option of the layout editor. This will bring up a window like the following.

This window allows you to see which NX pairs have been created and the state of each pair. From this window we can get the system to automatically generate the pairs or we can manually define them.

  1. Select the layout editor panel file that you wish to create the NX on.
  2. If you are going to create the pair manually then select the Entry and Exit Points from the respective drop down lists, or leave them as is.
  3. Select the type of interlocking that we are going to use.
    • Set Turnout Only - This will only set the turnouts to the correct state between the NX sensors.
    • Set Turnouts and Signal Masts - This will do as above, but also generate the Signal Mast Logic at the same time.
    • Full Interlock - This will do all of the above and also lock the path and prevent another clashing one from being selected.

Set Turnout Only

If to start with you select "Set Turnout Only" and press "Auto generate Entry Exit Pairs", it will end up generating a list with four pairs like the following

The four paths generated are all valid NX pairs based upon the direction of travel. For the NX to be set you must first select the Entry sensor, followed by the Exit sensor. If they are selected in the reverse order the path will not be set.

You can see that if you were to set a Route from the "down appr" to the bay buffer stop, the Turnouts get automatically set. The Sensors will also flash while the Route is being set up.

If you then set a Route from the "bay mast" to the "up appr", again the Turnouts will automatically be set.

With the Turnout Only interlock type, as no further logic or interlocking is done, it is possible to allow the interlock to be set-up no matter which way round the NX buttons are selected. This can be done by selecting the "Both Way" flag in the table against an entry. You can then set the path in reverse, eg "NX Up Outer" to "NX Bay Mast".

In addition to this with a "Turnout Only" set you can also create NX pairs that go against the normal direction of travel, for example from "Bay Mast" to "Down Appr"

Turnouts and Signal Masts

If "Set Turnouts and Signal Masts" is selected and then the "Auto Generate" button is pressed, the same four interlocks will be generate, with the NX type set to "Signal Mast".

This time when you set the Route between two NX sensors, it will set the Turnouts and if Signal Masts are placed at the same location it also configures the logic from the Signal Mast at the source.

The Signal Mast Logic will appear in the Signal Mast Logic Table. This logic is not saved when the panel file is saved.

If you set a Route from "Down appr" into the bay buffer stop, you will see that the Turnouts get set and the Signal changes to the correct state. If you then change the state of the Turnout or Block on the path, you will see that the source Signal Mast will change state appropriately.

Full Interlock

If "Full Interlock" is selected and then the "Auto Generate" button is pressed, again you would end up with the four interlocks as before.

With Signalmasts

When a full interlock is configured and there are Signal masts placed at the NX locations, it will place the Signal Mast at the source location into a Held state until a path has been set, which will in turn releases the signal. This is working on the basis that these signals are now under the control of a SignalMan who has to set the appropriate Route before releasing the signal.

The full interlock will also set the state of the blocks to use the alternative colour, and the NX sensor buttons will remain in a solid active state.

If you try and set a conflicting path, then an error message will be displayed and the path will not be set.

As the Route gets cleared down by a train occupying the Blocks, so does the interlock.

If you re-select an active interlock, the NX sensors will start to flash, and you get the option to either "Cancel" the Route, "Clear Down" or "Exit".

Without Signal Masts

If no Signal Masts are configured between the two points the interlock will work in very much the same way as it would with Signal Masts, it just doesn't set up or release any signals.

Further Details

With all the Entry Exit methods the system will try to set the route with the lowest cost. Each layout block has a cost assigned it is the sum of all the block costs in a route that determine the overall route cost. By default a Main Track is assigned a value of 50, while a side track has a value of 200. These values can be changed by the user, by editing the layout block. If the route with the lowest cost has either another entry/exit point in the same direction, or a block that is already set Occupied or Reserved, then it will try and find an alternative route if one is available.

Uni-directional Blocks - It is possible to set the relationship between adjacent blocks, to prevent routes from being set up from one block to another or vice-versa. This is set when editing the layout block, you have the option for both way, to only send or only receive.

To view how a particular block connects to other blocks, with costs and valid paths, right click on a track segment or turnout roundel and select "View Block Routing".