nibcq.OCV ========= .. py:class:: nibcq.OCV(device: nibcq._device.Device, test_parameters: OCVTestParameters) Bases: :py:obj:`nibcq.measurement.Measurement` Class to handle the Open Circuit Voltage (OCV) process for a given instrument. .. py:attribute:: DEVICE_FAMILY :type: Final[nibcq.enums.DeviceFamily] Device family for OCV measurements. :type: DeviceFamily .. py:property:: test_parameters :type: 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 :rtype: OCVTestParameters .. rubric:: Examples >>> ocv = OCV(device) >>> params = ocv.test_parameters >>> print(params.range) DMMRange.DC_10V >>> print(params.aperture_time) 0.0 .. py: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) :rtype: OCVTestParameters .. rubric:: Examples >>> ocv = OCV(device) >>> config = ocv.dmm_configuration >>> print(config.range) DMMRange.DC_10V .. py:property:: result :type: Union[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. :rtype: 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 .. py:method:: 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 :rtype: tuple[datetime, datetime, float] :raises RuntimeError: If the device is not initialized or measurement fails :raises ValueError: If test_parameters are invalid or incomplete :raises nidmm.errors.DriverError: If DMM-specific errors occur during measurement .. rubric:: Examples >>> params = OCVTestParameters() >>> ocv = OCV(device, params) >>> start, end, voltage = ocv.run() >>> print(f"Measured {voltage}V from {start} to {end}") .. py:method:: 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. :param test_parameters: The OCV test parameters containing DMM range, aperture time, averaging settings, and other configuration options for the voltage measurement. :type test_parameters: OCVTestParameters :returns: List of tuples containing (channel_name, voltage_value) for each measured channel. :rtype: list[tuple[str, float]] :raises RuntimeError: If switching is not enabled or no switch channels are configured :raises RuntimeError: If the device is not initialized or measurement fails :raises ValueError: If test_parameters are invalid or incomplete :raises nidmm.errors.DriverError: If DMM-specific errors occur during measurement .. rubric:: Examples >>> params = OCVTestParameters() >>> ocv = OCV(device, params) >>> results = ocv.run_with_switching() >>> for channel, voltage in results: ... print(f"Channel {channel}: {voltage} V") .. py:property:: has_switch_capability :type: bool Check if the device has switch capability. :returns: True if switch capability is available, False otherwise .. py:method:: connect_channel(channel: SMUCellData) -> None Connect to a specific DUT channel using the device's switch capability. :param channel: SwitchChannel containing connection information :raises RuntimeError: If no switch capability is available .. py:method:: disconnect_all() -> None Disconnect all channels using the device's switch capability. :raises RuntimeError: If no switch capability is available .. py:method:: wait_for_debounce() -> None Wait for switch relays to settle using the device's switch capability. :raises RuntimeError: If no switch capability is available .. py:property:: switch_cells :type: 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. .. py:property:: acceptable_temperature_delta :type: 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 :rtype: float .. rubric:: Examples >>> measurement = EIS(device) >>> measurement.acceptable_temperature_delta = 2.5 >>> delta = measurement.acceptable_temperature_delta .. py:property:: temperature :type: float Get the latest temperature reading from the device. :returns: The most recent temperature measurement, or NaN if no temperature capability .. py:property:: temperature_range :type: 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). .. py:method:: measure_temperature() -> CenteredRange Get a new temperature reading from the device. :returns: Current temperature reading, or NaN if no temperature capability .. py:method:: 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. :param target_temperature: 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. :rtype: bool :raises ValueError: If the current temperature exceeds the target ± delta range (only raised when capability is configured) .. rubric:: Examples >>> measurement = EIS(device) >>> measurement.measure_temperature() >>> target = compensation.temperature_parameter >>> is_valid = measurement.validate_temperature(target)