InstroDAQ#

class InstroDAQ(
name: str,
driver: DAQDriverBase,
publishers: list[Publisher] | None = None,
**kwargs,
)[source]#

Bases: Instrument

Initialize an InstroDAQ.

Parameters:
  • name – Channel-name prefix for published data.

  • driver –

    Concrete DAQ driver; owns its own transport:

    daq = InstroDAQ(
        "myDAQ",
        driver=Keysight34980A("USB0::0x0957::0x0507::MY44001757::INSTR"),
    )
    

  • publishers – Publishers that receive emitted Measurement/Command data.

  • **kwargs – Default tags applied to every emitted Measurement/Command. Pass dataset_rid="<rid>" to auto-create a NominalCorePublisher (uses the on-disk ‘default’ Nominal credential).

Attributes

DEFAULT_SW_SAMPLE_RATE

ai_channels

Frozen snapshot of configured AI channels, keyed by alias.

ai_hw_timing_config

ao_channels

Frozen snapshot of configured AO channels, keyed by alias.

ao_hw_timing_config

background_interval

Daemon loop period (s); 0 unless configure_ai_sw_sample_rate() set a software-timed rate.

channel_names

Return an insertion-ordered snapshot of all published channel names.

channels

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

di_channels

Frozen snapshot of configured DI channels, keyed by alias.

di_hw_timing_config

do_channels

Frozen snapshot of configured DO channels, keyed by alias.

do_hw_timing_config

driver

The underlying vendor driver.

is_hw_timing_configured

True once configure_ai_hw_sample_rate() has programmed the AI sample clock.

is_sw_timing_configured

True once configure_ai_sw_sample_rate() has set a software-timed polling rate.

relay_channels

Frozen snapshot of configured relay channels, keyed by alias.

Methods

add_background_daemon_function

Append method to the daemon's call list.

add_publisher

Register a publisher to receive this instrument's Measurement/Command data.

close

Run full teardown unconditionally: daemon, then publishers, then the driver, which owns its idempotency.

close_relay

Close relay channel (alias) — connects the circuit.

configure_ai_hw_sample_rate

Configure the hardware sample clock for AI channels.

configure_ai_sample_rate

Deprecated: use configure_ai_hw_sample_rate() instead.

configure_ai_sw_sample_rate

Configure the software-timed polling rate for AI channels.

configure_analog_channel

Deprecated: use configure_voltage_input() or configure_voltage_output() instead.

configure_current_input

Configure an analog current input channel.

configure_current_output

Configure an analog current output channel.

configure_digital_input

Configure a digital input line channel.

configure_digital_line

Deprecated: use configure_digital_input() or configure_digital_output() instead.

configure_digital_output

Configure a digital output line channel.

configure_digital_port

Configure a digital port channel.

configure_relay_channel

Configure a relay channel (physical_channel e.g. "3101" = slot 3 / channel 101).

configure_thermocouple_input

Configure a thermocouple input channel.

configure_voltage_input

Configure an analog voltage input channel.

configure_voltage_output

Configure an analog voltage output channel.

define_background_daemon

Replace all daemon functions with a single method (called with the given args).

get_actual_sample_rate

Hardware's actual sample rate after start(); None if unsupported or not started.

get_channel

Return the most recent length samples for channel_name from the in-memory buffer.

get_points_in_buffer

Publish the current DAQ buffer depth on channel {name}.buffer.

get_single_channel_value

Return the most recent sample for channel_name from the in-memory buffer.

open

Open the underlying driver.

open_relay

Open relay channel (alias) — disconnects the circuit.

publish

Fan data out to every configured publisher; kwargs pass through.

read

Read one AI/DI channel by alias; returns its Measurement.

read_analog

Dispatch a hardware-timed buffer fetch or a software-timed conversion based on configuration.

read_batch

Read AI/DI channels by alias (None = all inputs); returns {alias: Measurement}, analog via read_analog (or the daemon buffer while it runs), digital per line/port.

read_digital_line

Read DI line channel (alias).

read_digital_port

Read DI port channel (alias).

start

Start acquisition: hardware-timed, or the software-timed daemon when SW timing is configured.

stop

Stop hardware acquisition and the background daemon; tolerant teardown when not open.

write

Write value to one AO/DO channel by alias; returns its Command.

write_analog_value

Write value (volts) to AO channel (alias).

write_batch

Write values[i] to output channels[i] (alias); continue_on_failed_write logs and skips failed writes instead of raising.

write_digital_line

Write 0/1 to DO line channel (alias).

write_digital_port

Write data to DO port channel (alias).