nibcq.ParallelDCIR

class nibcq.ParallelDCIR(leader: nibcq._device.Device, followers: collections.abc.Sequence[nibcq._device.Device], test_parameters: nibcq._dcir.DCIRTestParameters, multi_device_type: nibcq.enums.MultiDeviceMode = MultiDeviceMode.PARALLEL)

Bases: nibcq.measurement.ParallelMeasurement, nibcq._dcir.DCIR

Defines a DCIR measurement with multiple ELoads working in parallel.

This class enables DC internal resistance measurements using multiple Electronic Load devices connected in parallel to achieve higher current draw than a single ELoad can provide.

DCIR measurements in general does NOT have switching support, but implementing one to the parallel implementation is highly discouraged due to hardware current limitations of switch matrices (typically limited to ~2A). Parallel DCIR is designed for direct-connection, high-current testing scenarios.

The measurement applies a two-phase discharge sequence (20% then 100% of the configured max load current) distributed evenly across all devices. Internal resistance is calculated from the voltage and current differences using Ohm’s law: R = (V1 - V2) / (I1 - I2), where subscripts 1 and 2 refer to the light-load (20%) and heavy-load (100%) phases respectively.

Key Features:
  • Multiple ELoads synchronized via hardware triggers (PXI backplane).

  • Current capacity scales linearly with number of devices (e.g., 3 ELoads = 3x current).

  • Voltage measured from leader device (remote sense for accuracy).

  • Current contributions summed across all devices.

Hardware Requirements:
  • All devices must be NI PXIe-4051 or compatible Electronic Loads.

  • Devices must be in the same PXI chassis for trigger routing.

  • One device designated as leader, others as followers.

Example

>>> leader_device = Device.create(DeviceFamily.ELOAD, "PXI1Slot2")
>>> follower1 = Device.create(DeviceFamily.ELOAD, "PXI1Slot3")
>>>
>>> params = DCIRTestParameters(
...     max_load_current=2.0,
...     powerline_frequency=PowerlineFrequency.FREQ_50_HZ,
... )
>>>
>>> parallel_dcir = ParallelDCIR(
...     leader=leader_device,
...     followers=[follower1],
...     test_parameters=params,
... )
>>>
>>> result = parallel_dcir.run()
>>> print(f"DC Resistance: {result} Ohms")
Parameters:
property all_measurement_data: collections.abc.Iterator[tuple[nibcq._device.Device, nibcq.measurement.SMUMeasurement | None]]

Get the processed measurement data from the last DCIR test.

Returns voltage and current measurement data collected during the two-phase discharge sequence, over all devices. This data includes all samples from both discharge periods and later combined across devices for further calculations.

Returns:

Iterator of tuples pairing each

Device with its corresponding SMUMeasurement. The tone_frequency is set to 0 for DC measurements. Yields tuples with None measurements if no measurement has been performed yet.

Return type:

Iterator[tuple[Device, SMUMeasurement | None]]

Example

>>> for device, measurement in parallel_dcir.all_measurement_data:
...     print(f"Device: {device.product}")
...     print(f"Voltage samples: {len(measurement.voltage_values)}")
property measurement_data: None | nibcq.measurement.SMUMeasurement

Get the processed measurement data from the last DCIR test.

Returns voltage and current measurement data collected during the two-phase discharge sequence, combined across all devices. This data includes all samples from both discharge periods and can be used for detailed analysis or custom calculations.

Returns:

Processed and multidevice-combined measurement data containing

voltage_values and current_values lists, combined across all devices. The tone_frequency is set to 0 for DC measurements. Returns None if the multidevice aggregation of measurements has not been performed yet.

Return type:

SMUMeasurement

run() float

Execute the complete DCIR measurement process and return the result.

Performs the full DCIR measurement sequence including device configuration, two-phase discharge measurement, and internal resistance calculation. The method coordinates all measurement steps and ensures proper resource management through session locking.

The measurement process follows these steps: 1. Acquire exclusive session lock on every device via a shared ExitStack 2. Configure the electronic loads with calculated parameters 3. Execute the two-phase discharge measurement sequence 4. Calculate internal resistance from voltage and current data 5. Validate the result for mathematical and physical validity 6. Release all session locks (guaranteed even if an earlier step raised)

Returns:

The measured internal resistance in Ohms. Valid results are finite,

positive values representing the DC resistance of the DUT under the specified load conditions.

Return type:

float

Raises:
  • NotImplementedError – If the multi_device_type is not MultiDeviceMode.PARALLEL, as only parallel operation is currently supported.

  • ValueError – If the calculated resistance is NaN (zero current difference) or infinite (indicating measurement or calculation errors), if device configuration fails due to invalid parameters, or if measurement data validation fails.

  • RuntimeError – If the measurement process fails at any step due to hardware communication errors, device malfunctions, or resource conflicts with other measurement sessions.

  • TimeoutError – If the measurement sequence does not complete within the calculated timeout period.

