Skip to content

Condition

Conditions allow you to control when parts of your script execute. They are used in scripts, sections, and individual actions to gate execution based on the current state of your layout.

A condition is built as a tree of rules combined with logical operators. This gives you full flexibility to express simple checks as well as complex multi-criteria logic.

Rules

A rule is a single check against the current state of your layout. Each rule evaluates to either true or false. The following rule types are available:

  • Accessory — Check if an accessory (e.g., a turnout) is in a specific state.
  • Feedback — Check if a feedback sensor is active or inactive, and optionally whether it is occupied by a specific vehicle.
  • Vehicle — Check a vehicle's speed, direction, active function, or profile.
  • Flag — Check if a flag is enabled or disabled.
  • Variable — Check if a variable has a specific value.
  • Camera — Check if a camera detection point has been triggered.

You can also negate any rule — for example, "accessory is not thrown".

Groups (AND / OR)

Rules are organized into groups. Each group has a logical operator that determines how its children are combined:

  • AND — All rules in the group must be true for the group to be true.
  • OR — At least one rule in the group must be true for the group to be true.

The top-level condition is always a group. You choose whether it operates as AND or OR by tapping the group header.

The editor shows the tree structure with parentheses — each group opens with AND ( or OR ( and closes with ). A summary of the full condition is shown at the top.

Nesting groups

Groups can contain other groups, allowing you to build complex logic. For example:

AND (
  Turnout 1 = thrown
  OR (
    Sensor A = active
    Sensor B = active
  )
)

This means: "Turnout 1 must be thrown and either Sensor A or Sensor B must be active."

Editing

  • Tap a group to edit its operator (AND/OR) or delete it.
  • Tap a rule to edit it — you can also delete it from within the editor.
  • Tap the + button on a group to add a rule or sub-group.
  • Drag and drop rules and groups to reorder them within a group or move them between groups. Drop on a group header to move a rule into that group; drop on another rule to insert before it.