RailCom
Basic RailCom tutorial
This tutorial describes how to stop a train in front of a red signal with the usage of RailCom.
For this tutorial you need a a working RailCom setup via your command center.
1. Layout
We start in the layout editor with defining a very basic layout.

We assume our train is coming from A driving towards B and passing signal "S1" on its way.

Before our signal "S1" we define a sensor supporting RailCom. In our case we are using the C-Bus of the Z21 with feedback address 1 and module 1.
Our layout is ready to be used in our script!
2. Automation
We create a new script. We configure it to be executed by an event.

We add an execution event of type feedback. After we select the sensor in front of our Signal "S1". We enable the option "Select first occupier". This makes Model Train Script automatically select the first detected vehicle on execution of your script.

Our execution event is complete, we will now continue with configuring the actions of our script.
We delete the standard provided section and create a new one that we call "Stop on red".

We give our section an execution condition: We only want our section to be executed when our signal "S1" is red.

We configure our condition to be of type accessory. After we select our signal "S1" and the state "red".
We can now add our actions. For this tutorial scenario we only add a simple "stop" action.

We now have a script that is triggered when a vehicle is detected by a sensor and if our signal "S1" is red stops our train!
4. Considerations
We kept this tutorial as basic as possible, but here follow some considerations to keep in mind while configuring your own scripts.
We could have made the execute condition also on the script instead of the section. By placing the condition on the section you can easiliy add behavior on other states, like a slow down on orange.
The select first detected vehicle option of the execution event could also have been done with a select vehicle from feedback action.
Last updated
Was this helpful?