Author: Bob Jacobsen
Keywords: layout java model railroad JMRI tools dcc

# JMRI: Blocks Documentation

## What are Blocks?

Blocks are sections of track whose occupancy may be individually monitored. Dividing track into Blocks is optional. Blocks set up in a track diagram normally correspond to physical blocks on a layout. Block occupancy is indicated by the state of an occupancy Sensor. When a layout's track is divided into Blocks, all of the track need not belong to a Block. For example, yard track may not be in a Block, whereas mainline track almost always would be divided into Blocks. The main use of Blocks is to facilitate Signaling, but Blocks may be used for other layout control and animation functions.

## How to setup Blocks

### Block Properties

Blocks may be set up manually from the Block Table, using a script or automatically in a Layout Editor Panel. When a Block is defined on a Layout Editor Panel, a new Block is created if one does not already exist. In Layout Editor, Blocks are identified by their User Names. Before renaming or deleting a block user name, a check is made to see if the user name is used by a Layout Editor panel. If so, a warning is displayed. For renames, if Yes is selected, the panel references will also be renamed.

To complete the definition of a Block, Paths and Bean Settings must be attached to each Block. Paths describe entry points to the Block. Each Block has one or more Paths associated with it. Sometimes a Turnout must be set a certain way to use a Path; Bean Settings carry that information. Paths and Bean Settings are set up automatically for Blocks defined in a Layout Editor Panel. They can also be set up in a script. There is currently no way to manually enter Paths or Bean Settings. Paths and Bean Settings are not shown in the Block Table, and are described here only for completeness. Paths may however be deleted using the Paths menu.

### The Block Table

Blocks are created and edited in the Block Table.

For use in automatically running Trains, a Length attribute and a Curvature attribute may optionally be assigned to a Block. These optional attributes are entered manually in this table. If Trains will not be run automatically through a Block, there is no need to add these attributes.

#### Block Table controls

- Below the Block Table you'll find the Add... button to add new Blocks.
- Block Table Menus.

### Saving Blocks to disk

Blocks are kept in your layout configuration, along with Turnouts, Sensors, Signal Heads, control panel setup etc. To store this information on disk, allowing you to reload it next time you run JMRI, see Loading and Storing Your Work. Note that the occupied/unoccupied state of each Block is not saved in the configuration file. When Blocks are loaded from a configuration file, their status is read from the Sensors.