Table of Contents

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 Signals

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).

Mimic Poke Inputs

  • Insert a KeyDown operator and set the Filter property to A.
  • Insert a CreateMessage operator and configure the following properties:
    • Payload - Select MimicPort0IRPayload.
    • MimicPort0IR - Select the target output line (e.g. DO0)
  • Insert a MulticastSubject operator named Behavior Commands.

In a separate branch:

  • Insert a KeyDown operator and set the Filter property to S.
  • Insert a CreateMessage operator and configure the following properties:
    • Payload - Select MimicPort0IRPayload.
    • MimicPort0IR - Select None to disable the mimic target configuration.
  • Insert a MulticastSubject operator named Behavior 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).

Mimic Poke Valves

  • Insert a KeyDown operator and set the Filter property to D.
  • Insert a CreateMessage operator and configure the following properties:
    • Payload - Select MimicPort0ValvePayload.
    • MimicPort0Valve - Select the target output line (e.g. DO0)
  • Insert a MulticastSubject operator named Behavior Commands.

In a separate branch:

  • Insert a KeyDown operator and set the Filter property to F.
  • Insert a CreateMessage operator and configure the following properties:
    • Payload - Select MimicPort0ValvePayload.
    • MimicPort0Valve - Select None to disable the mimic target configuration.
  • Insert a MulticastSubject operator named Behavior Commands.

To trigger the valve output, send an OutputSet command in a separate branch:

  • Insert a KeyDown operator and set the Filter property to G.
  • Insert a CreateMessage operator and configure the following properties:
    • Payload - Select OutputSetPayload.
    • OutputSet - Select the valve to open (e.g. SupplyPort0 for P0).
  • Insert a MulticastSubject operator named Behavior 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