Table of Contents

Headstage Rhs2116 Configuration

The following excerpt from the Headstage Rhs2116 example workflow demonstrates how to configure your Headstage Rhs2116 and Breakout Board in Bonsai. This process comprises of the following steps:

~/workflows/hardware/rhs2116/configuration.bonsai workflow

NOTE

To learn more about the top-level configuration motif in every workflow involving ONIX hardware, visit the Configuration Chain Tutorial.

Creating an Acquisition Context

The CreateContext operator creates a ContextTask that defines the device driver and index where the hardware exists. The Driver property is set to "riffa" which is the name of the PCIe device used by ONIX. In this case, the Index property is set to 0 because there is only a single ONIX system. If a second system is used on the same computer, a second CreateContext operator would be required in its own configuration chain, with its Index property set to 1.

Configuring the Breakout Board and Headstage Rhs2116

The ConfigureBreakoutBoard operator configures the Onix Breakout Board. In the Headstage Rhs2116 example tutorial, it is configured to enable digital inputs to serve as a trigger for the Headstage Rhs2116's electrical and optical stimulation and to enable monitoring of the percentage of memory occupied. This is accomplished by leaving all of the ConfigureBreakoutBoard properties set to their default values except its Memory Monitor Enable property is set to "True".

The ConfigureHeadstageRhs2116 operator is used to configure the Headstage Rhs2116. In the Headstage Rhs2116 example tutorial, it is configured to enable streaming of electrophysiology data from a Rhs2116 amplifier, orientation data from the on-board Bno055 IMU, and position data from the Ts4231. This is accomplished in the Headstage Rhs2116 example workflow by leaving all of the ConfigureHeadstageRhs2116 properties set to their default values.

When the workflow is started, the current time (based on Coordinated Universal Time) is saved, along with global hardware parameters governing data acquisition. This is accomplished using a TimeStamp operator to capture the computer's wall clock time. The timestamp is saved along with ContextTask's properties (e.g. AcquisitionClockHz, BlockReadSize, BlockWriteSize) to a csv file (start-time_<filecount>.csv) when the workflow is started.

Tip

For additional details on how to configure the headstage, as well as how to set stimulus waveforms, check out the Rhs2116 GUI page.

Starting Acquisition

After starting a workflow, the StartAcquisition operator begins data acquisition with the hardware that has been configured. In the Headstage Rhs2116 example workflow, most collected data is from the Headstage Rhs2116. The rate of data being produced by the hardware will be ~2.1 MB/s. The ReadSize property is set to 4096 bytes, meaning data collection will wait until 4096 bytes of data have been produced by the hardware. At 2.1 MB/s the hardware will produce 4096 bytes every ~1 ms. This is a hard bound on the latency of the system. If lower latencies were required, the hardware would need to produce data more quickly or the ReadSize property value would need to be reduced.

The WriteSize property is set to 2048 bytes. This determines the amount of memory that is preallocated for temporarily holding data before it is sent to hardware. It is less critical to performance unless the rate that data be written to the hardware is comparable to the rate that the hardware produces data, which is not a common scenario.

NOTE

For an overview of the devices on the Headstage Rhs2116 that can be configured through the ConfigureHeadstageRhs2116 operator, visit the Headstage Rhs2116 Overview.