stoner_measurement.plugins.command.daqmx_set.DaqmxSetCommand

class stoner_measurement.plugins.command.daqmx_set.DaqmxSetCommand(parent=None, *, runtime_factory: Callable[[], ~typing.Any]=<class 'stoner_measurement.plugins.trace.daqmx_runtime.NidaqmxRuntime'>)[source]

Bases: CommandPlugin

Set one DAQmx value and perform one synchronised point acquisition.

Use this leaf command when a sequence needs one DAQmx set-and-acquire operation rather than a DAQmx-controlled scan. The output value may be a number or an expression evaluated in the live sequence namespace whenever the command runs. This makes the command suitable inside an outer temperature, field, motor, or other state scan. Use DaqmxPointScanPlugin when DAQmx itself should define the repeated scan axis, or DaqmxTracePlugin for one buffered multi-point trace.

Set DAQmx has one command configuration page and no scan-generator or data collection page. The nested General page starts with the expression-capable Output value, followed by acquisition timing and task selection. Generate an output value enables the DAQmx output-task selector and is checked by default. Uncheck it to use the command as a one-shot acquisition only. The page also displays the resulting point-acquisition time.

Acquisition and output tasks may be selected from direct physical channels, NI MAX global channels, or saved tasks. Acquisition and value-output tasks are restricted to analogue channels, and custom NI scales may be used with physical channels. Each physical input has its own symmetric range, defaulting to +/-10 V and populated from the device where possible. A common RSE, NRSE, or differential mode applies to all selected physical inputs. Counter channels are not supported.

Each execution creates and verifies the selected tasks, writes the output value as a constant buffer for the configured number of samples, and acquires the matching input window. It publishes Output value plus a population mean and population standard deviation for every discovered input channel. The channel results appear as <channel> Mean and <channel> Standard Deviation in the sequence value catalogue. All DAQmx tasks are stopped and released before the command returns, including when execution fails.

The Advanced page configures an immediate, digital-edge, or analogue-edge input trigger and an optional synchronised digital output pulse. Input triggering is applied to the acquisition task. The pulse is a separate one-line hardware-timed output task that shares the acquisition clock and internal start event, and it is generated once per command execution. Phase is the normalised position within this single point’s acquisition window. Pulse delay and high/low times must be representable at the configured acquisition rate and fit inside the window.

Because this is a command plugin, it connects, configures, measures, and disconnects on every execution. That lifecycle is convenient for isolated operations but has more overhead than DAQmx Point Scan, which retains its tasks across all points. Automatic synchronisation routing also assumes compatible NI hardware and should be verified for cross-device tasks.

Variables:
  • _value (float | str) – Literal output value or sequence expression evaluated at runtime.

  • _last_value (float | None) – Evaluated value used by the most recent successful execution.

  • _point_plugin (DaqmxPointScanPlugin) – Shared implementation of task configuration, triggering, acquisition, reduction, and cleanup.

  • _channel_names (tuple[str, ...]) – Input channel names discovered during the most recent execution.

  • instance_name (str) – Inherited Python identifier for this instance in the Script tab and QtConsole.

  • comment (str) – Inherited optional note displayed beside this step.

  • sequence_engine (SequenceEngine | None) – Inherited owning engine and its live namespace; None while detached.

Keyword Parameters:

parent (QObject | None) – Optional Qt parent object.

Examples

With an instance named daqmx_set in the sequence, use the QtConsole to inspect or edit it before running. Substitute your instance name if different; result data reflects completed steps:

daqmx_set._value = "bias_voltage"
daqmx_set._point_plugin._oversampling = 10
config_tabs(parent: QWidget | None = None) → list[tuple[str, QWidget]][source]

Allow the shared DAQmx settings box to fill the command tab.

config_widget(parent: QWidget | None = None) → QWidget[source]

Return the single-value and shared DAQmx settings widget.

declared_outputs() → PluginOutputs[source]

Declare configured outputs and their physical units together.

execute() → None[source]

Evaluate and perform one complete DAQmx point acquisition.

get_mean(channel: str) → float | None[source]

Return the most recent mean for channel.

get_standard_deviation(channel: str) → float | None[source]

Return the most recent population standard deviation for channel.

property name: str

Plugin catalogue name.

to_json() → dict[str, Any][source]

Serialize the value and shared DAQmx configuration.