Jump to content

Contributions:SecondaryBCI2000Controller: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
Mellinger (talk | contribs)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Synopsis==
==Synopsis==
An extension that controls a secondary BCI2000 instance from the GUI of a primary one.
An extension that controls one or more secondary BCI2000 instances from the GUI of a primary one.


==Location==
==Location==
Line 16: Line 16:


===Known Issues===
===Known Issues===
*When recording into a directory that already contains data files with the same base name, data file name will be out of sync between the first and second instance of BCI2000. Also, run numbers stored within the files will be out of sync.
*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).
*Log windows of primary and secondary BCI2000 instance will have the same location, hiding each other and possibly leading to confusion. The same applies to operator main windows if the second instance is not hidden by calling "Hide Window" from the secondary batch file.


==Functional Description==
==Functional Description==
The extension will start up a second instance of BCI2000, and synchronize data file storage and operation state between the two instances. This is useful to record from two different data sources at the same time, when online processing of one of the data sources is not required. In later analysis, data from the two sources may be aligned in time using BCI2000 time stamps found in the two data files.
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==
==Integration into BCI2000==
Line 30: Line 29:
When the SecondaryBCI2000Controller extension has been enabled in the system at compile time, you will find a <tt>BCI2000TwiceStartup.bat</tt> batch file in your BCI2000 batch folder. Double-click it to start BCI2000.
When the SecondaryBCI2000Controller extension has been enabled in the system at compile time, you will find a <tt>BCI2000TwiceStartup.bat</tt> batch file in your BCI2000 batch folder. Double-click it to start BCI2000.


Startup configuration of the secondary instance of BCI2000 is done in the file <tt>BCI2000TwiceSecondaryStartup.bat</tt>.
Startup configuration of secondary BCI2000 instances is done in the files <tt>BCI2000SecondaryStartup.bat</tt>, <tt>BCI2000Secondary2Startup.bat</tt>, etc.
You may load identical or different configuration parameter files in the two startup batch files.
You may load identical or different configuration parameter files in the startup batch files.


Data file location is synchronized between the two BCI2000 instances. The second instance uses identical file names to the first one, with an appended <tt>_1</tt> before the file name extension.
Data file location is synchronized between BCI2000 instances. Secondary instances use identical file names to the first one, with an appended <tt>_1</tt>, <tt>_2</tt>, ... before the file name extension.


==Parameters==
==Parameters==
Line 41: Line 40:
Enables/Disables the SecondaryBCI2000Controller.
Enables/Disables the SecondaryBCI2000Controller.


===SecondaryBCI2000TelnetPort===
===SecondaryBCI2000Instances===
The telnet port that is used to control the secondary instance of BCI2000.
A matrix with one row per secondary instance.


===SecondaryBCI2000StartupScript===
The first column contains the telnet port that is used to control the secondary instance of BCI2000.
The script that is used to start up and configure the secondary instance of BCI2000. An example script is available as <tt>BCI2000TwiceSecondaryStartup.bat</tt> in your BCI2000 batch directory, and is called by the <tt>BCI2000TwiceStartup.bat</tt> batch file.
 
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 <tt>BCI2000SecondaryStartup.bat</tt> in your BCI2000 batch directory, and is called by the <tt>BCI2000TwiceStartup.bat</tt> 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: <tt>--IsSecondaryBCI2000=1</tt>


==See also==
==See also==

Latest revision as of 14:46, 1 July 2025

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