When the decoder in the locomotive receives a command to move forward, it spins the motor one way, when it receives a command to move backwards it spins the motor in reverse. Note that if you hook up the decoder incorrectly, it will move the wrong way. You might not notice this if you are wiring an Electric Locomotive, but its obvious for Steamers.
When you run a locomotive manually in Rocrail, you can see in the GUI if Rocrail is sending forwards commands or backwards commands. Look at the Direction button in the Locomotive Control Window, and pay attention to the arrowhead on the button:
|Sending forwards commands to the decoder|
|Sending backwards commands to the decoder|
Note the use of a Steam Locomotive graphic, this makes it obvious whether the decoder commands are forwards or backwards for this locomotive.
If the box is checked, the placing is Default, which means Rocrail should send forwards commands to the decoder to make this locomotive move forwards on a Route. If you uncheck this box, then Rocrail will send backwards commands to make this locomotive move forwards on a Route. Consist with reversed steamer – when backwards really means forwards
A Route is two adjacent blocks that are linked together. Routes have a direction, specified by choosing the From Block and the To Block in the Routes dialog box: Routes dialog [Needs to be for route A-B, with From Block/To Block and Run Direction circled in Red]
The default direction of the Route is always from the From Block to the To Block in the dialog.
[TK – example plan shot. Rob, I have this shot, I will post it and the others for this page, they come from a GUI track plan.]
Rocrail sends forwards commands to all locomotive's by default to move the loc from A to B on this Route.
You can make Rocrail swap the direction of a Route by setting the Run Direction to reverse. By default, Rocrail will send forwards commands to any locomotive in Block A to move it to Block B. If you set Run Direction to Reverse, Rocrail will send backwards commands to any locomotive to move them from Block A to Block B.
TK – example track shot w/Reverse as default direction.
The Usage Setting has nothing to do with direction. It does not change whether Rocrail sends forwards or backwards commands to a locomotive's decoder.
Instead, it controls whether Rocrail can use the route one way only, like any road in real life.
If Usage is set to From - To, Rocrail can only move a loc from the From Block to the To Block. Moving backwards from the To block to the From block is not allowed.
If Usage is set to Both Directions, then a locomotive is allowed to move from either block to the other. However, the commands sent to the locomotive's decoder are still determined by the Block the loc is in, and the direction for the Route.
This means if the Run Direction for the Route is forwards, and the Locomotive is in the To block, Rocrail will send backwards commands to the decoder to move from the To Block to the From block, to make it back up.
When Rocrail wants to move a locomotive from one block to another, it calculates which direction to send to the locomotive's decoder by combining the direction for the Locomotive and the direction for the Route given the Locomotive's block position.
- First, Rocrail determines if it must send forwards or backwards commands to the locomotive based on the Route settings and whether the locomotive is in the From block or the To Block.
- Then, Rocrail determines if it must swap the commands for this specific locomotive based on the Placing checkbox for the locomotive.
There are actually 8 different possible combinations of Locomotive and Route direction for a Locomotive in Block A of our route A-B. Examine the following table:
Matrix of Locomotive and Route Direction Combinations
|Run Direction||Placing Checkbox||Locomotive Facing||Decoder Command Sent||Results|
|Forwards||Checked||Towards B||forwards||Moves to B|
|Forwards||Checked||Away from B||forwards||Moves away from B (1)|
|Forwards||Unchecked||Towards B||backwards||Moves away from B (2)|
|Forwards||Unchecked||Away from B||backwards||Moves to B|
|Reverse||Checked||Towards B||backwards||Moves away from B (3)|
|Reverse||Checked||Away from B||backwards||Moves to B|
|Reverse||Unchecked||Towards B||forwards||Moves to B|
|Reverse||Unchecked||Away from B||forwards||Moves away from B (4)|
1 – Locomotive facing is wrong. Loc is facing backwards on the track, it should be facing towards B. 2 – Placing checkbox is wrong. Unchecked means this Loc is supposed to be facing backwards on the track (away from B), but it is facing forwards (towards B). 3 – Locomotive facing is wrong. Reverse Run Direction means all locs are supposed to run this route backwards, backing up from A to B. Loc is facing B, it cannot “backup” to B. 4 – Placing checkbox is wrong. The loc's facing matches the Route, but the placing checkbox says it is backwards on the Route.
If we expand the matrix above to include a Locomotive in Block B, the number of combinations is 32, because we must take into consideration both placing the Loc in Block B and whether the Usage setting for the Route is From To or Both Directions. Half of those combinations result in Rocrail not moving the Loc at all, because a Route that is From To cannot move a loc from the To block back to the From block.
Because of all the different combinations of Locomotive and Route Direction, it is possible to create layouts that cannot be run Automatically. If you do not set up the layout properly, you will quickly confuse yourself as you watch your locomotives move the wrong way on your track, or not move at all, or even worse, bash each other head on.
You can also make some of your Locomotives fail, while others work perfectly, if you incorrectly place them on the track, and/or do not set the Placing checkbox to match their orientation.
There are many things to watch out for, here are some examples of common mistakes.
You must create Routes that match how you want your trains to run. Consider this very basic example of a layout that will never work:
TK – A-B-C example. Routes A-B, Run Direction set to Forwards C-B, Run Direction set to Forwards
This might be a simple Trolley layout, with the train moving from A to B to C and back again. But because the Routes are defined incorrectly, the layout won't work. Note that A-B is from the left to the middle, and that C-B is from the right to the middle.
Assuming default settings for everything, Rocrail will try to move the loc from A to B, and then from B to C. If the loc is placed in A facing B, Rocrail will first move it from A to B by sending forwards commands. This will work, and the loc will move from A to B.
Then Rocrail will try to move it to block C, using the Route C-B. Because the loc is now in the To block of the C-B route, Rocrail will want to send backwards commands to the decoder, but the loc is facing forwards at block C. The loc will move backwards from B back into A, where it will trigger a Ghost Train exception and shut off the power.
TK– Shot of real loc with icon loc underneath
You put the loc on the track in Block A, but facing away from Block B. Rocrail sends forwards commands, which make the loc move forwards away from Block B.
TK – Shot of example with loc icon
You put the loc on the track in Block A, facing Block B. But, the Run Direction for the Route is Reverse. Rocrail sends backwards commands to the loc, making it move away from Block B.
TK – Shot of example with dialog
You put the loc on the track in Block A, facing Block B. The Run Direction is set forwards, but the Placing checkbox for this locomotive is unchecked. Rocrail checks the route and wants to send forwards commands. But then it checks the loc, and swaps the direction, and sends backwards commands. The loc moves away from Block B.
To help understand why Rocrail doesn't move a loc the way you want it to, you can turn on tracing of Automatic commands in the server. Watch the Server's shell window to see what it is doing as you run your layout. Stop the server and then examine the trace files to see why Rocrail did something you didn't expect.