MCCDriver#
- class MCCDriver(device_id: str, buffer_multiplier: int = 2)[source]#
Bases:
DAQDriverBaseMCC (Universal Library / mcculw) DAQ driver.
Initialize the MCC DAQ driver.
- Parameters:
device_id
Device unique ID, optionally with a board number as
"<serial>:<board_number>"(e.g."344371:0"). Defaults to board 0.buffer_multiplier
Circular-buffer size relative to per-fetch size. Higher values tolerate more jitter at the cost of memory.
Attributes
Frozen snapshot of configured AI channels, keyed by alias.
Frozen snapshot of configured AO channels, keyed by alias.
Frozen snapshot of all configured AI/AO/DI/DO channels (excludes relays).
Frozen snapshot of configured DI channels, keyed by alias.
Frozen snapshot of configured DO channels, keyed by alias.
Frozen snapshot of configured relay channels, keyed by alias.
Methods
Disconnect from MCC device.
Close the relay (connect the circuit).
Deprecated: use
configure_ai_voltage_channel.Configure a current input channel on the MCC DAQ device.
Configure hardware timing for the specified channels.
Configure a thermocouple input channel on the MCC DAQ device.
Configure a voltage analog input channel on the MCC DAQ device.
Deprecated: use
configure_ao_voltage_channel.Register an AO current channel.
Configure a voltage analog output channel on the MCC DAQ device.
Parse
DigitalPortType/#, configure the bit for DI, and register the line.Parse
DigitalPortType, configure the port for DI, and register the port.Parse
DigitalPortType/#, configure the bit for DO, and register the line.Parse
DigitalPortType, configure the port for DO, and register the port.Build a
RelayChannelforphysical_channel(e.g."3101"= slot 3 / channel 101).Block until
samples_per_channelnew samples are available, then drain the circular buffer.Actual hardware sample rate achieved after
start().Device capabilities snapshot captured at
open().Connect to MCC device.
Open the relay (disconnect the circuit).
Read from analog input channels; thermocouple channels return temperature in their configured unit.
Read 0/1 from a single DI line (
DigitalLineChannel).Read an N-bit value from a DI port (bit i reflects line i).
Start the MCC DAQ device for hw timed data acquisition.
Stop the MCC DAQ device.
Write an analog value to an analog output channel.
Write 0/1 to a single DO line (
DigitalLineChannel).Write an N-bit value to a DO port (bit i drives line i).
- configure_ai_channel(channel: AnalogChannel)[source]#
Deprecated: use
configure_ai_voltage_channel. Configure an analog input channel on the MCC DAQ device.
- configure_ai_voltage_channel(
- channel: AnalogChannel | AnalogVoltageChannel,
Configure a voltage analog input channel on the MCC DAQ device.
- configure_ai_thermocouple_channel(
- channel: AnalogThermocoupleChannel,
Configure a thermocouple input channel on the MCC DAQ device.
- configure_ai_current_channel(
- channel: AnalogCurrentChannel,
Configure a current input channel on the MCC DAQ device.
- configure_ao_channel(channel: AnalogChannel)[source]#
Deprecated: use
configure_ao_voltage_channel. Configure an analog output channel on the MCC DAQ device.
- configure_ao_voltage_channel(
- channel: AnalogChannel | AnalogVoltageChannel,
Configure a voltage analog output channel on the MCC DAQ device.
- configure_ai_hw_timing(
- hw_timing_config: HWTimingConfig,
Configure hardware timing for the specified channels.
- 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).
- read_analog() MCCDAQData[source]#
Read from analog input channels; thermocouple channels return temperature in their configured unit.
- fetch_analog() MCCDAQData[source]#
Block until
samples_per_channelnew samples are available, then drain the circular buffer.
- write_analog_value(
- channel: AnalogChannel,
- value: float,
Write an analog value to an analog output channel.
- configure_di_line_channel( )[source]#
Parse
DigitalPortType/#, configure the bit for DI, and register the line.
- configure_do_line_channel( )[source]#
Parse
DigitalPortType/#, configure the bit for DO, 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,
Parse
DigitalPortType, configure the port for DI, 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,
Parse
DigitalPortType, configure the port for DO, and register the port.
- write_digital_line(
- channel: DigitalChannel,
- data: int,
Write 0/1 to a single DO line (
DigitalLineChannel).
- read_digital_line(
- channel: DigitalChannel,
Read 0/1 from a single DI line (
DigitalLineChannel).
- write_digital_port(
- channel: DigitalChannel,
- data: int,
Write an N-bit value to a DO port (bit i drives 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.
- configure_ao_current_channel(
- channel: AnalogCurrentChannel,
Register an AO current channel. Override if the driver supports analog current output.
- define_relay_channel( ) RelayChannel#
Build a
RelayChannelforphysical_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.
- read_digital_port(
- channel: DigitalChannel,
Read an N-bit value from a DI port (bit i reflects line i).
- property relay_channels: Mapping[str, RelayChannel]#
Frozen snapshot of configured relay channels, keyed by alias.