nibcq.LCRACIR

class nibcq.LCRACIR(device: nibcq._device.Device, test_parameters: LCRTestParameters)

LCR-based ACIR (AC Internal Resistance) measurement handler class.

This class implements single-frequency AC impedance measurements using the NI PXIe-4190 LCR Meter. Unlike SMU-based ACIR which uses waveform generation and FFT analysis, the LCR meter performs hardware-based impedance measurements directly at 1000 Hz.

The LCR meter handles all signal generation and analysis internally, making measurements simpler and faster than SMU-based methods.

Parameters:
DEVICE_FAMILY

DeviceFamily.LCR_METER - required device type.

Type:

DeviceFamily

measurement_frequency

Default frequency for ACIR (1000.0 Hz).

Type:

float

MEASUREMENT_TIMEOUT

21.0 seconds - timeout for measurement completion.

Type:

float

Examples

>>> device = Device.create(DeviceFamily.LCR_METER, "PXI1Slot2")
>>> params = LCRTestParameters(current_amplitude=0.07)
>>> lcr_acir = LCRACIR(device, params)
>>> result = lcr_acir.run()
>>> print(f"Impedance: {result.z_magnitude:.4f} Ohm")
property device: nibcq._device.Device

Get the device instance.

Returns:

The connected LCR Meter device instance.

Return type:

Device

property test_parameters: LCRTestParameters

Get the test parameters.

Returns:

The current LCR test parameters configuration.

Return type:

LCRTestParameters

property result: nibcq.measurement.LCRMeasurementResult | None

Get the last measurement result.

Return type:

Optional[nibcq.measurement.LCRMeasurementResult]

static validate_current_amplitude(current_amplitude: float) bool

Validate that the current amplitude is within acceptable limits.

Parameters:

current_amplitude (float) – The current amplitude to validate in Amperes RMS.

Returns:

Always returns True when validation passes.

Return type:

bool

Raises:

LCRParameterError – If the current amplitude is outside the valid range (7.08 nA to 707 mA).

run() nibcq.measurement.LCRMeasurementResult

Run the complete LCR ACIR measurement.

Configures the device, performs the measurement, and returns the results. The measurement is performed at 1000 Hz (ACIR standard frequency).

Returns:

The measurement results containing impedance,

resistance, reactance, phase, and frequency data.

Return type:

LCRMeasurementResult

Raises:
  • LCRParameterError – If parameters are invalid.

  • nidcpower.Error – If hardware operation fails.

Examples

>>> device = Device.create(DeviceFamily.LCR_METER, "PXI1Slot2")
>>> params = LCRTestParameters()
>>> lcr_acir = LCRACIR(device, params)
>>> result = lcr_acir.run()
>>> print(f"Z = {result.z_magnitude:.4f} Ohm")
>>> print(f"Rs = {result.resistance:.4f} Ohm")
>>> print(f"Theta = {result.theta:.2f} degrees")
create_compensation(params: nibcq.lcr_compensation.LCRCompensationParameters, skip_prompts: bool = False) nibcq.measurement.LCRMeasurementResult

Generate LCR compensation data and verify with a measurement.

This method performs the complete 7-step compensation generation flow as defined in the LabVIEW “Create Compensation” example:

  1. Session init (already done via Device.create)

  2. Custom cable compensation (if enabled)

  3. Set cable length

  4. Open/Short compensation (if enabled)

  5. Load compensation (if enabled)

  6. Configure session for verification measurement

  7. Verification measurement (initiate, wait, measure, reset)

The compensation data is stored on the device’s onboard memory and remains available for subsequent measurements until the device is reset or powered off.

User prompts are displayed before each step requiring physical connection changes (open, short, load). These prompts ensure the user has made the correct physical setup before compensation data is captured.

Parameters:
  • params (LCRCompensationParameters) – LCRCompensationParameters with all configuration options.

  • skip_prompts (bool) – If True, skips user prompts for physical connections. User must ensure correct connections are made before each step. Useful for automated testing or scripted calibration sequences. Follows the Calibrator.self_calibrate(force=…) pattern.

Returns:

Verification measurement result after

compensation is applied. Can be used to verify compensation quality (should show near-zero impedance for a short).

Return type:

LCRMeasurementResult

Raises:
  • LCRParameterError – If parameters are invalid (e.g., load comp without open AND short).

  • nidcpower.Error – If hardware operation fails.

Examples

>>> # Interactive compensation with user prompts
>>> lcr = LCRACIR(device, test_params)
>>> result = lcr.create_compensation(
...     LCRCompensationParameters(
...         generate_open=True,
...         generate_short=True,
...         enable_open=True,
...         enable_short=True,
...     )
... )
>>> print(f"Verification Z: {result.z_magnitude:.6f} Ohm")
>>>
>>> # Automated compensation (for testing)
>>> result = lcr.create_compensation(params, skip_prompts=True)