Command Line Options

Content Rocrail Server



Rocrail can be started from a command line, e.g. in order to run it on a server machine whereas Rocview clients connecting to it are running on other machines inside the home network. See also section Examples at the end of this page.

Onboard Help

When starting rocrail with the command line option

--help

it shows:

----------------------------------------------------------------------
Rocrail commandline options:
-------------------------+--------------------------------------------
--help or -?             | Displays this help and quit.
-version                 | Displays version info and quit.
-doc                     | Writes documentation in Rocrail.html.
-------------------------+--------------------------------------------
-debug                   | Switch on debug tracelevel.
-byte                    | Switch on byte tracelevel.
-parse                   | Switch on xml parse tracelevel.
-monitor                 | Switch on controller monitor tracelevel.
-info                    | Switch on info tracelevel.
-------------------------+--------------------------------------------
-console                 | Read console input.
-nocom                   | Switch off communication.
-pwr                     | Power on.
-auto                    | Power and auto mode on.
-run                     | Start all locos.
-resume                  | Start prev. locos.
-w [workdir]             | Change the programs working directory.
-l [libdir]              | Library directory.
-img [imgdir]            | Images directory.
-p [portnr]              | Service port for clients. [8051]
-i [inifile]             | Ini file. [rocrail.ini].
-t [tracefile]           | Trace file. [rocrail].
-x [planfile]            | Plan file. [plan.xml].
-f                       | Init field.
-sod                     | Start Of Day: Query sensors.
-nodevcheck              | Disable check for serial devices at startup.
-devcheck                | Enable check for serial devices at startup.
-stress                  | Enable the stress runner for testing communication.
-------------------------+--------------------------------------------
-installservice          | Install Rocrail as Windows service.
-deleteservice           | Uninstall Rocrail as Windows service.
-------------------------+--------------------------------------------


A command line option will overrule the equivalent found in the rocrail.ini.

  • Not all command line options have rocrail.ini equivalents.


Version

Check the version of the server to be sure it's the right one:

 Rocrail 6919 [e9994c79ce3f34404ec811df05de71aec2688faf]
 Build: Mar  5 2014 08:31:54
 librocs 2.0-0 build Mar  5 2014 08:31:47
 processid = 70833
       mac = 001A92FC0D5D0000


Documentation

The -doc command will write out the same documentation as found online:
http://www.rocrail.net/doc/rocrail-wrappers/wrapper-en.html
But if you need it and do not have a connection to the internet at hand…


Debug Levels

debug

Use with care; for developers tracing bugs. (Demands much CPU time.)

byte

Useful when having communication problems with the command station.

parse

Use with care; for developers tracing bugs. (Demands much CPU time.)

monitor

Show all info coming from the command station(s).

info

Normally already active, but handy if this level is set to false in the rocrail.ini.


Console

Only this mode accepts console commands.
Rocview will get informed at connection about this mode and will disable the “Shutdown server” menu item.

Nocom

The -nocom option can be used to make a dry run; there will be no communication between Rocrail and the command station(s).


Working Directory

Using another working directory other then the one where rocrail is being started use the -w [path] option.
Make sure the rocrail can find the libraries, it could be necessary to set the -l [path] option too.


Library Directory

Rocrail searches the working directory for libraries. If they remain in another directory it can be set using the -l [path] option.


Client Port

If the default port is already in use by another process it can be changed using -p [port#].


Init field

This option has the same effect as the one found in Rocview:

  • Flip all switches to synchronise Rocrail with the layout.
  • All defined signals will be sent a command with the last known state, or 'RED' If no state is available.


SOD

Start Of Day.
Query all sensors if the connected Command Station supports it.

Windows Service

This topic is explaned in Running as Windows service.


Disable/Enable check for serial devices at startup

Disable/Enable checking for serial devices at startup.
Both command line options are mutual exclusive; No change if both are set.
Device checking could be the cause under Windows to crash at startup. In this case it should be disabled.
It can also be disabled/enabled in the Rocrail Controller setup.


Stress

Some libraries has support for a communication stress tests:

  • Loconet
  • BiDiB
  • CBUS
  • Virtual
  • Dinamo


Examples

The exact complete command not only depends on the type of operating system (Windows, Linux, Mac, …) but also its version and sometimes on the language.

In the examples

  • “My_Name” has to be replaced by the user's name.
  • The -w command specifies the working directory containing the plan and .ini files
  • In -console mode the server cannot be shut down accidently by a client

A valid starting command could look like this:

Windows 7

Applies for all languages.

Starting Rocrail.exe from a command line window (regardless of the actual directory):

c:\"program files (x86)"\rocrail\rocrail.exe -w c:\users\My_Name\documents\rocrail -console

As a batch file:

cd c:\"program files (x86)"\rocrail
rocrail.exe -w c:\users\My_Name\documents\rocrail -console

Windows XP

German language version.

c:\Programme\Rocrail\rocrail.exe -w "c:\Dokumente und Einstellungen\My_Name\Eigene Dateien\Rocrail" -console 

Personal Tools