User Reference:Module Command Line Options
Using command line options allows you to
- distribute BCI2000 modules over a network,
- change the data format for brain signal recordings,
- switch on debugging messages,
- automate BCI2000 operation.
Core modules (i.e., Data Acquisition, Signal Processing, and Application Module), share the same command line syntax:
<ModuleName> <operator IP>:<operator port> --<option1>=<value1> --<option2>=<value2> ...
All arguments are optional.
Specifying the Operator Module's Network Address
At startup, each core module connects to the operator module. If no IP address is specified on the command line, the connection is opened to the local machine using 127.0.0.1 as an IP address. When no port is given, each module uses its default port as defined here. Normally, there is no need to change port numbers.
Any number of options may be given, starting with a double minus sign. As indicated above, option names and values are combined with a single minus sign, to form a continuous character string. Each option is translated into a BCI2000 parameter using its name as a parameter name, and its value as a parameter value. When a parameter with the given name already exists, its value will be changed from the default to match the value given on the command line. When no parameter with that name exists, it is added to the System parameter section. Parameter values must not contain white spaces on the command line; however, white space may be encoded in HTTP fashion as described here, e.g., using '%20' as a replacement for a single space character.
- Specifying --version will display version information, and then quit.
- The FileFormat option will switch between File Formats used for data recording. The output file format is determined at module startup, and cannot be changed by modifying the FileFormat parameter from the operator module's parameter dialog.
- The Debug option will make a module send Debug Messages that appear in the operator module's log window.
- The LogKeyboard, LogMouse, and LogJoystick options will enable recording of key presses, mouse and joystick position.
- The SavePrmFile option will save a parameter file for each run.
- Normally, BCI2000 automatically chooses a suitable IP address for communication between SignalSource, SignalProcessing, and Application module. Sometimes however, you want a specific address to be used. This is possible using the SignalSourceIP/SignalProcessingIP/ApplicationIP options. Note that these options must be specified on the command line of the respective module, e.g. the following lines will specify the localhost address for both the connection to the Operator module (first option), and the connection between core modules:
start SignalSource 127.0.0.1 --SignalSourceIP=127.0.0.1 start SignalProcessing 127.0.0.1 --SignalProcessingIP=127.0.0.1 start Application 127.0.0.1 --ApplicationIP=127.0.0.1
The Operator Module allows to specify scripts from the command line. Most command line options correspond to script entries in the operator's preferences dialog. The following options exist:
--OnConnect --OnExit --OnSetConfig --OnSuspend --OnResume --OnStart --Title --Hide --StartupIdle --Telnet
After the option, white space is expected, followed with a double-quote enclosed string. Examples:
--OnConnect "C:\scripts\onconnect.bciscript" --OnConnect "-LOAD PARAMETERFILE ..\parms\myparms.prm" --Telnet *:3999 --Title %~n0
The last example shows how to display the name of the batch file from which the Operator Module was started under MS Windows. The "--Title" option takes a string that is displayed in the Operator Module's title bar. The "--Hide" option has no arguments. It hides the Operator module's main window (but not visualization windows). Typically, this option is used in conjunction with fully automated execution via OnConnect/OnSetConfig/OnSuspend scripts, or together with the "--Telnet" option.
The "--Telnet" option expects an IP:Port combination on which to listen for incoming connections, defaulting to "localhost:3999". Logging into the Operator Module's telnet server allows you to execute script commands interactively, or to remote-control BCI2000 from an external application using script commands. When you intend to connect to the Operator Module from a different machine, you will need to specify either an asterisk (*) in place of the IP address: "*:3999" to indicate that it should listen on all available addresses, or the listening machine's external IP address, e.g. "22.214.171.124:3999".
When the "--StartupIdle" option is specified, the Operator module does not wait for incoming connections. This allows for basic configuration to be performed via a telnet connection. To prepare for core module startup, execute
from the telnet prompt.
For further details and examples, see User Reference:Operator Module Scripting.