Skip to content

Commit

Permalink
Update AnalogIODevice workflow
Browse files Browse the repository at this point in the history
- New AnalogIODevice.bonsai (from Jon) saves data
- Added a Python file (from Jon) to read data
  • Loading branch information
cjsha committed Apr 12, 2024
1 parent b5627c7 commit 09a811f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
5 changes: 5 additions & 0 deletions source/Software Guide/Bonsai.ONIX/Nodes/AnalogIODevice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,8 @@ options.
- The direction of the channel. If set to Output, the measured voltage is
automatically looped back through the analog input.

Loading Scripts
--------------------------
The following scripts can be used to load the data produced by this workflow in Python (using Numpy):

- :download:`load-analog-data.py <../../../_static/bonsai/workflows/load-analog-data.py>`
23 changes: 21 additions & 2 deletions source/_static/bonsai/workflows/AnalogIO.bonsai
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.6.2"
<WorkflowBuilder Version="2.8.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p1="clr-namespace:Bonsai.ONIX;assembly=Bonsai.ONIX"
xmlns:dsp="clr-namespace:Bonsai.Dsp;assembly=Bonsai.Dsp"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
Expand Down Expand Up @@ -69,14 +70,32 @@
<Expression xsi:type="MemberSelector">
<Selector>Data</Selector>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="dsp:MatrixWriter">
<dsp:Path>analog-data_.raw</dsp:Path>
<dsp:Suffix>Timestamp</dsp:Suffix>
<dsp:Overwrite>false</dsp:Overwrite>
<dsp:Layout>ColumnMajor</dsp:Layout>
</Combinator>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Clock</Selector>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="dsp:MatrixWriter">
<dsp:Path>analog-clock_.raw</dsp:Path>
<dsp:Suffix>Timestamp</dsp:Suffix>
<dsp:Overwrite>false</dsp:Overwrite>
<dsp:Layout>ColumnMajor</dsp:Layout>
</Combinator>
</Expression>
</Nodes>
<Edges>
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="2" To="4" Label="Source1" />
<Edge From="2" To="5" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
4 changes: 2 additions & 2 deletions source/_static/bonsai/workflows/AnalogIO.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 09a811f

Please sign in to comment.