stoner_measurement.plugins.state_scan.daqmx.DaqmxPointScanPlugin

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

Bases: StateScanPlugin

Step through DAQmx output values and acquire statistics at every point.

Use this state-scan plugin when DAQmx should provide a discrete sequence axis and other sequence steps may run between its points. The normal state scan generator defines the output values. At each point the plugin performs one finite, hardware-timed acquisition before nested steps run, making the latest input means and standard deviations available to those steps and to the state scan’s data collector. Use DaqmxTracePlugin when the whole trace can run as one faster buffered operation, or DaqmxSetCommand when only one value is required.

The Scan tab selects the scan generator and its values. The Data tab controls which published values are collected at measurement points. On the Settings tab, the nested General page sets the acquisition sample rate, number of samples per point, acquisition task, and optional output task. It also displays the resulting point-acquisition time. Tasks may use direct physical channels, NI MAX global channels, or saved tasks. Acquisition and value-output tasks are restricted to analogue channels, with custom NI scales available for 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.

For every scan value, an enabled output task writes a constant buffer of Samples per point values. The input task acquires the same number of samples at the configured acquisition rate. The plugin then publishes the population mean and population standard deviation for each discovered input channel. These scalar values appear as <channel> Mean and <channel> Standard Deviation and can be selected on the Data tab or read by nested sequence commands. A directly selected physical analogue output gives the scan axis units of volts; other task definitions remain unitless because their engineering units cannot be inferred reliably.

The Advanced page provides the same trigger controls as DAQmx Trace. Immediate, digital-edge, and analogue-edge input triggers are applied to the acquisition task. An optional one-line digital-output task generates one pulse per scan point. The pulse shares the acquisition sample clock and internal start event. Its phase is the normalised position through the current point’s acquisition window, while delay, high time, low time, and idle polarity define its local shape. The pulse durations must be representable at the acquisition rate and must fit within the samples for one point.

The acquisition task is always the timing master. Any value-output and trigger-output tasks are armed first, followed by the acquisition task, so an external input trigger starts all dependent work together. Tasks are configured once at the start of the state scan and restarted for each point. Automatic clock and start routing assumes compatible NI hardware; cross-device routes may require additional configuration outside the plugin.

Variables:
  • scan_generator (BaseScanGenerator) – Generator supplying the successive output values.

  • _sample_rate_hz (float) – Hardware acquisition rate in samples per second.

  • _oversampling (int) – Number of samples acquired and reduced at each point.

  • _output_enabled (bool) – Whether the current scan value is generated on an output task.

  • _target_value (float) – Most recently completed scan value.

  • _means (dict[str, float]) – Latest per-channel population means.

  • _standard_deviations (dict[str, float]) – Latest per-channel population standard deviations.

  • _input_trigger (DaqmxInputTrigger) – Start trigger applied to the acquisition task.

  • _output_trigger (DaqmxOutputTrigger) – Optional per-point synchronised digital pulse.

  • 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.

  • value (float) – Inherited current sequence control value.

  • ix (int) – Inherited zero-based iteration index.

  • meas_flag (bool) – Inherited flag indicating a measurement point.

  • collect_data (bool) – Inherited switch enabling collection of selected sequence outputs.

  • data (TraceData) – Inherited accumulated table; inspect data.df after collection.

Keyword Parameters:

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

Examples

With an instance named daqmx_point_scan 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_point_scan._oversampling = 10
daqmx_point_scan.collect_data = True
daqmx_point_scan.data.df.head()
configure() → None[source]

Configure one reusable finite acquisition window and its dependants.

connect() → None[source]

Create and verify all selected DAQmx tasks.

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

Return the reusable DAQmx configuration without plugin metadata.

declared_outputs() → PluginOutputs[source]

Declare configured outputs and their physical units together.

disconnect() → None[source]

Stop and close every task owned by this plugin.

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.

get_state() → float[source]

Return the most recently completed output point.

is_at_target() → bool[source]

Return true because acquisition completes synchronously in set_state.

property name: str

Plugin catalogue name.

restore_daqmx_configuration(data: dict[str, Any]) → None[source]

Restore task, timing, and trigger settings from data.

set_state(value: float) → None[source]

Generate one output point, acquire samples, and calculate statistics.

property state_name: str

Name of the optional generated output value.

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

Serialize task, timing, scan, and changed advanced settings.

property units: str

Return volts for a selected physical analogue output, otherwise unitless.