Model Train-related Notes Blog -- these are personal notes and musings on the subject of model train control, automation, electronics, or whatever I find interesting. I also have more posts in a blog dedicated to the maintenance of the Randall Museum Model Railroad.

2018-09-01 - Conductor 1 and E-Stop

Category Rtac

Another behavior I need right now in Conductor is to have an E-Stop feature when trains get blocked. It’s the 3rd time a train keeps running for an hour or more blocked somewhere. Ideally Conductor 2 would have a model of “what’s next” and error management, but I can’t wait for that.

What I need is simple: a route starts, and if the train has not reached the destination in say 10 minutes, send a stop to the train. We can do that trivially using a timer, which is canceled (aka “timer end”) when the train reaches destination.

Although not exposed through the script grammar, JmriThrottleAdapter (.py) and IJmriThrottle (.java) do have an eStop() method (the estop is only used when triggering an e-stop via RTAC). Right now just using a repeated stop should be enough.

Script v26 was changed by starting the timer at each state change (up / summit / down) and ending it when reaching the station after stopping the engine. The script has a reset timer when the state changes from idle to station, making sure there are no pending timers from the previous run.

The next step is once we have an “RTAC-Text” variable shared with RTAC, we can use that to display a prominent error message on the tablet. Right now we could hack around using the internal “$estop-state$” variable shared with RTAC.

⇒ Better and less hack: added an ESTOP keyword to the grammar, that sets the internal estop-state to active. This allows tablets to show the error condition, and allows operators to reset the system’s state (unlikely they will know what to do).


 Generated on 2024-04-22 by Rig4j 0.1-Exp-e7e2d73