Table of Contents

Rhs2116 Stimulating

The following excerpt from the HeadstageRhs2116 example workflow demonstrates the Rhs2116 stimulation functionality by streaming and saving data from the Rhs2116 device.

/workflows/hardware/rhs2116/rhs2116-stimulate.bonsai workflow

The DigitalInput operator generates a sequence of DigitalInputDataFrames. Although the digital inputs are sampled at 4 Mhz, these data frames are only emitted when the port status changes (i.e., when a pin, button, or switch is toggled). In the Breakout Board example workflow, the DigitalInput's DeviceName property is set to "BreakoutBoard/DigitalInput". This links the DigitalInput operator to the Breakout Board's digital inputs.

BreakoutButtonState is selected from the DigitalInputDataFrame. It is an enumerator with values that correspond to bit positions of the breakout board's digital port. Buttons connects to Condition which is inspectable with the F12 hotkey. Condition contains a HasFlags operator. Because HasFlags's Value property is set to "Triangle", it outputs "True" when the △ button is pressed. Condition passes BreakoutButtonState to Double when the its internal conditional statement is evaluated is true. Double emits a value of type double to Rhs2116StimulusTrigger anytime it receives an item in its upstream sequence.

When Rhs2116StimulusTrigger receives a double from the upstream sequence, a stimulus waveform is triggered. Its DeviceName property is set to "HeadstageRhs2116/StimulusTrigger" to link this operator to the Rhs2116s on the Headstage Rhs2116. Open the Headstage RHS2116 GUI to edit the stimulus waveform.

Tip

For more details about configuring the Rhs2116 and its stimulation capabilities, read the datasheet.