Skip to main content

lab-nidaq-mcp

NI-DAQmx instrument backend for lab-executor-mcp. Version 0.1 supports software-timed, single-point analog input, digital input, analog output, and digital output on the agreed USB-6009 and USB-6210 devices. Waveforms, streaming, triggers, counters, and timers are out of scope.

Resources are device-level and case-sensitive: DAQ::Dev1 and DAQ::Dev2. Commands select a channel:

READ AI ai0
READ DI port0/line0
INFO model
WRITE AO ao0 2.5
WRITE DO port1/line0 1
SAFE

Safety model

Outputs are disabled unless explicitly declared in configuration. Every declared output requires an explicit safe_value; the software never assumes zero is safe. A configured interlock is read immediately before every ordinary output write, and a mismatch or read failure refuses the write. Safe-value writes from SAFE and close() deliberately bypass the interlock and attempt every declared output. Analog output values are checked against both the declared range and the model capability before a DAQmx task is created. Writes are never automatically retried.

Mandatory installation requirement (D9)

The USB-6009 and USB-6210 cannot be assigned a programmable power-up output state. Software therefore cannot guarantee an output level after a host crash, USB disconnection, or loss of host control. The installer is responsible for wiring the external circuit so that a high-impedance output line is the safe state. This is an installation requirement, not a guarantee made by this backend. support_level remains experimental until output operation and this wiring requirement are verified on the installed hardware.

Configuration

devices:
  Dev2:
    model: "USB-6009"
    interlock: none
    analog_inputs:
      ai0: {range: [-10, 10]}
    analog_outputs:
      ao0:
        range: [0, 5]
        safe_value: 0.0
    digital_outputs:
      port1/line0:
        safe_value: 0

model and interlock are mandatory. The declared model selects physical capabilities and must match the DAQmx product_type read on first hardware access. Use the explicit interlock string none, or configure {line: "port0/line7", require: 1}. An interlock line cannot also be declared as an output.

lab-nidaq --config nidaq.yaml --dry-run
lab-nidaq --config nidaq.yaml

The entry point is lab_executor.backends: nidaq, with routing prefix DAQ::.

Measured hardware limits

The capability table's maximum sample rate is the device's specified figure. It is not a guarantee that a given host can sustain it, and this backend does not pretend otherwise: a rate the hardware cannot keep up with surfaces as a transport error carrying DAQmx's own diagnosis, rather than silently returning short or duplicated data.

Measured on this hardware on 2026-07-20:

  • USB-6210 at 250 kS/s — 10,000 samples acquired without error.
  • USB-6009 at its specified 48 kS/s maximum — DAQmx reports Onboard device memory overflow (-200361). The device has little onboard memory and transfers over interrupts, so the specified maximum is not reachable for buffered reads on this host. 10 kS/s was reliable.

An unconnected differential input rails rather than reading zero. A USB-6210 input with nothing attached returned a constant 10.974836 V across all 10,000 samples, while a USB-6009 single-ended input on the same code path returned genuine ADC noise (9 distinct values, σ≈2.2 mV). Constant data from an acquisition usually means the terminal is floating, not that acquisition failed; bias unused differential inputs to AI GND if you need a meaningful reading.

Development

Tests use only MockNiDaqBackend; they never construct a DAQmx task. Run:

python -m pytest -q
python -m ruff check src tests
python -m ruff format --check src tests
python -m build

License

MIT

Metadata

Release files for lab-nidaq-mcp 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lab-nidaq-mcp 0.1.2
File Size Uploaded Provenance Actions
lab_nidaq_mcp-0.1.2.tar.gz 28.1 kB With provenance Details for lab_nidaq_mcp-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lab-nidaq-mcp 0.1.2
File Interpreter ABI Platform Actions
lab_nidaq_mcp-0.1.2-py3-none-any.whl Python 3 none any Details for lab_nidaq_mcp-0.1.2-py3-none-any.whl

Total release size: 47.7 kB

Release files / lab_nidaq_mcp-0.1.2.tar.gz

Download URL lab_nidaq_mcp-0.1.2.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bf6d62f4ddc45ef801c393742056489002c23e2304a257bcf07d948a81c0f6ef
BLAKE2b-256 checksum
How to use checksums
bedcd79536da2f5a27bf2d7e3000671aa87a349b913af4dc9e8596df7cd1a560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Release files / lab_nidaq_mcp-0.1.2-py3-none-any.whl

Download URL lab_nidaq_mcp-0.1.2-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1081f087feba33f374c26b00243c0b957ef643236c0f1a8c54ebae98795ac51a
BLAKE2b-256 checksum
How to use checksums
9f9b0a33b2b010db95552c2fe112e247874a5651f4ed23a58365a39acd28ba68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

Security for lab-nidaq-mcp 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lab_nidaq_mcp-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page