Skip to content

Commit 7145934

Browse files
committed
Edit explanation of example workflow
1 parent 6b45de1 commit 7145934

File tree

4 files changed

+35
-31
lines changed

4 files changed

+35
-31
lines changed

articles/hardware/breakout/analog-io.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,11 @@ The <xref:OpenEphys.Onix1.AnalogInput> operator receives a sequence of
8686
- `DeviceName` is set to "BreakoutBoard/AnalogIO". This links the `AnalogInput`
8787
operator to the corresponding configuration operator.
8888

89-
The [MemberSelector](xref:Bonsai.Expressions.MemberSelectorBuilder)
90-
operators each select a member from the `AnalogInputDataFrame`, `Clock` and `AnalogData` which
91-
contain the <xref:OpenEphys.Onix1.ContextTask.AcquisitionClockHz>-based sample times and sample
92-
values, respectively. The
93-
[MatrixWriter](xref:Bonsai.Dsp.MatrixWriter) operators saves the
94-
selected members to files with the following format: `analog-clock_<filecount>.raw` and
89+
`Clock`, `AnalogData` are members of `DigitalInputDataFrame` which are each selected by a
90+
[MemberSelector](xref:Bonsai.Expressions.MemberSelectorBuilder) operator. They contain the
91+
<xref:OpenEphys.Onix1.ContextTask.AcquisitionClockHz>-based sample times, analog sample values,
92+
respectively. The [MatrixWriter](xref:Bonsai.Dsp.MatrixWriter) operators save the selected members
93+
to files with the following format: `analog-clock_<filecount>.raw` and
9594
`analog-data_<filecount>.raw`, respectively.
9695

9796
> [!Tip]

articles/hardware/breakout/digital-inputs.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@ when a pin, button, or switch is toggled). The digital input ports on the Breako
1919
but are also 5V tolerant. In the Breakout Board example workflow, the `DigitalInput`'s `DeviceName` property is set to
2020
"BreakoutBoard/DigitalInput". This links the `DigitalInput` operator to the corresponding configuration operator.
2121

22-
The [CsvWriter](xref:Bonsai.IO.CsvWriter) operator writes the `Clock`, `DigitalInputs`, and `Buttons` members from the
23-
`DigitalInputDataFrame` to a file with the following name format: `digital-input_<filecount>.csv`. Because `CsvWriter`
24-
is a _sink_ operator, its output sequence is equivalent to its input sequence. In other words, its output is equivalent
25-
to `DigitalInput`'s output. Therefore, it's possible to use
26-
[MemberSelector](xref:Bonsai.Expressions.MemberSelectorBuilder) operators on the `CsvWriter` to select members from
27-
`DigitalInputDataFrame`. This is most easily performed by clicking the relevant members that appear by hovering over the
28-
"Output" option that appears in the context menu that appears after right-clicking the `CsvWriter` node. The members
29-
selected in the workflow, <xref:OpenEphys.Onix1.DigitalPortState> and <xref:OpenEphys.Onix1.BreakoutButtonState>, are
30-
enumerators with values that correspond to bit positions of the breakout board's digital ports. When `DigitalPortState`
31-
or `OpenEphys.Onix1.BreakoutButtonState` is connected to a `HasFlags` operator, the names that appear in the
32-
`HasFlags`'s `Value` property's dropdown menu correspond to bit positions in the respective digital input port. In this
33-
workflow, the top `HasFlags` operator checks if `Triangle` or `X` are `True`.
22+
`Clock`, `DigitalInputs`, and `Buttons` are all members of `DigitalInputDataFrame` which are each
23+
selected by a [MemberSelector](xref:Bonsai.Expressions.MemberSelectorBuilder) operator. They contain
24+
the <xref:OpenEphys.Onix1.ContextTask.AcquisitionClockHz>-based sample times, digital port status,
25+
and buttons' status, respectively. The [MatrixWriter](xref:Bonsai.Dsp.MatrixWriter) operators save
26+
the selected members to files with the following format: `digital-clock_<filecount>.raw`, and
27+
`digital-pins_<filecount>.raw`, and `digital-buttons_<filecount>.raw`, respectively.
28+
29+
Because `MatrixWriter` is a _sink_ operator, its output sequence is equivalent to its input
30+
sequence. For example, the output of the `MatrixWriter` connected to `Button` is equivalent to
31+
`Button`'s output. Therefore, it's possible to process digital data by branching directly off the
32+
`MatrixWriter` operators. The selected `DigitalInputs` and `Buttons` members are both enumerator
33+
types: <xref:OpenEphys.Onix1.DigitalPortState> and <xref:OpenEphys.Onix1.BreakoutButtonState>,
34+
respectively. Enumerators assign names to values. When `DigitalPortState` or `BreakoutButtonState`
35+
is connected to a `HasFlags` operator, these names appear in the `HasFlags`'s `Value` property's
36+
dropdown menu. In this case, the values that these names represent correspond to bit positions of
37+
the breakout board's digital ports. In this workflow, the top `HasFlags` operator checks if `Pin0`
38+
is `True`, and the bottom `HasFlags` operator checks if `Triangle` or `X` are `True`.

