# NIDAQDriver

## class NIDAQDriver(device_id: str)[source]

Bases: [`DAQDriverBase`](https://dev.nominal.io/instro/ref/instruments/instro.daq.DAQDriverBase.md#instro.daq.DAQDriverBase "instro.daq.daq.DAQDriverBase")

NI-DAQmx DAQ driver.

Attributes

| [`ai_channels`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.ai_channels "instro.daq.drivers.ni.nidaq.NIDAQDriver.ai_channels") | Frozen snapshot of configured AI channels, keyed by alias. |
| --- | --- |
| [`ai_hw_timing_config`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.ai_hw_timing_config "instro.daq.drivers.ni.nidaq.NIDAQDriver.ai_hw_timing_config") |  |
| [`ao_channels`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.ao_channels "instro.daq.drivers.ni.nidaq.NIDAQDriver.ao_channels") | Frozen snapshot of configured AO channels, keyed by alias. |
| [`ao_hw_timing_config`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.ao_hw_timing_config "instro.daq.drivers.ni.nidaq.NIDAQDriver.ao_hw_timing_config") |  |
| [`channels`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.channels "instro.daq.drivers.ni.nidaq.NIDAQDriver.channels") | Frozen snapshot of all configured AI/AO/DI/DO channels (excludes relays). |
| [`di_channels`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.di_channels "instro.daq.drivers.ni.nidaq.NIDAQDriver.di_channels") | Frozen snapshot of configured DI channels, keyed by alias. |
| [`di_hw_timing_config`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.di_hw_timing_config "instro.daq.drivers.ni.nidaq.NIDAQDriver.di_hw_timing_config") |  |
| [`do_channels`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.do_channels "instro.daq.drivers.ni.nidaq.NIDAQDriver.do_channels") | Frozen snapshot of configured DO channels, keyed by alias. |
| [`do_hw_timing_config`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.do_hw_timing_config "instro.daq.drivers.ni.nidaq.NIDAQDriver.do_hw_timing_config") |  |
| [`relay_channels`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.relay_channels "instro.daq.drivers.ni.nidaq.NIDAQDriver.relay_channels") | Frozen snapshot of configured relay channels, keyed by alias. |
| [`points_in_buffer`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.points_in_buffer "instro.daq.drivers.ni.nidaq.NIDAQDriver.points_in_buffer") |  |

Methods

| [`close`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.close "instro.daq.drivers.ni.nidaq.NIDAQDriver.close") | Close every DAQmx task this driver owns. |
| --- | --- |
| [`close_relay`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.close_relay "instro.daq.drivers.ni.nidaq.NIDAQDriver.close_relay") | Close the relay (connect the circuit). |
| [`configure_ai_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_channel") | Deprecated: use `configure_ai_voltage_channel`. |
| [`configure_ai_current_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_current_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_current_channel") | Configure an analog current input channel on the NI device. |
| [`configure_ai_hw_timing`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_hw_timing "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_hw_timing") | Configure hardware timing for the specified channels. |
| [`configure_ai_thermocouple_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_thermocouple_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_thermocouple_channel") | Configure a thermocouple input channel on the NI device; DAQmx reads `cjc_temp` in `unit`. |
| [`configure_ai_voltage_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_voltage_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ai_voltage_channel") | Configure an analog voltage input channel on the NI device. |
| [`configure_ao_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ao_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ao_channel") | Deprecated: use `configure_ao_voltage_channel`. |
| [`configure_ao_current_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ao_current_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ao_current_channel") | Configure an analog current output channel on the NI device. |
| [`configure_ao_voltage_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ao_voltage_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_ao_voltage_channel") | Configure an analog voltage output channel on the NI device. |
| [`configure_di_line_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_di_line_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_di_line_channel") | Parse `DevN/portM/lineP`, add as CHAN_PER_LINE to the shared DI line task, and register the line. |
| [`configure_di_port_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_di_port_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_di_port_channel") | Parse `DevN/portM`, add as CHAN_FOR_ALL_LINES to a dedicated DI task, and register the port. |
| [`configure_do_line_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_do_line_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_do_line_channel") | Parse `DevN/portM/lineP`, add as CHAN_PER_LINE to the shared DO line task, and register the line. |
| [`configure_do_port_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_do_port_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.configure_do_port_channel") | Parse `DevN/portM`, add as CHAN_FOR_ALL_LINES to a dedicated DO task, and register the port. |
| [`define_relay_channel`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.define_relay_channel "instro.daq.drivers.ni.nidaq.NIDAQDriver.define_relay_channel") | Build a `RelayChannel` for `physical_channel` (e.g. `"3101"` = slot 3 / channel 101). |
| [`fetch_analog`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.fetch_analog "instro.daq.drivers.ni.nidaq.NIDAQDriver.fetch_analog") | Block until `samples_per_channel` new AI samples are available, then return them. |
| [`get_actual_sample_rate`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.get_actual_sample_rate "instro.daq.drivers.ni.nidaq.NIDAQDriver.get_actual_sample_rate") | Actual hardware sample rate achieved after `start()`. |
| [`open`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.open "instro.daq.drivers.ni.nidaq.NIDAQDriver.open") | NI-DAQmx has no explicit connect — verifies the device is present in `niSystem.local()`. |
| [`open_relay`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.open_relay "instro.daq.drivers.ni.nidaq.NIDAQDriver.open_relay") | Open the relay (disconnect the circuit). |
| [`read_analog`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.read_analog "instro.daq.drivers.ni.nidaq.NIDAQDriver.read_analog") | Read from analog input channels. |
| [`read_digital_line`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.read_digital_line "instro.daq.drivers.ni.nidaq.NIDAQDriver.read_digital_line") | Sample a single DI line. |
| [`read_digital_port`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.read_digital_port "instro.daq.drivers.ni.nidaq.NIDAQDriver.read_digital_port") | Sample a DI port as one N-bit integer; bit `i` reflects line `i`. |
| [`start`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.start "instro.daq.drivers.ni.nidaq.NIDAQDriver.start") | Start the DAQ device for data acquisition. |
| [`stop`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.stop "instro.daq.drivers.ni.nidaq.NIDAQDriver.stop") | Stop the DAQ device. |
| [`write_analog_value`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.write_analog_value "instro.daq.drivers.ni.nidaq.NIDAQDriver.write_analog_value") | Write `value` to AO `channel`. |
| [`write_digital_line`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.write_digital_line "instro.daq.drivers.ni.nidaq.NIDAQDriver.write_digital_line") | Write to digital output channels. |
| [`write_digital_port`](https://dev.nominal.io/instro/ref/instruments/instro.daq.drivers.ni.nidaq.NIDAQDriver.md#instro.daq.drivers.ni.nidaq.NIDAQDriver.write_digital_port "instro.daq.drivers.ni.nidaq.NIDAQDriver.write_digital_port") | Drive a DO port as one N-bit integer; bit `i` controls line `i`. |

### open()[source]

NI-DAQmx has no explicit connect — verifies the device is present in `niSystem.local()`.

### close()[source]

Close every DAQmx task this driver owns.

### configure_ai_channel( channel: AnalogChannel, )[source]

Deprecated: use `configure_ai_voltage_channel`. Configures a channel on the NI device.

### configure_ao_channel( channel: AnalogChannel, )[source]

Deprecated: use `configure_ao_voltage_channel`. Configures an AO channel on the NI device.

### configure_ai_voltage_channel( channel: AnalogVoltageChannel, )[source]

Configure an analog voltage input channel on the NI device.

### configure_ai_current_channel( channel: AnalogCurrentChannel, )[source]

Configure an analog current input channel on the NI device.

### configure_ao_voltage_channel( channel: AnalogVoltageChannel, )[source]

Configure an analog voltage output channel on the NI device.

### configure_ao_current_channel( channel: AnalogCurrentChannel, )[source]

Configure an analog current output channel on the NI device.

### configure_ai_thermocouple_channel( channel: AnalogThermocoupleChannel, )[source]

Configure a thermocouple input channel on the NI device; DAQmx reads `cjc_temp` in `unit`.

### configure_ai_hw_timing( hw_timing_config: HWTimingConfig, )[source]

Configure hardware timing for the specified channels.

### configure_di_line_channel( physical_channel: str, logic: Logic, logic_level: float | None = None, alias: str | None = None, )[source]

Parse `DevN/portM/lineP`, add as CHAN_PER_LINE to the shared DI line task, and register the line.

### configure_do_line_channel( physical_channel: str, logic: Logic, logic_level: float | None = None, alias: str | None = None, )[source]

Parse `DevN/portM/lineP`, add as CHAN_PER_LINE to the shared DO line task, and register the line.

### configure_di_port_channel( physical_channel: str, logic: Logic, port_width: DigitalPortWidth, logic_level: float | None = None, alias: str | None = None, )[source]

Parse `DevN/portM`, add as CHAN_FOR_ALL_LINES to a dedicated DI task, and register the port.

### configure_do_port_channel( physical_channel: str, logic: Logic, port_width: DigitalPortWidth, logic_level: float | None = None, alias: str | None = None, )[source]

Parse `DevN/portM`, add as CHAN_FOR_ALL_LINES to a dedicated DO task, and register the port.

### start(**kwargs)[source]

Start the DAQ device for data acquisition.

### stop(**kwargs)[source]

Stop the DAQ device.

### read_analog() → DAQmxData[source]

Read from analog input channels.

### fetch_analog() → DAQmxData[source]

Block until `samples_per_channel` new AI samples are available, then return them.

Drivers should set `self.points_in_buffer` for buffer-depth
telemetry and return `dt` (ns per sample) so the wrapper can
build contiguous timestamps via `HWTimestamper`.

### get_actual_sample_rate() → float | None[source]

Actual hardware sample rate achieved after `start()`.

Default returns `None` (driver doesn’t know or hasn’t started).
Override on drivers whose SDK reports the effective rate (NI, MCC,
LabJack T-series all do).

### write_analog_value( channel: AnalogChannel | AnalogVoltageChannel | AnalogCurrentChannel | AnalogThermocoupleChannel, value: float, )[source]

Write `value` to AO `channel`. Override if the driver supports analog output.

### write_digital_line( channel: DigitalChannel, data: int, )[source]

Write to digital output channels.

### read_digital_line( channel: DigitalChannel, ) → int[source]

Sample a single DI line. Returns 0 or 1 after applying `channel.logic`.

### write_digital_port( channel: DigitalChannel, data: int, )[source]

Drive a DO port as one N-bit integer; bit `i` controls line `i`.

### read_digital_port( channel: DigitalChannel, ) → int[source]

Sample a DI port as one N-bit integer; bit `i` reflects line `i`.

### property ai_channels: Mapping[str, AnalogChannel | AnalogVoltageChannel | AnalogCurrentChannel | AnalogThermocoupleChannel]

Frozen snapshot of configured AI channels, keyed by alias.

### property ai_hw_timing_config: HWTimingConfig | None

### property ao_channels: Mapping[str, AnalogChannel | AnalogVoltageChannel | AnalogCurrentChannel | AnalogThermocoupleChannel]

Frozen snapshot of configured AO channels, keyed by alias.

### property ao_hw_timing_config: HWTimingConfig | None

### property channels: tuple[DAQChannel, ...]

Frozen snapshot of all configured AI/AO/DI/DO channels (excludes relays).

### close_relay(channel: RelayChannel)

Close the relay (connect the circuit). Override if the driver supports relays.

### define_relay_channel( physical_channel: str, alias: str | None = None, ) → RelayChannel

Build a `RelayChannel` for `physical_channel` (e.g. `"3101"` = slot 3 / channel 101).

Default implementation suits the Keysight 34980A’s slot/channel
addressing; override if the driver needs different parsing. Overrides
must also record the resulting channel on `self._relay_channels`.

### property di_channels: Mapping[str, DigitalChannel]

Frozen snapshot of configured DI channels, keyed by alias.

### property di_hw_timing_config: HWTimingConfig | None

### property do_channels: Mapping[str, DigitalChannel]

Frozen snapshot of configured DO channels, keyed by alias.

### property do_hw_timing_config: HWTimingConfig | None

### open_relay(channel: RelayChannel)

Open the relay (disconnect the circuit). Override if the driver supports relays.

### property relay_channels: Mapping[str, RelayChannel]

Frozen snapshot of configured relay channels, keyed by alias.

### points_in_buffer: int
