Aind.Ni.DigitalOutput.Configuration
1.5.1
See the version list below for details.
dotnet add package Aind.Ni.DigitalOutput.Configuration --version 1.5.1
NuGet\Install-Package Aind.Ni.DigitalOutput.Configuration -Version 1.5.1
<PackageReference Include="Aind.Ni.DigitalOutput.Configuration" Version="1.5.1" />
<PackageVersion Include="Aind.Ni.DigitalOutput.Configuration" Version="1.5.1" />
<PackageReference Include="Aind.Ni.DigitalOutput.Configuration" />
paket add Aind.Ni.DigitalOutput.Configuration --version 1.5.1
#r "nuget: Aind.Ni.DigitalOutput.Configuration, 1.5.1"
#:package Aind.Ni.DigitalOutput.Configuration@1.5.1
#addin nuget:?package=Aind.Ni.DigitalOutput.Configuration&version=1.5.1
#tool nuget:?package=Aind.Ni.DigitalOutput.Configuration&version=1.5.1
aind-ni-digitaloutput-configuration
A Bonsai library that provides configurable NI-DAQmx Digital Output functionality with external channel configuration support.
Overview
This package provides a flexible alternative to the standard Bonsai.DAQmx DigitalOutput
node by allowing channel configuration to be provided externally at runtime. This enables more dynamic and reusable digital output workflows.
Features
- Runtime Channel Configuration: Configure digital output channels through external configuration sources
- External Configuration Support: Channel settings can come from files, other nodes, or external systems
- CI Build Compatibility: Supports builds without DAQmx runtime for continuous integration
- Type-Safe Configuration: Uses strongly-typed configuration objects with validation
- Multiple Data Types: Supports boolean, Mat, and array inputs like the standard DigitalOutput
Installation
To install the aind-ni-digitaloutput-configuration package:
- Open Bonsai
- Click on the "Tools" menu and select "Manage Packages"
- Click on "Settings" and add the NuGet package source where this package is hosted
- Search for "Aind.Ni.DigitalOutput.Configuration" and install
Prerequisites
- Windows Operating System - Bonsai and NI-DAQmx are Windows-only
- NI-DAQmx Runtime - Install the National Instruments DAQmx drivers for full functionality
- Bonsai - Version 2.7.0 or later
Components
This package provides four main components:
ConfigurableDigitalOutput
The main digital output operator that accepts external channel configuration. This is a more flexible alternative to the standard DigitalOutput
node.
Properties:
TaskName
: Optional name for the DAQmx taskSignalSource
: Optional source terminal for the clockSampleRate
: Sampling rate in samples per second (default: 1000.0)BufferSize
: Buffer size for continuous samples (default: 1000)ActiveEdge
: Clock edge for sampling (Rising/Falling)SampleMode
: Finite or continuous sample generation
DigitalOutputConfigurationSource
Generates configuration objects for digital output channels that can be connected to ConfigurableDigitalOutput
.
Properties:
ChannelName
: Name for the virtual channelLines
: Physical lines to use (e.g., "Dev1/port0/line0:7")Grouping
: How to group digital lines (OneChannelForEachLine/OneChannelForAllLines)
DigitalOutputChannelConfig
Configuration data structure containing channel setup parameters:
ChannelName
: The virtual channel nameLines
: Physical DAQmx lines specificationGrouping
: Line grouping method
ConfigureDigitalOutputChannels
Combines multiple channel configurations into arrays for multi-channel scenarios.
Usage Examples
Basic Single Channel Configuration
DigitalOutputConfigurationSource -> ConfigurableDigitalOutput
BooleanSource /
Add a
DigitalOutputConfigurationSource
and configure:ChannelName
: "MyChannel"Lines
: "Dev1/port0/line0"Grouping
: OneChannelForEachLine
Add a
ConfigurableDigitalOutput
nodeConnect both the configuration and your boolean data stream to the
ConfigurableDigitalOutput
Multi-Channel Configuration
ConfigureDigitalOutputChannels -> ConfigurableDigitalOutput
MatSource /
- Configure multiple channels in
ConfigureDigitalOutputChannels
- Connect to
ConfigurableDigitalOutput
along with your data source
External Configuration from File
You can load configuration from external sources and feed it to ConfigurableDigitalOutput
, enabling dynamic reconfiguration without rebuilding workflows.
Supported Data Types
ConfigurableDigitalOutput
supports the same data types as the standard DigitalOutput
:
IObservable<bool>
- Single boolean valuesIObservable<bool[]>
- Boolean arraysIObservable<Mat>
- OpenCV Mat objects with integer depth types (U8, S8, U16, S16, S32)
Architecture
Design Principles
This package solves the limitation of the standard DigitalOutput
node which requires design-time channel configuration. By using a combinator pattern with external configuration, ConfigurableDigitalOutput
enables:
- Runtime Configuration: Channels can be configured from external sources
- Reusable Workflows: The same workflow can work with different hardware setups
- Dynamic Reconfiguration: Channel settings can change during workflow execution
Testing
The package includes comprehensive tests in the test/
directory:
# Run tests (requires DAQmx runtime)
cd test
dotnet run
Tests include:
- Configuration object creation and validation
- CI build compatibility
- Basic functionality verification (without hardware)
Deployment
This package can be deployed to NuGet.org via GitHub Actions workflow. To trigger a deployment:
- Update the version in the project file
- Commit and push changes to the
main
branch - Create a new tag in the format
v<version>
- The automated workflow will build and publish the package
License
This project is licensed under the MIT License - see the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Bonsai.Core (>= 2.7.0)
- Bonsai.DAQmx (>= 0.4.0)
- OpenCV.Net (>= 3.4.1)
- Rx-Linq (>= 2.2.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.10.0 | 168 | 7/3/2025 |
1.9.0 | 154 | 7/3/2025 |
1.8.15 | 143 | 7/3/2025 |
1.8.14 | 144 | 7/3/2025 |
1.8.8 | 147 | 7/3/2025 |
1.8.7 | 145 | 7/2/2025 |
1.8.6 | 139 | 7/2/2025 |
1.8.5 | 140 | 7/2/2025 |
1.8.3 | 137 | 7/2/2025 |
1.8.2 | 141 | 7/2/2025 |
1.8.1 | 142 | 7/2/2025 |
1.8.0 | 140 | 7/2/2025 |
1.7.0 | 145 | 7/2/2025 |
1.6.0 | 150 | 6/30/2025 |
1.5.1 | 236 | 6/9/2025 |
1.2.0 | 126 | 6/7/2025 |
1.1.0 | 123 | 6/7/2025 |