Table of Contents

StartAcquisition

combinator Operator

Starts data acquisition and frame distribution on a ContextTask.

The Open Neuro Interface (ONI) hardware specification and API describe a general purpose acquisition system architecture and programming interface for communication with a host PC. One requirement of ONI is a sequence of events that must occur in order to start synchronized data acquisition. StartAcquisition performs these required actions on one or more ContextTasks provided in its input sequence. Once acquisition is started, devices managed by a particular ContextTask will start to produce data in a format called an ONI Data Frame. The output sequence of this operator is therefore a IGroupedObservable<TKey, TElement>, where

Tkey Is the address of a particular hardware device within a single ContextTask.
TElement Is a ONI Frame produced by the device with address Tkey.
These pre-sorted frame sequences can be interpreted by downstream Data I/O operators (e.g. AnalogInput or Bno055Data) that convert ONI Data Frames into data types that are are more amenable to processing within Bonsai workflows.

StartAcquisition Workflow

Inputs & Outputs

Starts data acquisition and frame distribution on a ContextTask and returns the sequence of all received oni.Frame objects, grouped by device address.

The sequence of ContextTask objects on which to start data acquisition and frame distribution.

right-arrow
representation of a combinator operator
right-arrow

A sequence of data frames produced by each ContextTask in the input sequence and grouped by device address.

Properties

Property Type Description
ReadSize int

Gets or sets the number of bytes read per cycle of the ContextTask's acquisition thread.

This option allows control over a fundamental trade-off between closed-loop response time and available bandwidth. A minimal value, which is determined by MaxReadFrameSize, will provide the lowest response latency, so long as data can be cleared from hardware memory fast enough to prevent buffering. Larger values will both reduce system call frequency and reduce the number of function calls per unit time performed by Bonsai, and therefore, increase available bandwidth. Larger values may improve processing performance for high-bandwidth data sources. The optimal value depends on the host computer and hardware configuration and must be determined via testing (e.g. using MemoryMonitorData).

WriteSize int

Gets or sets the number of bytes that are pre-allocated for writing data to hardware.

This value determines the amount of memory that is pre-allocated for calls to Write(uint, IntPtr, int), Write<T>(uint, T), and Write<T>(uint, T[]). A larger size will reduce the frequency of dynamic memory allocation system calls but increase the expense of each of those calls. The minimum size of this option is determined by MaxWriteFrameSize. The effect on real-time performance is typically not as large as that of BlockReadSize because this parameter defines a readily-available pool of memory for the creation of output data frames, but does not determine when they are written to hardware. Data is written to hardware as soon as an output frame has been created. In contrast data is read from hardware whenever more than ReadSize bytes have accumulated in the input buffer.