Model Train Script
English
English
  • Model Train Script
  • About
  • Manual
    • Supported systems
    • Settings
    • Profile
    • Throttle
    • Vehicles
    • Layout
    • Automation
      • Scripts
        • Section
        • Action
          • Vehicle control
          • Layout control
          • Timing
          • Structure
          • Scenery
      • Time tables
      • Flags
      • Routes
      • Sounds
      • Cameras
      • Examples
        • Block control
        • Auto switch turnout
        • Camera detection
  • Release notes
Powered by GitBook
On this page

Was this helpful?

  1. Manual
  2. Automation
  3. Examples

Auto switch turnout

Last updated 5 months ago

Was this helpful?

This page demostrates a script is inspired by the automatically switching back turnouts (in German: Rückfallweiche) of the HSB in the Harz, Germany.

The concept is that the turnout is in a fixed position. When a train approaches from the other side it will change the direction of the turnout what is detected and the turnout automatically tries to return to its default state after a certain period. As long as the turnout is trying to return to its default state the signal warns trains to not enter the turnout since its state will change.

Script features:

  • Triggering the script by a sensor indicating the turnout state is in the non default state

  • Setting the signal to warn and later proceed state

  • Retry mechanism for setting the turnout. If the turnout did not return to the default state (for example because there is a train positioned on the turnout) it will retry again.

  • In case the turnout is switched manually the auto switchback mechanism is not executed by conditional sections.

Demo