Mimic poke signals
The Behavior device can mimic or mirror the poke peripheral's infrared beam signal and valve output on other output lines. This is useful for triggering external equipment directly or recording reward delivery on an external acquisition system without the round-trip latency introduced by routing signals through the computer.
Refer to the Mice Poke connection section to set up the Mice Poke peripheral on port P0 and the Digital Output connection section to connect an LED to DO0 as an indicator. We will use these ports for the rest of the exercises.
This article covers how to mimic the poke peripheral's infrared signal and valve outputs in Bonsai.
The complete workflow is shown below. Copy and paste it into Bonsai to get started immediately, or build each section by following the step-by-step instructions in the following sections.
Enable poke infrared mimic
To mimic the infrared signal on the poke ports, first select the mimic infrared port register that corresponds to the port (e.g. MimicPort0IR for P0). Then, specify an output line to mimic the signal on (e.g. DO0 for DO0). No further configuration is necessary as the poke infrared detector is enabled by default.
- Insert a
KeyDownoperator and set theFilterproperty toA. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0IRPayload.MimicPort0IR- Select the output line to mimic the signal on (e.g.DO0). To disable the mimic in the future, selectNone.
- Insert a
MulticastSubjectoperator namedBehavior Commands.
Run the workflow, press A to enable the poke infrared mimic, and trigger the infrared poke detector on P0. The LED indicator connected to DO0 should follow the beam state.
Warning
A mimic output line still responds to commands that modify digital outputs, such as OutputSet and OutputClear. Other mimic registers can also select the same line. To avoid conflicts, dedicate each mimic output line to a single source and clear any leftover configurations.
Enable poke valve mimic
To mimic the valve output signal on the poke ports, first select the mimic valve register that corresponds to the port (e.g. MimicPort0Valve for P0). Then, specify an output line to mimic the signal on (e.g. DO0 for DO0). The second branch in the workflow adds a keyboard trigger to turn on the valve output and demonstrate the mimic functionality.
- Insert a
KeyDownoperator and set theFilterproperty toS. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0ValvePayload.MimicPort0Valve- Select the output line to mimic the signal on (e.g.DO0). To disable the mimic in the future, selectNone.
- Insert a
MulticastSubjectoperator namedBehavior Commands.
To trigger the valve output, send an OutputSet command in a separate branch:
- Insert a
KeyDownoperator and set theFilterproperty toD. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectOutputSetPayload.OutputSet- Select the valve to open (e.g.SupplyPort0for P0).
- Insert a
MulticastSubjectoperator namedBehavior Commands.
Run the workflow, press S, then press D to open the P0 valve. The valve supply lines boot with pulse mode enabled, so the LED indicator on DO0 should flash briefly.
Documentation for release v3.4.0