Skip to content

Add the NIDAQmx_Waveform actuator (waveforms on several analog outputs) - #60

Merged
seb5g merged 3 commits into
5.3.xfrom
feat/waveform-output-actuator
Nov 23, 2026
Merged

seb5g merged 3 commits into
5.3.xfrom
feat/waveform-output-actuator

Conversation

@seb5g

@seb5g seb5g commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Actuator NIDAQmx_Waveform that plays waveforms (arrays of samples) on several analog outputs of one device with a single task: one clock, one start. First plugin built on the waveform output contract (pymodaq_plugins_utils.hardware.waveform_output, merged in utils #20), so the Dashboard extension of pymodaq_plugins_waveform can read what the device can do, check what it sends, and send the samples as the position of the actuator.

Plugin

  • Position = DataActuator with one array (V) per chosen output. Outputs are picked in a list; outputs of several devices, or none, are refused.
  • Settings Waveform capabilities (read only: channels, ao_min_rate/ao_max_rate of the device, voltage range, modes, PFI terminals if the device accepts an AO start trigger, max samples, live_update False) and Waveform output (sample rate, mode, repetitions), plus external sample clock, start trigger (PFI + edge), max samples.
  • Modes: finite, repeat (the samples tiled), continuous (driver buffer = the signal, which it regenerates).
  • Before playing, the plugin runs WaveformOutput.check on the samples: wrong channel count, too many samples, rate, mode or voltage range give a clear ValueError, and nothing is played.
  • Move done once the generation has started; the end of a finite or repeated generation is announced with the status command generation_done (driver status). A new waveform replaces the running one with a break; outputs are at 0 V at start, after stop and at close.

API additions (backward compatible): ClockSettings(buffer=n) for the buffer of a continuous output, NIDAQSystem.ao_min_rate, and supports_start_trigger accepts ChannelKind.AO.

Tests: 14 new tests with the driver double (tasks, timing, trigger, write shape, limits, end of generation, stop/close, refusals) and 3 for the API additions. Whole suite: 254 passed; 2 tests of test_generic_ai_configuration.py fail on the base branch too in my environment (GUI replay, unrelated).

Not verified on hardware: nothing here ran on a real or NI MAX simulated device (simulated devices ignore triggers anyway). To check on a device: the continuous regeneration with buffer=n, the rate limit with several outputs, the AO start trigger and the minimum rate.

Dependency: pymodaq_plugins_utils is added to the dependencies without a minimum version, because waveform_output is not released yet. A release of utils that contains it is needed before this one is released.

Docs: user guide page waveform_output_use, README line.

https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL


Generated by Claude Code

…s with one task

The position is one array of samples per output. The plugin follows the waveform
output contract of pymodaq_plugins_utils (capabilities and user choices as settings
groups, check of what is sent): finite, repeated and continuous generation, external
clock, start trigger. ClockSettings gets an optional buffer size for the regeneration
of a continuous output, NIDAQSystem the minimum rate and the start trigger of the
analog outputs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RKuN81tBxMB6iaf8J6KLJL

seb5g commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

The tests check fails at collection with ModuleNotFoundError: No module named pymodaq_plugins_utils.hardware.waveform_output: CI installs the released pymodaq_plugins_utils, which does not contain the waveform output contract yet (merged on its 5.3.x branch in utils #20, not released). It is not a defect of this diff, and the test is not skipped on purpose. It will pass once a pymodaq_plugins_utils release that contains waveform_output exists, and the dependency in pyproject.toml should then get that version as its minimum. Waiting for that release, which is the maintainer's decision.


Generated by Claude Code

@seb5g
seb5g merged commit 8c66638 into 5.3.x Nov 23, 2026
9 of 10 checks passed
@seb5g
seb5g deleted the feat/waveform-output-actuator branch November 23, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants