stoner_measurement.plugins.trace.daqmx.DaqmxTracePlugin

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

Bases: TracePlugin

Acquire a hardware-timed DAQmx trace with optional synchronised output.

Use this plugin when a complete input trace should be acquired as one finite NI-DAQmx operation. The scan generator supplies the x values. If output generation is enabled, those values are also written to the selected output task while the acquisition runs. This is the most efficient DAQmx workflow when no other sequence steps need to execute between points. Use DaqmxPointScanPlugin when nested sequence steps must run at every value, or DaqmxSetCommand for one set-and-acquire operation.

The Scan tab defines the finite sequence of values. On the Settings tab, the nested General page sets the scan-point rate, input oversampling, acquisition task, and optional output task. Acquisition channels may be selected directly from a device, from NI MAX global channels, or by loading a saved task. Acquisition channels are restricted to analogue inputs. The optional output task is similarly restricted to analogue outputs. Custom NI scales may be selected for analogue physical channels. Each physical input has its own symmetric range, defaulting to +/-10 V, so NI-DAQmx can select an appropriate hardware gain. Available device ranges are discovered when possible. A common RSE, NRSE, or differential terminal mode can be applied to every selected physical acquisition channel. Counter input and output channels are not supported.

The configured scan-point rate is multiplied by Input oversampling to obtain the hardware sample rate. Every scan value occupies that many consecutive hardware samples. The output buffer repeats the value across the same window, and the acquisition samples in the window are averaged to produce one result. The returned DAQmx Trace contains Scan value as its x column and one floating-point data column for every discovered input channel. The first input is assigned the y role and subsequent inputs the z role, so the trace can be consumed directly by plot, save, fit, and transform plugins.

The Advanced page configures input and output triggering. The input task may start immediately or from a rising or falling digital or analogue edge. An analogue edge also has a trigger-level setting. Input triggering is applied to the acquisition task, which remains the timing master.

Generate an output trigger pulse creates a separate one-line, hardware-timed digital-output task. It shares the acquisition sample clock and is armed from the acquisition task’s internal start event. Phase is a normalised position through the generated scan: 0 degrees is the start and 360 degrees is the end. Delay, high time, low time, and idle polarity define the pulse around that position. All pulse times are quantised to the hardware sample period and the complete pulse must fit inside the finite scan. Optional waveform and trigger-output tasks are armed before the acquisition task so that an external input trigger starts them together.

Direct physical channels, global channels, and saved tasks must resolve to compatible DAQmx task types. Automatic sample-clock and start-event routing is based on the acquisition device’s internal terminals. Some device combinations require explicit NI routing that this plugin cannot infer; cross-device synchronisation should therefore be verified on the intended hardware.

Variables:
  • scan_generator (BaseScanGenerator) – Generator defining the trace values and finite point count.

  • _sample_rate_hz (float) – Requested scan-point rate in hertz.

  • _oversampling (int) – Number of acquisition samples averaged for each scan value.

  • _output_enabled (bool) – Whether the scan values are generated by the output task.

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

  • _output_trigger (DaqmxOutputTrigger) – Optional synchronised digital pulse configuration.

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

  • data (dict[str, TraceData]) – Inherited latest trace tables, keyed by trace name; inspect each table through its df attribute.

  • status (TraceStatus) – Inherited acquisition status, including data availability and errors.

Keyword Parameters:

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

Examples

With an instance named daqmx_trace 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_trace._sample_rate_hz = 100.0
daqmx_trace._oversampling = 10
daqmx_trace.data
configure() → None[source]

Configure finite clocks, synchronization, buffers, and resource commits.

connect() → None[source]

Create and verify DAQmx tasks without starting acquisition or output.

disconnect() → None[source]

Disarm pending operations and clear every owned DAQmx task.

property name: str

Plugin catalogue name.

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

Serialize task definitions, timing, and non-default advanced settings.

property x_label: str

Label for scan-generator values.

property y_label: str

Generic label for discovered acquisition channels.