LabJackTSeriesDriver#
- class LabJackTSeriesDriver(device_id: str, stream_buffer_bytes: int = 0)[source]#
Bases:
DAQDriverBaseLabJack T-series DAQ driver (T4/T7/T8 via the LJM library).
Construct the driver.
- Parameters:
device_id
Device serial number, or “ANY” for the first device found.
stream_buffer_bytes
Device-side stream buffer size, always written when AI hardware timing is configured so no value carries over from an earlier session. 0 selects the device’s own default. Must be a power of 2 and the max is 262144. Setting this prevents the device from dropping scans at high sample rates, which LJM reports as -9999 sample values.
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 LabJack device.
Close the relay (connect the circuit).
Deprecated: use
configure_ai_voltage_channel.Register an AI current channel.
Configure hardware timing for the specified channels.
Configure a thermocouple ai channel; volts convert to temperature in the channel's unit on read.
Configure a voltage ai channel on the LabJack device.
Deprecated: use
configure_ao_voltage_channel.Register an AO current channel.
Configure a voltage AO channel on the LabJack device.
Parse, program, and register a DI line channel.
Parse, program, and register a DI port channel.
Parse, program, and register a DO line channel.
Parse, program, and register a DO port channel.
Build a
RelayChannelforphysical_channel(e.g."3101"= slot 3 / channel 101).Block until
samples_per_channelnew AI samples are available, then return them.Actual hardware sample rate achieved after
start().Get the LabJack device info.
Connect to LabJack device.
Open the relay (disconnect the circuit).
Read from analog input channels.
Sample a single DI line.
Sample a multi-line DI port.
Start the DAQ device for hw timed data acquisition.
Stop the DAQ device.
Write
valueto AOchannel.Drive a single DO line.
Drive a multi-line DO port.
- configure_ai_channel(
- channel: AnalogChannel,
Deprecated: use
configure_ai_voltage_channel. Configures an ai channel on the LabJack device.
- configure_ao_channel(
- channel: AnalogChannel,
Deprecated: use
configure_ao_voltage_channel. Configures an AO channel on the LabJack device.
- configure_ai_voltage_channel(
- channel: AnalogVoltageChannel,
Configure a voltage ai channel on the LabJack device.
- configure_ao_voltage_channel(
- channel: AnalogVoltageChannel,
Configure a voltage AO channel on the LabJack device.
- configure_ai_current_channel(
- channel: AnalogCurrentChannel,
Register an AI current channel. Override if the driver supports analog current input.
- configure_ao_current_channel(
- channel: AnalogCurrentChannel,
Register an AO current channel. Override if the driver supports analog current output.
- configure_ai_thermocouple_channel(
- channel: AnalogThermocoupleChannel,
Configure a thermocouple ai channel; volts convert to temperature in the channel’s unit on read.
range_min/range_maxare ignored: the ADC range is fixed per model (T7 0.1 V, T8 0.075 V, T4 none).
- configure_ai_hw_timing(
- hw_timing_config: HWTimingConfig,
Configure hardware timing for the specified channels.
- fetch_analog() LabJackData[source]#
Block until
samples_per_channelnew AI samples are available, then return them.Drivers should set
self.points_in_bufferfor buffer-depth telemetry and returndt(ns per sample) so the wrapper can build contiguous timestamps viaHWTimestamper.
- 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,
Write
valueto AOchannel. Override if the driver supports analog output.
- write_digital_line(
- channel: DigitalChannel,
- data: int,
Drive a single DO line.
datais 0 or 1 (active-lowchannel.logicis handled in the driver).
- read_digital_line(
- channel: DigitalChannel,
Sample a single DI line. Returns 0 or 1 after applying
channel.logic.
- write_digital_port(
- channel: DigitalChannel,
- data: int,
Drive a multi-line DO port.
datais an N-bit integer; biticontrols linei.
- read_digital_port(
- channel: DigitalChannel,
Sample a multi-line DI port. Returns an N-bit integer; bit
ireflects linei.
- 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_di_port_channel(
- physical_channel: str,
- logic: Logic,
- port_width: DigitalPortWidth,
- logic_level: float | None = None,
- alias: str | None = None,
Parse, program, and register a DI port channel. Override if the driver supports port-mode digital input.
- configure_do_port_channel(
- physical_channel: str,
- logic: Logic,
- port_width: DigitalPortWidth,
- logic_level: float | None = None,
- alias: str | None = None,
Parse, program, and register a DO port channel. Override if the driver supports port-mode digital 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.
- property relay_channels: Mapping[str, RelayChannel]#
Frozen snapshot of configured relay channels, keyed by alias.