cohesivm.channels
This module contains the Channel Abstract Base Class which should be inherited by device channels. The main
responsibility is to execute actions on the physical device channels for which the device
connection is stored.
Furthermore, all possible channel methods are defined in the Channel in order for a
Measurement to recognize them. Trait classes, e.g., Voltmeter, will inherit
these methods and set the ones that must be implemented abstract. Then they can be used to be implemented in a device
module and for the compatibility check of the Experiment.
- class Channel(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ABCContains the properties and methods to operate a physical device channel. The implementation of a child class must define the
get_property()andset_property()methods which are used to configure the channel. Practically, the child class will inherit a trait class (child class of this class) which additionally defines the specific methods which must be implemented.- Parameters:
identifier – String identifier of the channel.
settings – Dictionary of channel settings.
- property settings: DatabaseDict
Dictionary of channel settings.
- property connection: Any | None
Holds the resource of the device connection while a connection is established through using the
connect()contextmanager.
- abstract set_property(name: str, value: Any) None[source]
Sets a property/device-setting to the provided value.
- Parameters:
name – The name of the property/device-setting to be set.
value – The value to which the property/device-setting should be set.
- abstract get_property(name: str) Any[source]
Retrieves the current value of a property/device-setting.
- Parameters:
name – The name of the property/device-setting to get.
- Returns:
The value of the property/device-setting.
- change_setting(setting, value) None[source]
Modifies the
settingsand overwrites the settings on the device.
- abstract enable() None[source]
Enables the channel. Must be executed before any channel method can be run.
- source_voltage(voltage: float) None[source]
Sets the DC output voltage to the defined value.
- Parameters:
voltage – Output voltage of the DC power source in V.
- source_current(current: float) None[source]
Sets the DC output current to the defined value.
- Parameters:
current – Output current of the DC power source in A.
- source_voltage_and_measure(voltage: float) Tuple[float, float][source]
Sets the DC output voltage to the defined value and measures the current.
- Parameters:
voltage – Output voltage of the power source in V.
- Returns:
Measurement result: (voltage (V), current (A)).
- source_current_and_measure(current: float) Tuple[float, float][source]
Sets the DC output current to the defined value and measures the voltage.
- Parameters:
current – Output current of the current source in A.
- Returns:
Measurement result: (current (A), voltage (V)).
- sweep_voltage_and_measure(start_voltage: float, end_voltage: float, voltage_step: float, hysteresis: bool) list[tuple[float, float]][source]
Sweeps over the specified voltage range and measures the current for each voltage step.
- Parameters:
start_voltage – Begin of the measurement range in V.
end_voltage – End of the measurement range in V.
voltage_step – Voltage change for each datapoint in V. Must be larger than 0.
hysteresis – Flags if the voltage range should be measured a second time in reverse order directly after the initial measurement.
- Returns:
Measurement results: [(voltage1 (V), current1 (A)), (voltage2 (V), current2 (A)), …]
- set_oscillator_frequency(frequency: float) None[source]
Sets the AC frequency of the oscillator to the defined value.
- Parameters:
frequency – Oscillator frequency in Hz.
- set_oscillator_voltage(voltage: float) None[source]
Sets the AC voltage of the oscillator to the defined value.
- Parameters:
voltage – Oscillator voltage level in V.
- class Voltmeter(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ChannelMeasures the electric potential difference between two points in a circuit.
- class Amperemeter(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ChannelMeasures the current flowing through a circuit.
- class VoltageSource(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ChannelSupplies a constant DC voltage.
- class CurrentSource(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ChannelSupplies a constant DC current.
- class VoltageSMU(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ChannelCombines the functions of a voltage source and current measurement device.
- class CurrentSMU(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ChannelCombines the functions of a current source and voltage measurement device.
- class SweepVoltageSMU(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ChannelImplements hardware sweep capabilities of a voltage SMU channel.
- abstract sweep_voltage_and_measure(start_voltage: float, end_voltage: float, voltage_step: float, hysteresis: bool) list[tuple[float, float]][source]
Sweeps over the specified voltage range and measures the current for each voltage step.
- Parameters:
start_voltage – Begin of the measurement range in V.
end_voltage – End of the measurement range in V.
voltage_step – Voltage change for each datapoint in V. Must be larger than 0.
hysteresis – Flags if the voltage range should be measured a second time in reverse order directly after the initial measurement.
- Returns:
Measurement results: [(voltage1 (V), current1 (A)), (voltage2 (V), current2 (A)), …]
- class LCRMeter(identifier: str | None = None, settings: DatabaseDict | None = None)[source]
Bases:
ChannelEnables the measurement of the inductance (L), capacitance (C), and resistance (R) of an electronic component.
- abstract source_voltage(voltage: float) None[source]
Sets the DC output voltage to the defined value.
- Parameters:
voltage – Output voltage of the DC power source in V.
- abstract source_current(current: float) None[source]
Sets the DC output current to the defined value.
- Parameters:
current – Output current of the DC power source in A.
- abstract set_oscillator_frequency(frequency: float)[source]
Sets the AC frequency of the oscillator to the defined value.
- Parameters:
frequency – Oscillator frequency in Hz.
- abstract set_oscillator_voltage(voltage: float) None[source]
Sets the AC voltage of the oscillator to the defined value.
- Parameters:
voltage – Oscillator voltage level in V.