Mimic Poke Signals
The Behavior board can mimic or mirror the poke peripheral's infrared port inputs and valve output on other output lines. This is useful for triggering external equipment directly or recording reward delivery on an external acquisition system and avoids round-trip latency from going through the computer.
Refer to the connections article to set up the Mice Poke peripheral on port P0 and connect an indicator (like an LED) to DO0, which we will use for the rest of the examples.
Warning
Due to a bug in the current firmware (v3.3), only DO0 and DO2 can be used as mimic targets.
This article covers how to mimic poke inputs and valve outputs in Bonsai.
The complete workflow is shown below. Copy and paste it into Bonsai or build each section by following the step-by-step instructions below.
Mimic Poke Inputs
Set a mimic target output line for the poke's infrared inputs with the appropriate port register (e.g. MimicPort0IR for P0).
- Insert a
KeyDownoperator and set theFilterproperty toA. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0IRPayload.MimicPort0IR- Select the target output line (e.g.DO0)
- Insert a
MulticastSubjectoperator namedBehavior Commands.
In a separate branch:
- Insert a
KeyDownoperator and set theFilterproperty toS. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0IRPayload.MimicPort0IR- SelectNoneto disable the mimic target configuration.
- Insert a
MulticastSubjectoperator namedBehavior Commands.
Run the workflow, press A to enable the mimic target, and trigger the infrared poke detector on P0. The indicator on DO0 should follow the beam state. Press S to remove the mimic target configuration.
Warning
A mimic target line still responds to commands that modify digital outputs, such as OutputSet and OutputClear. Other mimic registers can also select the same target. To avoid conflicts, dedicate each mimic target to a single source and clear any leftover configurations.
Mimic Poke Valves
Similarly, to mimic the valve output, set a mimic target in the appropriate port register (e.g. MimicPort0Valve for P0).
- Insert a
KeyDownoperator and set theFilterproperty toD. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0ValvePayload.MimicPort0Valve- Select the target output line (e.g.DO0)
- Insert a
MulticastSubjectoperator namedBehavior Commands.
In a separate branch:
- Insert a
KeyDownoperator and set theFilterproperty toF. - Insert a
CreateMessageoperator and configure the following properties:Payload- SelectMimicPort0ValvePayload.MimicPort0Valve- SelectNoneto disable the mimic target configuration.
- Insert a
MulticastSubjectoperator namedBehavior Commands.
To trigger the valve output, send an OutputSet command in a separate branch:
- Insert a
KeyDownoperator and set theFilterproperty toG. - 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 D, then press G to open the P0 valve. DO0 follows the valve state, including timed pulses. Press F to remove the mimic target configuration.
Last updated with:
Hardware v2.1
Firmware v3.3
Bonsai Package v0.2