Variables are one the great additions to TC 9. A variable is a named memory location where we can store information, like a text or a number. We can access and change the contents of a variable via any item on our switchboard that has an Operations tab. We can use variables to change the flow of Operations and we can add them to Text Fields to display their contents.
This video is about how a numerical variable can be used to create a counter. Three things are needed to get this working:
1: Create a variable of the type numerical.
2: Increment / decrement the value of the variable in the Operations Tab of an item on the switchboard.
3: Display the contents of the variable in a text field.
…
Hello Rudy, all your tutorial about Traincontroller are very helpful and I’m following all of your posts. Juste a request about the Numerical counter. How could I do that the counter is changing automatically when a new schedule has started? Until know, I can change the values only with the two buttons as you’re showing in your tutorial.
Beat
LikeLike
You can use the Schedule start and finish operations as shown here:
https://rudysmodelrailway.wordpress.com/2015/09/10/traincontroller-29-startfinish-operations-and-macros/
The drawback is that the counter is not updated when you kill a schedule by hand (right click and terminate schedule) or by using ‘stop all schedules’.
The better method which covers this is to use a flagman that triggers on the schedule and that has the variable updates in its ‘on’ and ‘off’ state operations.
LikeLike
Many thanks for your reply. It’s work perfectly with the flagman. I’m looking forward for the next tutorials.
Beat
LikeLike
My best wishes for 2018.
The start of the new year with this excellent tutorial of TC9 could not be better.
I’m looking forward for the next one.
Jos
LikeLike