Table of Contents
Command Line Options
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. -stress | Enable the stress runner for testing communication. -virtual | Use for all defined digints the virtual CS. -lic | SupportKey path and filename. -------------------------+--------------------------------------------
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 14415 [7de033fd0c355b405c5b4438abc2129b5860ee7a][LOCAL] Build: Oct 1 2018 08:06:37 librocs 2.0-0 build Sep 30 2018 16:39:48 processid = 70520 mac = 00005CF938A62F88 guid = 00005CF938A620181001081017060000
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.
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