RailCommand Blocks (Detection Blocks)

Last updated: July 14, 2026

Concept

A RailCommand detection block is a named run of track that the layout watches for occupancy. On the schematic a block is a single straight segment of cells: exactly 1 cell on its thin axis and at least 2 cells on its long axis, horizontal or vertical — never diagonal. Editors clamp every create and resize to this rule, so a square or 1×1 input resolves to a horizontal 2×1; import keeps a decoded sub-minimum span as-is and warns.

Each block carries a governed config: zero or more sensors that report occupancy, and markers that tell an approaching train where to brake or stop. A current sensor detects a length (drawn as a bar); a point sensor is a momentary IR/reed contact (a dot). Occupancy is the logical OR of the block's sensors — any active sensor recolours the whole block bar. Markers are classified purely by ramp: ramp above zero is a Brake marker, ramp of zero a precise Stop. It serves layout owners and editors configuring RailCommand, and operators reading block state in a session.

How To

Prerequisites: an imported or authored layout, and owner/editor access in the organization that owns it.

Review and configure blocks on the Block Editor page:

  1. Open /app/railcommand/layouts/{LayoutId}/blocks. Summary cards count Total, Well Configured, and Missing Detection blocks; filter by Track Class, Completeness, or Detection.
  2. Click a block row to expand its inline editor and set Block Name, Track Class, Direction, Unit and Total Length, Foul End A/B, Max Speed (mph), Restricted Speed, and the Electrified, Terminal, and Critical Section flags.
  3. In the Block Detail panel edit Length (inches), each sensor's kind (point, current, flagman, delayed action) with debounce and memory (ms), and each marker's distance and ramp (mm). The Block Detail panel is labelled "Changes here save immediately" and auto-persists, unlike the Cancel/Save fields above.
  4. Click Save to persist the row fields.

Edit geometry and per-block settings from the Layout Editor:

  1. Open /app/railcommand/layouts/{LayoutId}/editor and double-click a block to open the Block settings modal (tabs: Block, Block Editor, Speed & Rules, Conditions). The Block Editor tab hosts the same Block Detail view. Drag-resize on the canvas or use the numeric span editor; both clamp to the geometry rule.

Worked example: a 4-cell horizontal siding renders as a bar with one full-length current sensor and a Stop marker at its clearance point. Set the marker's ramp to 0 so it reads Stop, save, and confirm the Detection column shows a green check.

Troubleshooting

  • Missing Detection (red ✕) — the block has no resolved sensor. Add or resolve one in Block Detail; an unresolved indicator renders as a "missing sensor config" placeholder, never dropped.
  • "defaulted to current — confirm" — the sensor kind was not imported. Confirm point vs current; an untouched default is never written back.
  • "length not imported" / "positions spaced by order" — those values were not decoded. Set the length; sensor positions stay approximate (order-based).
  • Cannot make a block 1×1 or diagonal — the geometry rule forbids it; the editor normalizes to a horizontal 2×1.
  • Flagman sensor — its occupancy is computed by TrainController logic RailScanPro does not decode. Re-author it as a block rule (the panel links to Webb, the rules assistant).

Safety Notes

Blocks are authored and edited only on the web. Neither the web app nor the Avalonia desktop actuates hardware or drives trains — the desktop presents state and forwards operator intent, and the local/UE5 runtime owns all safety-critical execution (occupancy enforcement, interlocking, movement authority). Editing a block in the browser changes how the layout is modeled and displayed; it does not by itself power, move, or stop a train. During operation the occupancy recolour and the train-in-box name are indications, not controls: the head block shows the train name, while trailing straddle and reserved-ahead blocks recolour without it, and reservation is distributed before occupancy. Never treat a cleared block indication as authority to move — confirm with the operating runtime and procedure.