Jump to content

Setting locomotive speed after stopping it in a signal


Recommended Posts

Let me explain what I know about starting and stopping a train in a signal to clarify what I don't know:

I know how to stop a train in a signal, as it is explained in the wiki (Single signal stop).

I know how to start the train again with an event when the signal changes to "on"

I know hot to put a variable in the speed selection to use is at the speed of the train when the signal goes on. But this gives me the same velocity for all the trains stopped in the track associated to this signal.

I don't know how to replace this fixed variable with an object variable of the locomotive I'm starting, where I have the target speed of the locomotive... I understandd the indirect variable method in the program, but It seems the track object has no standard object variable with the train that is in it, that could be the easiest way to do what I want.

Any help will be welcome. Thank you very much in advance!

Link to comment
Share on other sites

Hello aemartinez,

you must grab the original speed from the arriving train before it stops near the signal, and save it into an event variable which is associated to the signal. After the signal is opened, you can read the needed speed for the train from the event variable and use it as new (= old) train speed.

For example, see the demo project "Automatik-Steuerung 05a - Streckenvereinigung und -verzweigung" within the section "experimental projects" of the online catalog. There, you find a "fast train" (diesel engine, 400 mm/s) and 2 local trains (steam engine, 300 mm/s and -250 mm/s, the last one with backward speed). Please study the event handling scenario of this project. 

Many greetings

See also the short description for the project no. 05a here (in German).


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...