Table of Contents

Class DigitalOutput

Namespace
Bonsai.DAQmx
Assembly
Bonsai.DAQmx.dll

Represents an operator that writes logical values to one or more DAQmx digital output lines from a sequence of sample buffers.

DigitalOutput configures and starts a task for writing logical values to one or more digital output lines. Logical values for each line are read from sample buffers in the source sequence, where each row corresponds to one of the channels in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the Channels property.

Each logical value sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel. Digital lines can be grouped as a port when creating the local virtual channel, either by specifying a range of lines (e.g. Dev1/port0/line0:3) or by specifying an entire port at once (e.g. Dev1/port0).

Signals can be generated continuously, where a ring buffer is constanty updated with new data arriving from the source sequence.

DigitalOutput-Continuous

Logical values can also be provided by a source of integers specifying a bitmask with the state of all digital lines in a single port.

DigitalOutput-ContinuousSingleSample

Alternatively, signals can also be generated with a finite number of samples, in which case the input buffers will provide samples until the specified buffer size is reached. In this case, the operator will wait for the task to finish generating the specified number of samples.

DigitalOutput-Finite

public class DigitalOutput : Sink<Mat>
Inheritance
DigitalOutput
Inherited Members

Properties

ActiveEdge

Gets or sets a value specifying on which edge of a clock pulse sampling takes place.

public SampleClockActiveEdge ActiveEdge { get; set; }

Property Value

SampleClockActiveEdge

BufferSize

Gets or sets the number of samples to generate, for finite samples, or the size of the buffer for continuous samples.

public int BufferSize { get; set; }

Property Value

int

Channels

Gets the collection of virtual output channels on which to write the logical values.

public Collection<DigitalOutputChannelConfiguration> Channels { get; }

Property Value

Collection<DigitalOutputChannelConfiguration>

SampleMode

Gets or sets a value specifying whether the writer task will generate a finite number of samples or if it continuously generates samples.

public SampleQuantityMode SampleMode { get; set; }

Property Value

SampleQuantityMode

SampleRate

Gets or sets the sampling rate for writing logical values, in samples per second.

public double SampleRate { get; set; }

Property Value

double

SignalSource

Gets or sets the optional source terminal of the clock. If not specified, the internal clock of the device will be used.

public string SignalSource { get; set; }

Property Value

string

Methods

Process(IObservable<Mat>)

Writes logical values to one or more DAQmx digital output lines from an observable sequence of sample buffers.

public override IObservable<Mat> Process(IObservable<Mat> source)

Parameters

source IObservable<Mat>

A sequence of 2D Mat objects storing the logical values. Each row corresponds to a channel in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the Channels property. Each sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel.

Returns

IObservable<Mat>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<bool[]>)

Writes an observable sequence of boolean samples to one or more DAQmx digital output lines.

public IObservable<bool[]> Process(IObservable<bool[]> source)

Parameters

source IObservable<bool[]>

A sequence of 1D arrays of boolean samples representing the state of a digital output channel in a local virtual port.

Returns

IObservable<bool[]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<bool>)

Writes an observable sequence of logical values to one or more DAQmx digital output lines.

public IObservable<bool> Process(IObservable<bool> source)

Parameters

source IObservable<bool>

A sequence of boolean values representing the logical levels to write to one or more DAQmx digital output lines.

Returns

IObservable<bool>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<byte[,]>)

Writes logical values to one or more DAQmx digital output lines from an observable sequence of unsigned 8-bit multi-channel sample buffers.

public IObservable<byte[,]> Process(IObservable<byte[,]> source)

Parameters

source IObservable<byte[,]>

A sequence of multi-dimensional byte arrays storing the logical values. Each row corresponds to a channel in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the Channels property. Each sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel.

Returns

IObservable<byte[,]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<byte[]>)

Writes an observable sequence of unsigned 8-bit samples to one or more DAQmx digital output lines.

public IObservable<byte[]> Process(IObservable<byte[]> source)

