Jump to content

User Reference:BCI2000Watchdog: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
Mellinger (talk | contribs)
Line 17: Line 17:


===Entering Canary Expressions (Watches)===
===Entering Canary Expressions (Watches)===
By default, the watchdog observes changes in the ''SourceTime'' BCI2000 state and gives alarm when the ''SourceTime'' state has not changed for 2 seconds.
In a live BCI2000 system, the ''SourceTime'' state changes with each BCI2000 data block, so if it stays constant for 2 seconds, this is an indication that the BCI2000 system has ceased to function. The default of 2 seconds has been chosen to make sure not to interfere with recordings that have very large sample block duration.
For testing data acquisition functionality in BCI2000, observing the ''SourceTime'' state should be sufficient. However, when recording video or other auxiliary data, the respective data stream might be broken without affecting the ''SourceTime'' state. In these cases, it will be useful to add an expression that covers the respective partial functionality. E.g., to ensure functionality of recording from the first attached webcam, you would enter an expression of ''WebcamFrame0''.


===Starting BCI20000===
===Starting BCI20000===

Revision as of 16:28, 16 July 2024

Introduction

BCI2000Watchdog is a program that monitors the function of a running BCI2000 instance, and restarts it if malfunction is detected. Functioning of BCI2000 is determined by monitoring "Canary expressions" which are evaluated in the context of BCI2000 and are expected to change on a regular basis, e.g. the time stamp of the currently processed data block, and/or the frame number of a video recorded alongside brain signal signal data.

Using BCI2000Watchdog

Selecting a BCI2000 Startup Batch File

The top element of BCI2000Watchdog holds the full path to a BCI2000 startup batch file. This may be any BCI2000 batch file, except that it must contain the SET CONFIG and START commands. If the batch file does not contain these commands, SetConfig and Start must be presses manually, so the watchdog will be unable to start operation of BCI2000 when it tries to restart it.

Pressing the "..." button at the right side of the edit field will bring up a file selection dialog, so you don't need to enter the full path manually.

Also, dragging a batch file onto the edit field will enter the file's full path.

In addition, a batch file may be given on the command line when starting up BCI2000Watchdog, or by dragging-and-dropping onto the program's icon.

Entering Canary Expressions (Watches)

By default, the watchdog observes changes in the SourceTime BCI2000 state and gives alarm when the SourceTime state has not changed for 2 seconds. In a live BCI2000 system, the SourceTime state changes with each BCI2000 data block, so if it stays constant for 2 seconds, this is an indication that the BCI2000 system has ceased to function. The default of 2 seconds has been chosen to make sure not to interfere with recordings that have very large sample block duration.

For testing data acquisition functionality in BCI2000, observing the SourceTime state should be sufficient. However, when recording video or other auxiliary data, the respective data stream might be broken without affecting the SourceTime state. In these cases, it will be useful to add an expression that covers the respective partial functionality. E.g., to ensure functionality of recording from the first attached webcam, you would enter an expression of WebcamFrame0.

Starting BCI20000

Recovering from an Error