Jump to content

Contributions:SecondaryBCI2000Controller

From BCI2000 Wiki

Synopsis

An extension that controls one or more secondary BCI2000 instances from the GUI of a primary one.

Location

http://www.bci2000.org/svn/trunk/src/contrib/Extensions/SecondaryBCI2000Controller

Versioning

Author

  • Jürgen Mellinger (mellinger@neurotechcenter.org)

Version History

Source Code Revisions

  • Initial development: 6819
  • Tested under: 6819
  • Known to compile under: 6819

Known Issues

  • Log windows of primary and secondary BCI2000 instances will initially have the same location, hiding each other and possibly leading to confusion. The same applies to operator main windows if secondary instances are not hidden by calling "Hide Window" from the secondary batch file(s).

Functional Description

The extension will start up one or more secondary instances of BCI2000, and synchronize data file storage and operation state between the instances. This is useful to record from two or more different data sources at the same time, when online processing of secondary data sources is not required. In later analysis, data from the multiple sources may be aligned in time using BCI2000 time stamps found in the data files.

Integration into BCI2000

Compile the extension into your source module by enabling contributed extensions in your CMake configuration. In your root build folder, run Configure.sh.cmd in order to bring up the CMake GUI; there, enable EXTENSIONS_SECONDARY_BCI2000_CONTROLLER.

Once the extension is built into the source module, enable it by starting the source module with the --SecondaryBCI2000=1 command line argument.

Usage

When the SecondaryBCI2000Controller extension has been enabled in the system at compile time, you will find a BCI2000TwiceStartup.bat batch file in your BCI2000 batch folder. Double-click it to start BCI2000.

Startup configuration of secondary BCI2000 instances is done in the files BCI2000SecondaryStartup.bat, BCI2000Secondary2Startup.bat, etc. You may load identical or different configuration parameter files in the startup batch files.

Data file location is synchronized between BCI2000 instances. Secondary instances use identical file names to the first one, with an appended _1, _2, ... before the file name extension.

Parameters

The SecondaryBCI2000Controller extension is configured in the Source tab within the "Secondary BCI2000" section. The configurable parameters are:

SecondaryBCI2000

Enables/Disables the SecondaryBCI2000Controller.

SecondaryBCI2000Instances

A matrix with one row per secondary instance.

The first column contains the telnet port that is used to control the secondary instance of BCI2000.

The second column contains the the script that is used to start up and configure the secondary instance of BCI2000. An example script is available as BCI2000SecondaryStartup.bat in your BCI2000 batch directory, and is called by the BCI2000TwiceStartup.bat batch file.


To tell the second instance that it should refer to the first one for file names, there is a command line parameter:

IsSecondaryBCI2000

This parameter must be set to 1 in the secondary instance's batch file: --IsSecondaryBCI2000=1

See also

Contributions:Extensions, User Reference:Operator Module Scripting