workflows/hardware/breakout/breakout.bonsai

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<WorkflowBuilder Version="2.8.5"
2+
<WorkflowBuilder Version="2.9.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xmlns:onix1="clr-namespace:OpenEphys.Onix1;assembly=OpenEphys.Onix1"
55
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
@@ -198,8 +198,8 @@
198198
</Expression>
199199
<Expression xsi:type="Combinator">
200200
<Combinator xsi:type="dsp:MatrixWriter">
201-
<dsp:Path>digital-pins_</dsp:Path>
202-
<dsp:Suffix>Timestamp</dsp:Suffix>
201+
<dsp:Path>digital-pins_.raw</dsp:Path>
202+
<dsp:Suffix>FileCount</dsp:Suffix>
203203
<dsp:Overwrite>false</dsp:Overwrite>
204204
<dsp:Layout>ColumnMajor</dsp:Layout>
205205
</Combinator>
@@ -214,24 +214,24 @@
214214
</Expression>
215215
<Expression xsi:type="Combinator">
216216
<Combinator xsi:type="dsp:MatrixWriter">
217-
<dsp:Path>digital-buttons_</dsp:Path>
218-
<dsp:Suffix>Timestamp</dsp:Suffix>
217+
<dsp:Path>digital-buttons_.raw</dsp:Path>
218+
<dsp:Suffix>FileCount</dsp:Suffix>
219219
<dsp:Overwrite>false</dsp:Overwrite>
220220
<dsp:Layout>ColumnMajor</dsp:Layout>
221221
</Combinator>
222222
</Expression>
223223
<Expression xsi:type="HasFlag">
224224
<Operand xsi:type="WorkflowProperty" TypeArguments="onix1:BreakoutButtonState">
225-
<Value>Moon Square</Value>
225+
<Value>Triangle X</Value>
226226
</Operand>
227227
</Expression>
228228
<Expression xsi:type="MemberSelector">
229229
<Selector>Clock</Selector>
230230
</Expression>
231231
<Expression xsi:type="Combinator">
232232
<Combinator xsi:type="dsp:MatrixWriter">
233-
<dsp:Path>digital-clock_</dsp:Path>
234-
<dsp:Suffix>Timestamp</dsp:Suffix>
233+
<dsp:Path>digital-clock_.raw</dsp:Path>
234+
<dsp:Suffix>FileCount</dsp:Suffix>
235235
<dsp:Overwrite>false</dsp:Overwrite>
236236
<dsp:Layout>ColumnMajor</dsp:Layout>
237237
</Combinator>

workflows/hardware/breakout/digital-inputs.bonsai

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<WorkflowBuilder Version="2.8.5"
2+
<WorkflowBuilder Version="2.9.0"
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xmlns:onix1="clr-namespace:OpenEphys.Onix1;assembly=OpenEphys.Onix1"
55
xmlns:dsp="clr-namespace:Bonsai.Dsp;assembly=Bonsai.Dsp"
@@ -16,7 +16,7 @@
1616
</Expression>
1717
<Expression xsi:type="Combinator">
1818
<Combinator xsi:type="dsp:MatrixWriter">
19-
<dsp:Path>digital-pins_</dsp:Path>
19+
<dsp:Path>digital-pins_.raw</dsp:Path>
2020
<dsp:Suffix>FileCount</dsp:Suffix>
2121
<dsp:Overwrite>false</dsp:Overwrite>
2222
<dsp:Layout>ColumnMajor</dsp:Layout>
@@ -32,23 +32,23 @@
3232
</Expression>
3333
<Expression xsi:type="Combinator">
3434
<Combinator xsi:type="dsp:MatrixWriter">
35-
<dsp:Path>digital-buttons_</dsp:Path>
35+
<dsp:Path>digital-buttons_.raw</dsp:Path>
3636
<dsp:Suffix>FileCount</dsp:Suffix>
3737
<dsp:Overwrite>false</dsp:Overwrite>
3838
<dsp:Layout>ColumnMajor</dsp:Layout>
3939
</Combinator>
4040
</Expression>
4141
<Expression xsi:type="HasFlag">
4242
<Operand xsi:type="WorkflowProperty" TypeArguments="onix1:BreakoutButtonState">
43-
<Value>Moon Square</Value>
43+
<Value>Triangle X</Value>
4444
</Operand>
4545
</Expression>
4646
<Expression xsi:type="MemberSelector">
4747
<Selector>Clock</Selector>
4848
</Expression>
4949
<Expression xsi:type="Combinator">
5050
<Combinator xsi:type="dsp:MatrixWriter">
51-
<dsp:Path>digital-clock_</dsp:Path>
51+
<dsp:Path>digital-clock_.raw</dsp:Path>
5252
<dsp:Suffix>FileCount</dsp:Suffix>
5353
<dsp:Overwrite>false</dsp:Overwrite>
5454
<dsp:Layout>ColumnMajor</dsp:Layout>

0 commit comments

Comments
 (0)