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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lab_nidaq_mcp-0.1.2.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lab_nidaq_mcp-0.1.2-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file lab_nidaq_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: lab_nidaq_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for lab_nidaq_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bf6d62f4ddc45ef801c393742056489002c23e2304a257bcf07d948a81c0f6ef
MD5 39fe872a0c8f11bb6440b5c81592fb9e
BLAKE2b-256 bedcd79536da2f5a27bf2d7e3000671aa87a349b913af4dc9e8596df7cd1a560

See more details on using hashes here.

Provenance

The following attestation bundles were made for lab_nidaq_mcp-0.1.2.tar.gz:

Publisher: publish.yml on TECTOS-JP/lab-nidaq-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lab_nidaq_mcp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: lab_nidaq_mcp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for lab_nidaq_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1081f087feba33f374c26b00243c0b957ef643236c0f1a8c54ebae98795ac51a
MD5 17f96ea93b93974d905588bcb8401bcc
BLAKE2b-256 9f9b0a33b2b010db95552c2fe112e247874a5651f4ed23a58365a39acd28ba68

See more details on using hashes here.

Provenance

The following attestation bundles were made for lab_nidaq_mcp-0.1.2-py3-none-any.whl:

Publisher: publish.yml on TECTOS-JP/lab-nidaq-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

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