Example

>>> # Configure and run DCIR measurement
>>> params = DCIRTestParameters(max_load_current=2.0)
>>> dcir = DCIR(device, params)
>>> resistance = dcir.run()
>>> print(f"DCIR: {resistance:.4f} Ohms")
get_all_devices()

Yield every parallel device, followers first, leader last.

This generator avoids storing a redundant copy of the device references that already live in ParallelMeasurement’s fields containing the followers and the leader.

Yields:

Device – The next device in followers-then-leader order.

property test_parameters: TestParameters

Get the current test parameters for the measurement.

Returns the configuration parameters that define how the measurement should be performed, including settings like powerline frequency and other measurement-specific parameters.

Returns:

The current test parameters configuration

Return type:

TestParameters

Examples

>>> measurement = Measurement(device)
>>> params = measurement.test_parameters
>>> print(params.powerline_frequency)
PowerlineFrequency.FREQ_60_HZ
property result: float | SMUResult | list[SMUResult] | list[tuple[nibcq.switch.SMUCellData, SMUResult]] | list[tuple[nibcq.switch.SMUCellData, list[SMUResult]]] | list[tuple[str, tuple[datetime.datetime, datetime.datetime, float]]] | Any

Get the result of the last measurement.

Returns the measurement result from the most recent measurement operation. The result type depends on the specific measurement implementation and whether switching was used:

  • Single measurements:
    • float for OCV and DCIR

    • SMUResult for ACIR

    • list[SMUResult] for EIS

  • Switching measurements:
    • list[tuple[SMUCellData, SMUResult]] for ACIR with switching

    • list[tuple[SMUCellData, list[SMUResult]]], for EIS with switching

    • list[tuple[str, tuple[datetime, datetime, float]]], for OCV with switching

Returns:

float | SMUResult | list[SMUResult] | list[tuple[SMUCellData, SMUResult]] | list[tuple[SMUCellData, list[SMUResult]]] | list[tuple[str, tuple[datetime, datetime, float]]] | Any: The measurement result(s). For switching measurements, returns a list of tuples where each tuple contains the cell data and its corresponding results.

Raises:

RuntimeError – If no measurement has been performed yet or if the result is not available

Return type:

Union[float, SMUResult, list[SMUResult], list[tuple[nibcq.switch.SMUCellData, SMUResult]], list[tuple[nibcq.switch.SMUCellData, list[SMUResult]]], list[tuple[str, tuple[datetime.datetime, datetime.datetime, float]]], Any]

Examples

>>> measurement.run(test_parameters)
>>> result = measurement.result
>>> print(f"Measurement result: {result}")
>>>
>>> # For switching measurements
>>> switching_results = measurement.run_with_switching(compensation)
>>> for cell_data, cell_results in measurement.result:
...     print(f"Cell {cell_data.cell_serial_number}: {len(cell_results)} results")
DEVICE_FAMILY: nibcq.enums.DeviceFamily = None

Device family for DCIR measurements.

Type:

DeviceFamily

property acceptable_temperature_delta: float

Get the acceptable temperature delta for compensation validation.

Returns the maximum allowed temperature difference from the device’s temperature capability. This is a pass-through property that delegates to the underlying TemperatureCapability.

Returns:

The acceptable temperature delta in degrees, or NaN if no temperature capability

Return type:

float

Examples

>>> measurement = EIS(device)
>>> measurement.acceptable_temperature_delta = 2.5
>>> delta = measurement.acceptable_temperature_delta
property temperature: float

Get the latest temperature reading from the device.

Returns:

The most recent temperature measurement, or NaN if no temperature capability

Return type:

float

property temperature_range: CenteredRange

Get the latest temperature reading from the device, coupled with the user-set delta.

Returns:

A CenteredRange representing the most recent temperature measurement (NaN if not available), along with the acceptable temperature delta (NaN if not set).

Return type:

CenteredRange

measure_temperature() CenteredRange

Get a new temperature reading from the device.

Returns:

Current temperature reading, or NaN if no temperature capability

Return type:

CenteredRange

validate_temperature(target_temperature: CenteredRange) bool

Validate the current temperature against the compensation file’s target.

Delegates to the device’s temperature capability for validation. The capability handles all validation logic including checking if thermocouple is configured, using overridden delta values if set, and printing appropriate warnings.

Parameters:

target_temperature (CenteredRange) – The target temperature parameters for validation

Returns:

True if thermocouple is configured and temperature is within range.

False if thermocouple is not configured (capability missing or not set up), or if target temperature/delta is NaN.

Return type:

bool

Raises:

TemperatureError – If the current temperature exceeds the target ± delta range (only raised when capability is configured)

Examples

>>> measurement = EIS(device)
>>> measurement.measure_temperature()
>>> target = compensation.temperature_parameter
>>> is_valid = measurement.validate_temperature(target)