Parameters

source IObservable<byte[]>

A sequence of 8-bit unsigned integer arrays representing the state of digital output lines in a local virtual port channel.

Returns

IObservable<byte[]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<byte>)

Writes an observable sequence of unsigned 8-bit samples to one or more DAQmx digital output lines.

public IObservable<byte> Process(IObservable<byte> source)

Parameters

source IObservable<byte>

A sequence of 8-bit unsigned integers representing the state of digital output lines in a local virtual port channel.

Returns

IObservable<byte>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<short[,]>)

Writes logical values to one or more DAQmx digital output lines from an observable sequence of signed 16-bit multi-channel sample buffers.

public IObservable<short[,]> Process(IObservable<short[,]> source)

Parameters

source IObservable<short[,]>

A sequence of multi-dimensional short arrays storing the logical values. Each row corresponds to a channel in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the Channels property. Each sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel.

Returns

IObservable<short[,]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<short[]>)

Writes an observable sequence of signed 16-bit samples to one or more DAQmx digital output lines.

public IObservable<short[]> Process(IObservable<short[]> source)

Parameters

source IObservable<short[]>

A sequence of 16-bit signed integer arrays representing the state of digital output lines in a local virtual port channel.

Returns

IObservable<short[]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<int[,]>)

Writes logical values to one or more DAQmx digital output lines from an observable sequence of signed 32-bit multi-channel sample buffers.

public IObservable<int[,]> Process(IObservable<int[,]> source)

Parameters

source IObservable<int[,]>

A sequence of multi-dimensional int arrays storing the logical values. Each row corresponds to a channel in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the Channels property. Each sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel.

Returns

IObservable<int[,]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<int[]>)

Writes an observable sequence of signed 32-bit samples to one or more DAQmx digital output lines.

public IObservable<int[]> Process(IObservable<int[]> source)

Parameters

source IObservable<int[]>

A sequence of 32-bit signed integer arrays representing the state of digital output lines in a local virtual port channel.

Returns

IObservable<int[]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<ushort[,]>)

Writes logical values to one or more DAQmx digital output lines from an observable sequence of unsigned 16-bit multi-channel sample buffers.

public IObservable<ushort[,]> Process(IObservable<ushort[,]> source)

Parameters

source IObservable<ushort[,]>

A sequence of multi-dimensional ushort arrays storing the logical values. Each row corresponds to a channel in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the Channels property. Each sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel.

Returns

IObservable<ushort[,]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<ushort[]>)

Writes an observable sequence of unsigned 16-bit samples to one or more DAQmx digital output lines.

public IObservable<ushort[]> Process(IObservable<ushort[]> source)

Parameters

source IObservable<ushort[]>

A sequence of 16-bit unsigned integer arrays representing the state of digital output lines in a local virtual port channel.

Returns

IObservable<ushort[]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<uint[,]>)

Writes logical values to one or more DAQmx digital output lines from an observable sequence of unsigned 32-bit multi-channel sample buffers.

public IObservable<uint[,]> Process(IObservable<uint[,]> source)

Parameters

source IObservable<uint[,]>

A sequence of multi-dimensional uint arrays storing the logical values. Each row corresponds to a channel in the signal generation task, and each column to a sample from each of the channels. The order of the channels follows the order in which you specify the channels in the Channels property. Each sample can represent either a single line or a bitmask representing the state of all digital lines in a single port, depending on the configuration of the virtual channel.

Returns

IObservable<uint[,]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.

Process(IObservable<uint[]>)

Writes an observable sequence of unsigned 32-bit samples to one or more DAQmx digital output lines.

public IObservable<uint[]> Process(IObservable<uint[]> source)

Parameters

source IObservable<uint[]>

A sequence of 32-bit unsigned integer arrays representing the state of digital output lines in a local virtual port channel.

Returns

IObservable<uint[]>

An observable sequence that is identical to the source sequence but where there is an additional side effect of writing logical values to one or more DAQmx digital output lines.