Analog impedance measurements
The AnalogImpedance functionality supports analog measurements of signal propagation properties on devices that support it, such as the Analog Discovery and the Analog Discovery 2.
Todo
This section is currently incomplete.
It lacks information on the state machine used in the AnalogImpedance API, what the different settings mean, what the different methods actually do, and how they can be used to perform measurements.
There are also no AnalogImpedance examples yet.
Using the analog impedance measurements
To use the AnalogImpedance functionality you first need to initialize a DwfLibrary instance. Next, you open a specific device. The device’s AnalogImpedance functionality can now be accessed via its analogImpedance
attribute, which is an instance of the AnalogImpedance
class.
For example:
from pydwf import DwfLibrary
from pydwf.utilities import openDwfDevice
dwf = DwfLibrary()
with openDwfDevice(dwf) as device:
# Get a reference to the device's AnalogImpedance functionality.
analogImpedance = device.analogImpedance
# Use the AnalogImpedance functionality.
analogImpedance.reset()
AnalogImpedance reference
- class AnalogImpedance
The AnalogImpedance class provides access to the analog impedance measurement functionality of a
DwfDevice
.Attention
Users of pydwf should not create instances of this class directly.
It is instantiated during initialization of a DwfDevice and subsequently assigned to its public
analogImpedance
attribute for access by the user.- reset() None
Reset the AnalogImpedance functionality.
- Raises:
DwfLibraryError – An error occurred while executing the reset operation.
- configure(start: bool) None
Configure the AnalogImpedance functionality, and optionally start a measurement.
- Parameters:
start (bool) – Whether to start the measurement.
- Raises:
DwfLibraryError – An error occurred while executing the configure operation.
- status() DwfState
Return the status of the AnalogImpedance functionality.
- Returns:
The status of the measurement.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the status operation.
- modeSet(mode: int) None
Set AnalogImpedance measurement mode.
- Parameters:
mode (int) –
The measurement mode.
The following modes are defined:
0 — W1-C1-DUT-C2-R-GND
1 — W1-C1-R-C2-DUT-GND
8 — Impedance analyzer for the Analog Discovery
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- modeGet() int
Get AnalogImpedance measurement mode.
- Returns:
The measurement mode.
The following modes are defined:
0 — W1-C1-DUT-C2-R-GND
1 — W1-C1-R-C2-DUT-GND
8 — Impedance analyzer for the Analog Discovery
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- referenceSet(reference: float) None
Set AnalogImpedance reference load value, in Ohms.
- Parameters:
reference (float) – The reference load, in Ohms.
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- referenceGet() float
Get AnalogImpedance reference load value, in Ohms.
- Returns:
The reference load, in Ohms.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- frequencySet(frequency: float) None
Set AnalogImpedance source frequency, in Hz.
- Parameters:
frequency (float) – The source frequency, in Hz.
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- frequencyGet() float
Get AnalogImpedance source frequency, in Hz.
- Returns:
The source frequency, in Hz.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- amplitudeSet(amplitude: float) None
Set AnalogImpedance source amplitude value, in Volts.
- Parameters:
amplitude (float) – The source amplitude, in Volts.
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- amplitudeGet() float
Get AnalogImpedance source amplitude, in Volts.
- Returns:
The source amplitude, in Volts.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- offsetSet(offset: float) None
Set AnalogImpedance source offset, in Volts.
- Parameters:
offset (float) – The source offset, in Volts.
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- offsetGet() float
Get AnalogImpedance source offset, in Volts.
- Returns:
The source offset, in Volts.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- probeSet(resistance: float, capacitance: float) None
Set AnalogImpedance probe parameters.
- Parameters:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- probeGet() Tuple[float, float]
Get AnalogImpedance probe parameters.
- Returns:
A two-element tuple: the probe resistance, in Ohms, and the probe capacity, in Farads.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- periodSet(period: int) None
Set the AnalogImpedance measurement period.
Todo
Figure out what this setting is for, why it’s an int, and what its physical unit is.
- Parameters:
period (int) – The measurement period.
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- periodGet() int
Get the AnalogImpedance measurement period.
Todo
Figure out what this setting is for, why it’s an int, and what its physical unit is.
- Returns:
The measurement period.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- compReset() None
Reset the AnalogImpedance measurement computation.
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- compSet(open_resistance: float, open_reactance: float, short_resistance: float, short_reactance: float) None
Set the AnalogImpedance measurement computation parameters.
- Parameters:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- compGet() Tuple[float, float, float, float]
Get the AnalogImpedance measurement computation parameters.
- Returns:
The open-circuit resistance, open-circuit reactance, short-circuit resistance, and short-circuit reactance (all in Ohms).
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- statusInput(channel_index: int) Tuple[float, float]
Get the AnalogImpedance input measurement status.
- Parameters:
channel_index (int) – The channel for which to get gain and phase information.
- Returns:
The gain and phase (in radians) of the current measurement.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- statusWarning(channel_index: int) int
Get warning for scope input range exceeded.
- Parameters:
channel_index (int) – The channel for which to get scope input range warning information.
- Returns:
The warning, if any. 1 means low, 2 means high, 3 means both.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.
- statusMeasure(measure: DwfAnalogImpedance) float
Retrieve the AnalogImpedance measurement status value.
- Parameters:
measure (DwfAnalogImpedance) – The quantity to measure.
- Returns:
The value measured for the requested quantity.
- Return type:
- Raises:
DwfLibraryError – An error occurred while executing the operation.