diff --git a/docs/articles/toc.yml b/docs/articles/toc.yml index 8f6ea18..34587b1 100644 --- a/docs/articles/toc.yml +++ b/docs/articles/toc.yml @@ -6,7 +6,7 @@ href: install_bonsai.md - name: Install Harp href: install_harp.md -- name: Bonsai/Harp Examples (13) +- name: Bonsai/Harp Examples (14) items: - name: Behavior Board (11) items: @@ -32,10 +32,12 @@ href: ../workflows/HarpExamples/BehaviorBoard/QuadratureEncoder/QuadratureEncoder.md - name: Log Selected href: ../workflows/HarpExamples/BehaviorBoard/LogSelected/LogSelected.md - - name: Olfactometer (1) + - name: Olfactometer (2) items: - name: End Valve Toggle - href: ../workflows/HarpExamples/Olfactometer/EndValveToggle/EndValveToggle.md + href: ../workflows/HarpExamples/Olfactometer/EndValveToggle/EndValveToggle.md + - name: Odor Valve Toggle + href: ../workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.md - name: Syringe Pump (1) items: # - name: Toggle Single Steps diff --git a/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.bonsai b/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.bonsai new file mode 100644 index 0000000..478998f --- /dev/null +++ b/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.bonsai @@ -0,0 +1,225 @@ + + + + + + 1 + + + + Device Commands + + + + Active + On + true + On + Disabled + false + COM5 + + + + Device Events + + + 1.1 + + + + + + + 1.2 + + + + + + + 1.3 + + + + + + + 2 + + + + + B + false + + + + Write + + Enabled + + + + 3 + + + + + E + false + + + + Write + + Disabled + + + + 4 + + + + Write + + Valve0 Valve1 + + + + 5 + + + + Write + + 500 + + + + 6 + + + + Write + + 500 + + + + 7 + + + + Write + + 80 + 80 + 0 + 0 + 720 + + + + + + + Device Commands + + + 8 + + + + Device Events + + + + + + 9 + + + + + A + false + + + + 9.1 + + + + Write + + Valve0 + + + + Device Commands + + + + PT2S + + + + 9.2 + + + + Write + + Valve1 + + + + Device Commands + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.md b/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.md new file mode 100644 index 0000000..6805454 --- /dev/null +++ b/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.md @@ -0,0 +1,46 @@ +# Odor Valve Toggle + +## Summary +This example demonstrates how to configure the Harp Olfactometer to toggle the Odor Valves using the [Harp Olfactometer](https://github.com/harp-tech/device.olfactometer) board (see hardware diagram below). + +## Workflow + +:::workflow +![Example](~/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.bonsai) +::: + +## Details + +1. Creates a subject node to send commands to the Olfactometer board and publishes all the events from the device. The PortName property in the Olfactometer node needs to be set to the COM device on the computer. To create the subject node, right-click on the Olfactometer node -> Create Source -> Behavior Subject, and name it accordingly. + 1. Filters event messages associated with the Channel 0 flow rate. + 2. Filters event messages associated with the Channel 1 flow rate. + 3. Filters event messages associated with the Channel 4 flow rate. +2. Enables the Olfactometer flow by pressing the 'B' key. +3. Disables the Olfactometer flow by pressing the 'E' key. +4. Enables the valves to be configured with hardware generated pulse. +5. Configures the value (in milliseconds) of the Odor valve 0 pulse. +6. Configures the value (in milliseconds) of the Odor valve 1 pulse. +7. Sets the target flow rate for all the channels of the olfactometer. If they are not used they are configure with zero value. +8. Ensures that command messages are sent only when the device is ready. +9. Sets the state of the different valves to perform a 500 ms odor delivery after 'A' key press. + 1. Odor valve 0 is enabled 2 seconds before the Odor valve 1 toggles. + 2. Odor valve 1 is enabled. + + +## Requirements + +This example requires the following Bonsai package: +- Harp.Olfactometer (from nuget.org) - make sure to select 'Include prerelease' + + +## Schematics + +The [Harp Olfactometer](https://github.com/harp-tech/device.olfactometer) supports up to 4 odor channels and 1 carrier line. + +In this example, Channel 0 (odor line) is configured with a 80 ml/min flow rate, Channel 1 (odor line) with 80 ml/min and Channel 4 (carrier line) with 720 ml/min. + +After 'A' key press the odor channel 0 flow is enabled, goes through the correspondent vial, mixes with the auxiliary carrier line and is delivered to the animal. The duration of the odor pulse is 500 ms. Then, 2 s after the enabling of odor channel 0, odor channel 1 is also enabled during 500 ms, mixed with the auxiliary carrier line and delivered to the animal. + +![Schematics](./OdorValveToggle.png){ width=80% } + + diff --git a/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.png b/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.png new file mode 100644 index 0000000..3e82319 Binary files /dev/null and b/docs/workflows/HarpExamples/Olfactometer/OdorValveToggle/OdorValveToggle.png differ