nibcq.OCV

class nibcq.OCV(device: nibcq._device.Device, test_parameters: OCVTestParameters)

Bases: nibcq.measurement.Measurement

Class to handle the Open Circuit Voltage (OCV) process for a given instrument.

Parameters:
DEVICE_FAMILY: Final[nibcq.enums.DeviceFamily]

Device family for OCV measurements.

Type:

DeviceFamily

property test_parameters: OCVTestParameters

Get the current OCV test parameters.

Returns the OCVTestParameters object containing all configuration settings specific to Open Circuit Voltage measurements including DMM range, aperture time, averaging settings, and ADC calibration options.

Returns:

The current OCV-specific test parameters configuration

Return type:

OCVTestParameters

Examples

>>> ocv = OCV(device)
>>> params = ocv.test_parameters
>>> print(params.range)
DMMRange.DC_10V
>>> print(params.aperture_time)
0.0
property dmm_configuration

Get the DMM configuration as an alias for test_parameters.

Provides backward compatibility and clarity by offering an alias to the test_parameters property with a name that clearly indicates this is DMM-specific configuration. This matches the LabVIEW API naming convention.

Returns:

The current DMM configuration (same as test_parameters)

Return type:

OCVTestParameters

Examples

>>> ocv = OCV(device)
>>> config = ocv.dmm_configuration
>>> print(config.range)
DMMRange.DC_10V
property result: float | list[tuple[str, tuple[datetime.datetime, datetime.datetime, float]]]

Get the result of the last OCV measurement.

Returns the measurement result from the most recent measurement operation. The result type depends on whether switching was used or not.

Returns:

The result(s)

of the last measurement. For switching measurements, returns a list of tuples where each tuple contains the cell data and its corresponding results.

Return type:

Union[float, list[tuple[str, tuple[datetime, datetime, float]]]]

Raises:

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

run() tuple[datetime.datetime, datetime.datetime, float]

Run the OCV measurement process and return timing and result information.

Performs a complete Open Circuit Voltage measurement using the configured DMM parameters. Returns detailed timing information along with the measurement result for proper timestamping and runtime calculation.

Returns:

A tuple containing:
  • start_time: Timestamp when measurement started

  • end_time: Timestamp when measurement completed

  • result: The measured voltage value in volts

Return type:

tuple[datetime, datetime, float]

Raises:
  • RuntimeError – If the device is not initialized or measurement fails

  • ValueError – If test_parameters are invalid or incomplete

  • nidmm.errors.DriverError – If DMM-specific errors occur during measurement

Examples

>>> params = OCVTestParameters()
>>> ocv = OCV(device, params)
>>> start, end, voltage = ocv.run()
>>> print(f"Measured {voltage}V from {start} to {end}")
run_with_switching() list[tuple[str, tuple[datetime.datetime, datetime.datetime, float]]]

Run OCV measurement with automatic switching between DUT channels.

Performs Open Circuit Voltage measurements on multiple DUTs by automatically switching between configured channels. Each measurement includes timing information and DUT identification.

Parameters:

test_parameters (OCVTestParameters) – The OCV test parameters containing DMM range, aperture time, averaging settings, and other configuration options for the voltage measurement.

Returns:

List of tuples containing (channel_name, voltage_value)

for each measured channel.

Return type:

list[tuple[str, float]]

Raises:
  • RuntimeError – If switching is not enabled or no switch channels are configured

  • RuntimeError – If the device is not initialized or measurement fails

  • ValueError – If test_parameters are invalid or incomplete

  • nidmm.errors.DriverError – If DMM-specific errors occur during measurement

Examples

>>> params = OCVTestParameters()
>>> ocv = OCV(device, params)
>>> results = ocv.run_with_switching()
>>> for channel, voltage in results:
...     print(f"Channel {channel}: {voltage} V")
property has_switch_capability: bool

Check if the device has switch capability.

Returns:

True if switch capability is available, False otherwise

Return type:

bool

connect_channel(channel: SMUCellData) None

Connect to a specific DUT channel using the device’s switch capability.

Parameters:

channel (SMUCellData) – SwitchChannel containing connection information

Raises:

RuntimeError – If no switch capability is available

Return type:

None

disconnect_all() None

Disconnect all channels using the device’s switch capability.

Raises:

RuntimeError – If no switch capability is available

Return type:

None

wait_for_debounce() None

Wait for switch relays to settle using the device’s switch capability.

Raises:

RuntimeError – If no switch capability is available

Return type:

None

property switch_cells: List[str] | List[SMUCellData]

Get the configured switch cells from the device.

Returns:

A list of DUT channel names or SMUCellData objects, which contain the DUT and switch channel information.

Return type:

List[str] | List[SMUCellData]

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:

ValueError – 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)