Rohde & Schwarz Drivers¶
Classes:
|
QCoDeS Instrument driver for the Rohde-Schwarz RTO1000 series oscilloscopes. |
|
Class to hold an input channel of the scope. |
|
Class to hold a measurement of the scope. |
|
This is the QCoDeS driver for the Rohde & Schwarz SGS100A signal generator. |
|
QCoDeS driver for Rohde & Schwarz ZNB20 |
|
QCoDeS driver for Rohde & Schwarz ZNB8 |
|
Base class for QCoDeS driver for the Rohde & Schwarz ZNB8 and ZNB20 virtual network analyser. |
|
- class qcodes.instrument_drivers.rohde_schwarz.RohdeSchwarzRTO1000(name: str, address: str, *, model: str | None = None, HD: bool = True, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
VisaInstrument
QCoDeS Instrument driver for the Rohde-Schwarz RTO1000 series oscilloscopes.
- Parameters:
name – name of the instrument
address – VISA resource address
model – The instrument model. For newer firmware versions, this can be auto-detected
HD – Does the unit have the High Definition Option (allowing 16 bit vertical resolution)
**kwargs – kwargs are forwarded to base class.
Attributes:
The default timeout in seconds if the timeout is not specified when creating the instrument.
The default terminator to use if the terminator is not specified when creating the instrument.
Parameter display
Parameter trigger_display
Parameter trigger_source
Sets the trigger mode which determines the behaviour of the instrument if no trigger occurs.
Parameter trigger_type
Parameter trigger_level
Parameter trigger_edge_slope
Parameter timebase_scale
Parameter timebase_range
Parameter timebase_position
Parameter run_mode
Parameter num_acquisitions
Parameter completed_acquisitions
Number of averages for measuring trace.
recorded waveform samples per second
Parameter dataformat
Sets the filter bandwidth for the high definition mode.
Parameter high_definition_bandwidth
Parameter error_count
Parameter error_next
Parameter opc
Parameter stop_opc
Parameter status_operation
Methods:
run_cont
()Set the instrument in 'RUN CONT' mode
Set the instrument in 'RUN Nx SINGLE' mode
- default_timeout: float | None = 5.0¶
The default timeout in seconds if the timeout is not specified when creating the instrument. None means no timeout e.g. wait forever.
- default_terminator: str | None = '\n'¶
The default terminator to use if the terminator is not specified when creating the instrument. None means use the default terminator from PyVisa.
- display: Parameter = self.add_parameter( "display", label="Display state", set_cmd="SYSTem:DISPlay:UPDate {}", val_mapping={"remote": 0, "view": 1}, )¶
Parameter display
- trigger_display: Parameter = self.add_parameter( "trigger_display", label="Trigger display state", set_cmd="DISPlay:TRIGger:LINes {}", get_cmd="DISPlay:TRIGger:LINes?", val_mapping={"ON": 1, "OFF": 0}, )¶
Parameter trigger_display
- trigger_source: Parameter = self.add_parameter( "trigger_source", label="Trigger source", set_cmd="TRIGger1:SOURce {}", get_cmd="TRIGger1:SOURce?", val_mapping={ "CH1": "CHAN1", "CH2": "CHAN2", "CH3": "CHAN3", "CH4": "CHAN4", "EXT": "EXT", }, )¶
Parameter trigger_source
- trigger_mode: Parameter = self.add_parameter( "trigger_mode", label="Trigger mode", set_cmd="TRIGger:MODE {}", get_cmd="TRIGger1:SOURce?", vals=vals.Enum("AUTO", "NORMAL", "FREERUN"), docstring="Sets the trigger mode which determines" " the behaviour of the instrument if no" " trigger occurs.\n" "Options: AUTO, NORMAL, FREERUN.", unit="none", )¶
Sets the trigger mode which determines the behaviour of the instrument if no trigger occurs. Options: AUTO, NORMAL, FREERUN.
- trigger_type: Parameter = self.add_parameter( "trigger_type", label="Trigger type", set_cmd="TRIGger1:TYPE {}", get_cmd="TRIGger1:TYPE?", val_mapping={ "EDGE": "EDGE", "GLITCH": "GLIT", "WIDTH": "WIDT", "RUNT": "RUNT", "WINDOW": "WIND", "TIMEOUT": "TIM", "INTERVAL": "INT", "SLEWRATE": "SLEW", "DATATOCLOCK": "DAT", "STATE": "STAT", "PATTERN": "PATT", "ANEDGE": "ANED", "SERPATTERN": "SERP", "NFC": "NFC", "TV": "TV", "CDR": "CDR", }, )¶
Parameter trigger_type
- trigger_level: Parameter = self.add_parameter( "trigger_level", label="Trigger level", set_cmd=self._set_trigger_level, get_cmd=self._get_trigger_level, )¶
Parameter trigger_level
- visa_handle: pyvisa.resources.MessageBasedResource = visa_handle¶
The VISA resource used by this instrument.
- parameters: dict[str, ParameterBase] = {}¶
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: dict[str, Function] = {}¶
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: dict[str, InstrumentModule | ChannelTuple] = {}¶
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: dict[str, InstrumentModule] = {}¶
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- trigger_edge_slope: Parameter = self.add_parameter( "trigger_edge_slope", label="Edge trigger slope", set_cmd="TRIGger1:EDGE:SLOPe {}", get_cmd="TRIGger1:EDGE:SLOPe?", vals=vals.Enum("POS", "NEG", "EITH"), )¶
Parameter trigger_edge_slope
- timebase_scale: Parameter = self.add_parameter( "timebase_scale", label="Timebase scale", set_cmd=self._set_timebase_scale, get_cmd="TIMebase:SCALe?", unit="s/div", get_parser=float, vals=vals.Numbers(25e-12, 10000), )¶
Parameter timebase_scale
- timebase_range: Parameter = self.add_parameter( "timebase_range", label="Timebase range", set_cmd=self._set_timebase_range, get_cmd="TIMebase:RANGe?", unit="s", get_parser=float, vals=vals.Numbers(250e-12, 100e3), )¶
Parameter timebase_range
- timebase_position: Parameter = self.add_parameter( "timebase_position", label="Horizontal position", set_cmd=self._set_timebase_position, get_cmd="TIMEbase:HORizontal:POSition?", get_parser=float, unit="s", vals=vals.Numbers(-100e24, 100e24), )¶
Parameter timebase_position
- run_mode: Parameter = self.add_parameter( "run_mode", label="Run/acquisition mode of the scope", get_cmd=None, set_cmd=None, )¶
Parameter run_mode
- num_acquisitions: Parameter = self.add_parameter( "num_acquisitions", label="Number of single acquisitions to perform", get_cmd="ACQuire:COUNt?", set_cmd="ACQuire:COUNt {}", vals=vals.Ints(1, 16777215), get_parser=int, )¶
Parameter num_acquisitions
- completed_acquisitions: Parameter = self.add_parameter( "completed_acquisitions", label="Number of completed acquisitions", get_cmd="ACQuire:CURRent?", get_parser=int, )¶
Parameter completed_acquisitions
- sampling_rate: Parameter = self.add_parameter( "sampling_rate", label="Sample rate", docstring="Number of averages for measuring trace.", unit="Sa/s", get_cmd="ACQuire:POINts:ARATe" + "?", get_parser=int, )¶
Number of averages for measuring trace.
- acquisition_sample_rate: Parameter = self.add_parameter( "acquisition_sample_rate", label="Acquisition sample rate", unit="Sa/s", docstring="recorded waveform samples per second", get_cmd="ACQuire:SRATe" + "?", set_cmd="ACQuire:SRATe " + " {:.2f}", vals=vals.Numbers(2, 20e12), get_parser=float, )¶
recorded waveform samples per second
- dataformat: Parameter = self.add_parameter( "dataformat", label="Export data format", set_cmd="FORMat:DATA {}", get_cmd="FORMat:DATA?", vals=vals.Enum("ASC,0", "REAL,32", "INT,8", "INT,16"), )¶
Parameter dataformat
- high_definition_state: Parameter¶
Sets the filter bandwidth for the high definition mode. ON: high definition mode, up to 16 bit digital resolution Options: ON, OFF
Warning/Bug: By opening the HD acquisition menu on the scope, this value will be set to “ON”.
- error_count: Parameter = self.add_parameter( "error_count", label="Number of errors in the error stack", get_cmd="SYSTem:ERRor:COUNt?", unit="#", get_parser=int, )¶
Parameter error_count
- error_next: Parameter = self.add_parameter( "error_next", label="Next error from the error stack", get_cmd="SYSTem:ERRor:NEXT?", get_parser=str, )¶
Parameter error_next
- class qcodes.instrument_drivers.rohde_schwarz.RohdeSchwarzRTO1000ScopeChannel(parent: Instrument, name: str, channum: int, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentChannel
Class to hold an input channel of the scope.
Exposes: state, coupling, ground, scale, range, position, offset, invert, bandwidth, impedance, overload.
- Parameters:
parent – The instrument to which the channel is attached
name – The name of the channel
channum – The number of the channel in question. Must match the actual number as used by the instrument (1..4)
**kwargs – Forwarded to base class.
Attributes:
Switches the channel on or off
Selects the connection of the channel signal.
Connects/disconnects the signal to/from the ground.
Parameter scale
Parameter range
Positive values move the waveform up, negative values move it down.
Parameter offset
Parameter invert
Parameter bandwidth
Sets the impedance of the channel for power calculations and measurements.
Parameter overload
Parameter arithmetics
Parameter trace
- state: Parameter = self.add_parameter( "state", label=f"Channel {channum} state", get_cmd=f"CHANnel{channum}:STATe?", set_cmd=f"CHANnel{channum}:STATE {{}}", vals=vals.Enum("ON", "OFF"), docstring="Switches the channel on or off", )¶
Switches the channel on or off
- coupling: Parameter = self.add_parameter( "coupling", label=f"Channel {channum} coupling", get_cmd=f"CHANnel{channum}:COUPling?", set_cmd=f"CHANnel{channum}:COUPling {{}}", vals=vals.Enum("DC", "DCLimit", "AC"), docstring=( "Selects the connection of the channel " "signal. DC: 50 Ohm, DCLimit 1 MOhm, " "AC: Con. through DC capacitor" ), )¶
Selects the connection of the channel signal. DC: 50 Ohm, DCLimit 1 MOhm, AC: Con. through DC capacitor
- ground: Parameter = self.add_parameter( "ground", label=f"Channel {channum} ground", get_cmd=f"CHANnel{channum}:GND?", set_cmd=f"CHANnel{channum}:GND {{}}", vals=vals.Enum("ON", "OFF"), docstring=("Connects/disconnects the signal to/from the ground."), )¶
Connects/disconnects the signal to/from the ground.
- scale: Parameter = self.add_parameter( "scale", label=f"Channel {channum} Y scale", unit="V/div", get_cmd=f"CHANnel{channum}:SCALe?", set_cmd=self._set_scale, get_parser=float, )¶
Parameter scale
- range: Parameter = self.add_parameter( "range", label=f"Channel {channum} Y range", unit="V", get_cmd=f"CHANnel{channum}:RANGe?", set_cmd=self._set_range, get_parser=float, )¶
Parameter range
- position: Parameter = self.add_parameter( "position", label=f"Channel {channum} vert. pos.", unit="div", get_cmd=f"CHANnel{channum}:POSition?", set_cmd=f"CHANnel{channum}:POSition {{}}", get_parser=float, vals=vals.Numbers(-5, 5), docstring=( "Positive values move the waveform up, negative values move it down." ), )¶
Positive values move the waveform up, negative values move it down.
- offset: Parameter = self.add_parameter( "offset", label=f"Channel {channum} offset", unit="V", get_cmd=f"CHANnel{channum}:OFFSet?", set_cmd=f"CHANnel{channum}:OFFSet {{}}", get_parser=float, )¶
Parameter offset
- invert: Parameter = self.add_parameter( "invert", label=f"Channel {channum} inverted", get_cmd=f"CHANnel{channum}:INVert?", set_cmd=f"CHANnel{channum}:INVert {{}}", vals=vals.Enum("ON", "OFF"), )¶
Parameter invert
- bandwidth: Parameter = self.add_parameter( "bandwidth", label=f"Channel {channum} bandwidth", get_cmd=f"CHANnel{channum}:BANDwidth?", set_cmd=f"CHANnel{channum}:BANDwidth {{}}", vals=vals.Enum("FULL", "B800", "B200", "B20"), )¶
Parameter bandwidth
- impedance: Parameter = self.add_parameter( "impedance", label=f"Channel {channum} impedance", unit="Ohm", get_cmd=f"CHANnel{channum}:IMPedance?", set_cmd=f"CHANnel{channum}:IMPedance {{}}", vals=vals.Ints(1, 100000), docstring=( "Sets the impedance of the channel " "for power calculations and " "measurements." ), )¶
Sets the impedance of the channel for power calculations and measurements.
- overload: Parameter = self.add_parameter( "overload", label=f"Channel {channum} overload", get_cmd=f"CHANnel{channum}:OVERload?", )¶
Parameter overload
- arithmetics: Parameter = self.add_parameter( "arithmetics", label=f"Channel {channum} arithmetics", set_cmd=f"CHANnel{channum}:ARIThmetics {{}}", get_cmd=f"CHANnel{channum}:ARIThmetics?", val_mapping={"AVERAGE": "AVER", "OFF": "OFF", "ENVELOPE": "ENV"}, )¶
Parameter arithmetics
- trace: ScopeTrace = self.add_parameter( "trace", channum=self.channum, parameter_class=ScopeTrace )¶
Parameter trace
- parameters: dict[str, ParameterBase] = {}¶
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: dict[str, Function] = {}¶
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: dict[str, InstrumentModule | ChannelTuple] = {}¶
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: dict[str, InstrumentModule] = {}¶
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- class qcodes.instrument_drivers.rohde_schwarz.RohdeSchwarzRTO1000ScopeMeasurement(parent: Instrument, name: str, meas_nr: int, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentChannel
Class to hold a measurement of the scope.
- Parameters:
parent – The instrument to which the channel is attached
name – The name of the measurement
meas_nr – The number of the measurement in question. Must match the actual number as used by the instrument (1..8)
**kwargs – Forwarded to base class.
Attributes:
Switches the measurement on or off.
Set the source of a measurement if the measurement only needs one source.
Set the first source of a measurement if the measurement only needs multiple sources.
Set the second source of a measurement if the measurement only needs multiple sources.
Set the category of a measurement.
Set the main of a measurement.
Switches the measurement on or off.
Clears/reset measurement.
Number of measurement results in the long-term measurement.
Average of the long-term measurement results.
- enable: Parameter = self.add_parameter( "enable", label=f"Measurement {meas_nr} enable", set_cmd=f"MEASurement{meas_nr}:ENABle {{}}", vals=vals.Enum("ON", "OFF"), docstring="Switches the measurement on or off.", )¶
Switches the measurement on or off.
- source: Parameter = self.add_parameter( "source", label=f"Measurement {meas_nr} source", set_cmd=f"MEASurement{meas_nr}:SOURce {{}}", vals=self.sources, docstring="Set the source of a measurement if the " "measurement only needs one source.", )¶
Set the source of a measurement if the measurement only needs one source.
- source_first: Parameter = self.add_parameter( "source_first", label=f"Measurement {meas_nr} first source", set_cmd=f"MEASurement{meas_nr}:FSRC {{}}", vals=self.sources, docstring="Set the first source of a measurement" " if the measurement only needs multiple" " sources.", )¶
Set the first source of a measurement if the measurement only needs multiple sources.
- source_second: Parameter = self.add_parameter( "source_second", label=f"Measurement {meas_nr} second source", set_cmd=f"MEASurement{meas_nr}:SSRC {{}}", vals=self.sources, docstring="Set the second source of a measurement" " if the measurement only needs multiple" " sources.", )¶
Set the second source of a measurement if the measurement only needs multiple sources.
- category: Parameter = self.add_parameter( "category", label=f"Measurement {meas_nr} category", set_cmd=f"MEASurement{meas_nr}:CATegory {{}}", vals=self.categories, docstring="Set the category of a measurement.", )¶
Set the category of a measurement.
- main: Parameter = self.add_parameter( "main", label=f"Measurement {meas_nr} main", set_cmd=f"MEASurement{meas_nr}:MAIN {{}}", vals=self.meas_type, docstring="Set the main of a measurement.", )¶
Set the main of a measurement.
- statistics_enable: Parameter = self.add_parameter( "statistics_enable", label=f"Measurement {meas_nr} enable statistics", set_cmd=f"MEASurement{meas_nr}:STATistics:ENABle {{}}", vals=vals.Enum("ON", "OFF"), docstring="Switches the measurement on or off.", )¶
Switches the measurement on or off.
- clear: Parameter = self.add_parameter( "clear", label=f"Measurement {meas_nr} clear statistics", set_cmd=f"MEASurement{meas_nr}:CLEar", docstring="Clears/reset measurement.", )¶
Clears/reset measurement.
- event_count: Parameter = self.add_parameter( "event_count", label=f"Measurement {meas_nr} number of events", get_cmd=f"MEASurement{meas_nr}:RESult:EVTCount?", get_parser=int, docstring="Number of measurement results in the long-term measurement.", )¶
Number of measurement results in the long-term measurement.
- result_avg: Parameter = self.add_parameter( "result_avg", label=f"Measurement {meas_nr} averages", get_cmd=f"MEASurement{meas_nr}:RESult:AVG?", get_parser=float, docstring="Average of the long-term measurement results.", )¶
Average of the long-term measurement results.
- parameters: dict[str, ParameterBase] = {}¶
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: dict[str, Function] = {}¶
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: dict[str, InstrumentModule | ChannelTuple] = {}¶
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: dict[str, InstrumentModule] = {}¶
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- class qcodes.instrument_drivers.rohde_schwarz.RohdeSchwarzSGS100A(name: str, address: str, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
VisaInstrument
This is the QCoDeS driver for the Rohde & Schwarz SGS100A signal generator.
Status: beta-version.
Todo
Add all parameters that are in the manual
Add test suite
See if there can be a common driver for RS mw sources from which different models inherit
This driver will most likely work for multiple Rohde & Schwarz sources. it would be a good idea to group all similar RS drivers together in one module.
Tested working with
RS_SGS100A
This driver does not contain all commands available for the RS_SGS100A but only the ones most commonly used.
Attributes:
The default terminator to use if the terminator is not specified when creating the instrument.
Parameter frequency
Parameter phase
Parameter power
Parameter status
Parameter IQ_state
Parameter pulsemod_state
Parameter pulsemod_source
Parameter ref_osc_source
Parameter LO_source
Parameter ref_LO_out
Parameter ref_osc_output_freq
Parameter ref_osc_external_freq
Parameter IQ_impairments
Parameter I_offset
Parameter Q_offset
Parameter IQ_gain_imbalance
Parameter IQ_angle
Parameter trigger_connector_mode
Parameter pulsemod_delay
Parameter pulsemod_double_delay
Parameter pulsemod_double_width
Parameter pulsemod_mode
Parameter pulsemod_period
Parameter pulsemod_polarity
Parameter pulsemod_trig_ext_gate_polarity
Parameter pulsemod_trig_ext_impedance
Parameter pulsemod_trig_ext_slope
Parameter pulsemod_trig_mode
Parameter pulsemod_width
Methods:
- default_terminator: str | None = '\n'¶
The default terminator to use if the terminator is not specified when creating the instrument. None means use the default terminator from PyVisa.
- frequency: Parameter = self.add_parameter( name="frequency", label="Frequency", unit="Hz", get_cmd="SOUR:FREQ?", set_cmd="SOUR:FREQ {:.2f}", get_parser=float, vals=vals.Numbers(1e6, 20e9), )¶
Parameter frequency
- phase: Parameter = self.add_parameter( name="phase", label="Phase", unit="deg", get_cmd="SOUR:PHAS?", set_cmd="SOUR:PHAS {:.2f}", get_parser=float, vals=vals.Numbers(0, 360), )¶
Parameter phase
- power: Parameter = self.add_parameter( name="power", label="Power", unit="dBm", get_cmd="SOUR:POW?", set_cmd="SOUR:POW {:.2f}", get_parser=float, vals=vals.Numbers(-120, 25), )¶
Parameter power
- status: Parameter = self.add_parameter( "status", label="RF Output", get_cmd=":OUTP:STAT?", set_cmd=":OUTP:STAT {}", val_mapping=create_on_off_val_mapping(on_val="1", off_val="0"), )¶
Parameter status
- IQ_state: Parameter = self.add_parameter( "IQ_state", label="IQ Modulation", get_cmd=":IQ:STAT?", set_cmd=":IQ:STAT {}", val_mapping=create_on_off_val_mapping(on_val="1", off_val="0"), )¶
Parameter IQ_state
- pulsemod_state: Parameter = self.add_parameter( "pulsemod_state", label="Pulse Modulation", get_cmd=":SOUR:PULM:STAT?", set_cmd=":SOUR:PULM:STAT {}", val_mapping=create_on_off_val_mapping(on_val="1", off_val="0"), )¶
Parameter pulsemod_state
- pulsemod_source: Parameter = self.add_parameter( "pulsemod_source", label="Pulse Modulation Source", get_cmd="SOUR:PULM:SOUR?", set_cmd="SOUR:PULM:SOUR {}", vals=vals.Enum("INT", "EXT", "int", "ext"), )¶
Parameter pulsemod_source
- ref_osc_source: Parameter = self.add_parameter( "ref_osc_source", label="Reference Oscillator Source", get_cmd="SOUR:ROSC:SOUR?", set_cmd="SOUR:ROSC:SOUR {}", vals=vals.Enum("INT", "EXT", "int", "ext"), )¶
Parameter ref_osc_source
- LO_source: Parameter = self.add_parameter( "LO_source", label="Local Oscillator Source", get_cmd="SOUR:LOSC:SOUR?", set_cmd="SOUR:LOSC:SOUR {}", vals=vals.Enum("INT", "EXT", "int", "ext"), )¶
Parameter LO_source
- ref_LO_out: Parameter = self.add_parameter( "ref_LO_out", label="REF/LO Output", get_cmd="CONN:REFL:OUTP?", set_cmd="CONN:REFL:OUTP {}", vals=vals.Enum("REF", "LO", "OFF", "ref", "lo", "off", "Off"), )¶
Parameter ref_LO_out
- ref_osc_output_freq: Parameter = self.add_parameter( "ref_osc_output_freq", label="Reference Oscillator Output Frequency", get_cmd="SOUR:ROSC:OUTP:FREQ?", set_cmd="SOUR:ROSC:OUTP:FREQ {}", vals=vals.Enum("10MHz", "100MHz", "1000MHz"), )¶
Parameter ref_osc_output_freq
- ref_osc_external_freq: Parameter = self.add_parameter( "ref_osc_external_freq", label="Reference Oscillator External Frequency", get_cmd="SOUR:ROSC:EXT:FREQ?", set_cmd="SOUR:ROSC:EXT:FREQ {}", vals=vals.Enum("10MHz", "100MHz", "1000MHz"), )¶
Parameter ref_osc_external_freq
- IQ_impairments: Parameter = self.add_parameter( "IQ_impairments", label="IQ Impairments", get_cmd=":SOUR:IQ:IMP:STAT?", set_cmd=":SOUR:IQ:IMP:STAT {}", val_mapping=create_on_off_val_mapping(on_val="1", off_val="0"), )¶
Parameter IQ_impairments
- I_offset: Parameter = self.add_parameter( "I_offset", label="I Offset", get_cmd="SOUR:IQ:IMP:LEAK:I?", set_cmd="SOUR:IQ:IMP:LEAK:I {:.2f}", get_parser=float, vals=vals.Numbers(-10, 10), )¶
Parameter I_offset
- Q_offset: Parameter = self.add_parameter( "Q_offset", label="Q Offset", get_cmd="SOUR:IQ:IMP:LEAK:Q?", set_cmd="SOUR:IQ:IMP:LEAK:Q {:.2f}", get_parser=float, vals=vals.Numbers(-10, 10), )¶
Parameter Q_offset
- IQ_gain_imbalance: Parameter = self.add_parameter( "IQ_gain_imbalance", label="IQ Gain Imbalance", get_cmd="SOUR:IQ:IMP:IQR?", set_cmd="SOUR:IQ:IMP:IQR {:.2f}", get_parser=float, vals=vals.Numbers(-1, 1), )¶
Parameter IQ_gain_imbalance
- visa_handle: pyvisa.resources.MessageBasedResource = visa_handle¶
The VISA resource used by this instrument.
- parameters: dict[str, ParameterBase] = {}¶
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: dict[str, Function] = {}¶
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: dict[str, InstrumentModule | ChannelTuple] = {}¶
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: dict[str, InstrumentModule] = {}¶
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- IQ_angle: Parameter = self.add_parameter( "IQ_angle", label="IQ Angle Offset", get_cmd="SOUR:IQ:IMP:QUAD?", set_cmd="SOUR:IQ:IMP:QUAD {:.2f}", get_parser=float, vals=vals.Numbers(-8, 8), )¶
Parameter IQ_angle
- trigger_connector_mode: Parameter = self.add_parameter( "trigger_connector_mode", label="Trigger Connector Mode", get_cmd="CONN:TRIG:OMOD?", set_cmd="CONN:TRIG:OMOD {}", vals=vals.Enum( "SVAL", # SVALid - Signal valid "SNVAL", # SNValid - Signal not valid "PVO", # PVOut - Pulse video out (K22 Only) "PET", # PETrigger - Pulse mod ext trigger - PETrigger (K22 Only) "PEMS", # PEMSource - Pulse mode ext source (K22 Only) "sval", # same as SVAL "snval", # same as SNVAL "pvo", # same as PVO "pet", # same as PET "pems", # same as PEMS ), )¶
Parameter trigger_connector_mode
- pulsemod_delay: Parameter = self.add_parameter( "pulsemod_delay", label="Pulse delay", unit="s", get_cmd="SOUR:PULM:DEL?", set_cmd="SOUR:PULM:DEL {:g}", get_parser=float, vals=vals.Numbers(0, 100), )¶
Parameter pulsemod_delay
- pulsemod_double_delay: Parameter = self.add_parameter( "pulsemod_double_delay", label="Pulse double delay", unit="s", get_cmd="SOUR:PULM:DOUB:DEL?", set_cmd="SOUR:PULM:DOUB:DEL {:g}", get_parser=float, vals=vals.Numbers(40e-9, 100), )¶
Parameter pulsemod_double_delay
- pulsemod_double_width: Parameter = self.add_parameter( "pulsemod_double_width", label="Double pulse second width", unit="s", get_cmd="SOUR:PULM:DOUB:WIDT?", set_cmd="SOUR:PULM:DOUB:WIDT {:g}", get_parser=float, vals=vals.Numbers(20e-9, 100), )¶
Parameter pulsemod_double_width
- pulsemod_mode: Parameter = self.add_parameter( "pulsemod_mode", label="Pulse modulation mode", get_cmd="SOUR:PULM:MODE?", set_cmd="SOUR:PULM:MODE {}", vals=vals.Enum("SING", "DOUB", "sing", "doub", "single", "double"), )¶
Parameter pulsemod_mode
- pulsemod_period: Parameter = self.add_parameter( "pulsemod_period", label="Pulse mode period", unit="s", get_cmd="SOUR:PULM:PER?", set_cmd="SOUR:PULM:PER {:g}", get_parser=float, vals=vals.Numbers(100e-9, 100), )¶
Parameter pulsemod_period
- pulsemod_polarity: Parameter = self.add_parameter( "pulsemod_polarity", label="Pulse modulator signal polarity", get_cmd="SOUR:PULM:POL?", set_cmd="SOUR:PULM:POL {}", vals=vals.Enum("NORM", "INV", "norm", "inv", "normal", "inverted"), )¶
Parameter pulsemod_polarity
- pulsemod_trig_ext_gate_polarity: Parameter = self.add_parameter( "pulsemod_trig_ext_gate_polarity", label="Polarity of the Gate signal", get_cmd="SOUR:PULM:TRIG:EXT:GATE:POL?", set_cmd="SOUR:PULM:TRIG:EXT:GATE:POL {}", vals=vals.Enum("NORM", "INV", "norm", "inv", "normal", "inverted"), )¶
Parameter pulsemod_trig_ext_gate_polarity
- pulsemod_trig_ext_impedance: Parameter = self.add_parameter( "pulsemod_trig_ext_impedance", label="Impedance of the external pulse trigger", get_cmd="SOUR:PULM:TRIG:EXT:IMP?", set_cmd="SOUR:PULM:TRIG:EXT:IMP {}", vals=vals.Enum("G50", "G10K"), )¶
Parameter pulsemod_trig_ext_impedance
- pulsemod_trig_ext_slope: Parameter = self.add_parameter( "pulsemod_trig_ext_slope", label="external pulse trigger active slope", get_cmd="SOUR:PULM:TRIG:EXT:SLOP?", set_cmd="SOUR:PULM:TRIG:EXT:SLOP {}", vals=vals.Enum("NEG", "POS", "neg", "pos", "negative", "positive"), )¶
Parameter pulsemod_trig_ext_slope
- pulsemod_trig_mode: Parameter = self.add_parameter( "pulsemod_trig_mode", label="external pulse trigger active slope", get_cmd="SOUR:PULM:TRIG:MODE?", set_cmd="SOUR:PULM:TRIG:MODE {}", vals=vals.Enum( "AUTO", "EXT", "EGAT", "auto", "ext", "egat", "external", "egate" ), )¶
Parameter pulsemod_trig_mode
- class qcodes.instrument_drivers.rohde_schwarz.RohdeSchwarzZNB20(name: str, address: str, init_s_params: bool = True, reset_channels: bool = True, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
RohdeSchwarzZNBBase
QCoDeS driver for Rohde & Schwarz ZNB20
- class qcodes.instrument_drivers.rohde_schwarz.RohdeSchwarzZNB8(name: str, address: str, init_s_params: bool = True, reset_channels: bool = True, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
RohdeSchwarzZNBBase
QCoDeS driver for Rohde & Schwarz ZNB8
- class qcodes.instrument_drivers.rohde_schwarz.RohdeSchwarzZNBBase(name: str, address: str, init_s_params: bool = True, reset_channels: bool = True, **kwargs: Unpack[VisaInstrumentKWArgs])[source]¶
Bases:
VisaInstrument
Base class for QCoDeS driver for the Rohde & Schwarz ZNB8 and ZNB20 virtual network analyser. It can probably be extended to ZNB4 and 40 without too much work. This class should not be instantiated directly the RohdeSchwarzZNB8 and RohdeSchwarzZNB20 should be used instead.
Requires FrequencySweep parameter for taking a trace
- Parameters:
name – instrument name
address – Address of instrument probably in format ‘TCPIP0::192.168.15.100::inst0::INSTR’
init_s_params – Automatically setup channels for all S parameters on the VNA.
reset_channels – If True any channels defined on the VNA at the time of initialization are reset and removed.
**kwargs – passed to base class
Todo
check initialisation settings and test functions
Classes:
alias of
RohdeSchwarzZNBChannel
Attributes:
Parameter num_ports
Parameter rf_power
Reference oscillator source
Frequency of the external reference clock signal at REF IN
If an external reference signal or an internal high precision clock (option B4) is used, the local oscillator is phase locked to a reference signal.
Methods:
display_grid
(rows, cols)Display a grid of channels rows by columns.
add_channel
(channel_name, **kwargs)Remove all channels from the instrument and channel list and unlock the channel list.
- visa_handle: pyvisa.resources.MessageBasedResource = visa_handle¶
The VISA resource used by this instrument.
- parameters: dict[str, ParameterBase] = {}¶
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: dict[str, Function] = {}¶
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: dict[str, InstrumentModule | ChannelTuple] = {}¶
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: dict[str, InstrumentModule] = {}¶
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- CHANNEL_CLASS¶
alias of
RohdeSchwarzZNBChannel
- num_ports: Parameter = self.add_parameter( name="num_ports", get_cmd="INST:PORT:COUN?", get_parser=int )¶
Parameter num_ports
- rf_power: Parameter = self.add_parameter( name="rf_power", get_cmd="OUTP1?", set_cmd="OUTP1 {}", val_mapping={True: "1\n", False: "0\n"}, )¶
Parameter rf_power
- ref_osc_source: Parameter = self.add_parameter( name="ref_osc_source", label="Reference oscillator source", get_cmd="ROSC:SOUR?", set_cmd="ROSC:SOUR {}", # strip newline get_parser=lambda s: s.rstrip(), vals=vals.Enum("INT", "EXT", "int", "ext", "internal", "external"), )¶
Reference oscillator source
- ref_osc_external_freq: Parameter = self.add_parameter( name="ref_osc_external_freq", label="Reference oscillator frequency", docstring="Frequency of the external reference clock signal at REF IN", get_cmd="ROSC:EXT:FREQ?", set_cmd="ROSC:EXT:FREQ {}Hz", # The response contains the unit (Hz), so we have to strip it get_parser=lambda f: float(f.strip("Hz")), unit="Hz", # Data sheet: 1 MHz to 20 MHz, in steps of 1 MHz vals=vals.Enum(*np.linspace(1e6, 20e6, 20)), )¶
Frequency of the external reference clock signal at REF IN
- ref_osc_PLL_locked: Parameter = self.add_parameter( name="ref_osc_PLL_locked", label="Reference frequency PLL lock", get_cmd=self._get_PLL_locked, docstring="If an external reference signal or an internal high " "precision clock (option B4) is used, the local oscillator is " "phase locked to a reference signal. This parameter will be " "False if the phase locked loop (PLL) fails. " "\n" "For external reference: check frequency and level of the " "supplied reference signal.", )¶
If an external reference signal or an internal high precision clock (option B4) is used, the local oscillator is phase locked to a reference signal. This parameter will be False if the phase locked loop (PLL) fails.
For external reference: check frequency and level of the supplied reference signal.
- class qcodes.instrument_drivers.rohde_schwarz.RohdeSchwarzZNBChannel(parent: RohdeSchwarzZNBBase, name: str, channel: int, vna_parameter: str | None = None, existing_trace_to_bind_to: str | None = None, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentChannel
- Parameters:
parent – Instrument that this channel is bound to.
name – Name to use for this channel.
channel – channel on the VNA to use
vna_parameter – Name of parameter on the vna that this should measure such as S12. If left empty this will fall back to name.
existing_trace_to_bind_to – Name of an existing trace on the VNA. If supplied try to bind to an existing trace with this name rather than creating a new trace.
**kwargs – Forwarded to base class.
Attributes:
Parameter vna_parameter
Parameter power
Measurement bandwidth of the IF filter.
Parameter avg
Parameter start
Parameter stop
Parameter center
Parameter span
Parameter npts
Parameter status
Parameter format
Parameter trace_mag_phase
Parameter trace_db_phase
Parameter trace
Parameter electrical_delay
Parameter sweep_time
The sweep_type parameter is used to set the type of measurement sweeps.
Parameter for setting frequency and querying for it when VNA sweep type is set to CW_Point mode.
Parameter that enables a few commands which are called before each get in continuous wave mode checking whether the vna is setup correctly.
Parameter trace_fixed_frequency
Parameter point_fixed_frequency
Parameter point_fixed_frequency_mag_phase
Parameter averaging_enabled
When enabled, the (minimum) sweep time is calculated internally using the other channel settings and zero delay
Methods:
Updates start, stop and npts of all trace parameters so that the x-coordinates are updated for the sweep.
Updates the bandwidth and npts of all fixed frequency (CW) traces.
This method sets the VNA to CW mode.
Setup the instrument into linear sweep mode.
- vna_parameter: Parameter = self.add_parameter( name="vna_parameter", label="VNA parameter", get_cmd=f"CALC{self._instrument_channel}:PAR:MEAS? '{self._tracename}'", get_parser=self._strip, )¶
Parameter vna_parameter
- power: Parameter = self.add_parameter( name="power", label="Power", unit="dBm", get_cmd=f"SOUR{n}:POW?", set_cmd=f"SOUR{n}:POW {{:.4f}}", get_parser=float, vals=vals.Numbers(self._min_source_power, 25), )¶
Parameter power
- bandwidth: Parameter = self.add_parameter( name="bandwidth", label="Bandwidth", unit="Hz", get_cmd=f"SENS{n}:BAND?", set_cmd=self._set_bandwidth, get_parser=int, vals=vals.Enum( *np.append(10**6, np.kron([1, 1.5, 2, 3, 5, 7], 10 ** np.arange(6))) ), docstring="Measurement bandwidth of the IF filter. " "The inverse of this sets the integration " "time per point. " "There is an 'increased bandwidth option' " "(p. 4 of manual) that does not get taken " "into account here.", )¶
Measurement bandwidth of the IF filter. The inverse of this sets the integration time per point. There is an ‘increased bandwidth option’ (p. 4 of manual) that does not get taken into account here.
- avg: Parameter = self.add_parameter( name="avg", label="Averages", unit="", get_cmd=f"SENS{n}:AVER:COUN?", set_cmd=f"SENS{n}:AVER:COUN {{:.4f}}", get_parser=int, vals=vals.Ints(1, 5000), )¶
Parameter avg
- start: Parameter = self.add_parameter( name="start", get_cmd=f"SENS{n}:FREQ:START?", set_cmd=self._set_start, get_parser=float, vals=vals.Numbers(self._parent._min_freq, self._parent._max_freq - 10), )¶
Parameter start
- stop: Parameter = self.add_parameter( name="stop", get_cmd=f"SENS{n}:FREQ:STOP?", set_cmd=self._set_stop, get_parser=float, vals=vals.Numbers(self._parent._min_freq + 1, self._parent._max_freq), )¶
Parameter stop
- center: Parameter = self.add_parameter( name="center", get_cmd=f"SENS{n}:FREQ:CENT?", set_cmd=self._set_center, get_parser=float, vals=vals.Numbers( self._parent._min_freq + 0.5, self._parent._max_freq - 10 ), )¶
Parameter center
- span: Parameter = self.add_parameter( name="span", get_cmd=f"SENS{n}:FREQ:SPAN?", set_cmd=self._set_span, get_parser=float, vals=vals.Numbers(1, self._parent._max_freq - self._parent._min_freq), )¶
Parameter span
- npts: Parameter = self.add_parameter( name="npts", get_cmd=f"SENS{n}:SWE:POIN?", set_cmd=self._set_npts, get_parser=int, )¶
Parameter npts
- status: Parameter = self.add_parameter( name="status", get_cmd=f"CONF:CHAN{n}:MEAS?", set_cmd=f"CONF:CHAN{n}:MEAS {{}}", get_parser=int, )¶
Parameter status
- format: Parameter = self.add_parameter( name="format", get_cmd=partial(self._get_format, tracename=self._tracename), set_cmd=self._set_format, val_mapping={ "dB": "MLOG\n", "Linear Magnitude": "MLIN\n", "Phase": "PHAS\n", "Unwr Phase": "UPH\n", "Polar": "POL\n", "Smith": "SMIT\n", "Inverse Smith": "ISM\n", "SWR": "SWR\n", "Real": "REAL\n", "Imaginary": "IMAG\n", "Delay": "GDEL\n", "Complex": "COMP\n", }, )¶
Parameter format
- trace_mag_phase: FrequencySweepMagPhase = self.add_parameter( name="trace_mag_phase", start=self.start(), stop=self.stop(), npts=self.npts(), channel=n, parameter_class=FrequencySweepMagPhase, )¶
Parameter trace_mag_phase
- trace_db_phase: FrequencySweepDBPhase = self.add_parameter( name="trace_db_phase", start=self.start(), stop=self.stop(), npts=self.npts(), channel=n, parameter_class=FrequencySweepDBPhase, )¶
Parameter trace_db_phase
- trace: FrequencySweep = self.add_parameter( name="trace", start=self.start(), stop=self.stop(), npts=self.npts(), channel=n, parameter_class=FrequencySweep, )¶
Parameter trace
- electrical_delay: Parameter = self.add_parameter( name="electrical_delay", label="Electrical delay", get_cmd=f"SENS{n}:CORR:EDEL2:TIME?", set_cmd=f"SENS{n}:CORR:EDEL2:TIME {{}}", get_parser=float, unit="s", )¶
Parameter electrical_delay
- sweep_time: Parameter = self.add_parameter( name="sweep_time", label="Sweep time", get_cmd=f"SENS{n}:SWE:TIME?", get_parser=float, unit="s", )¶
Parameter sweep_time
- sweep_type: Parameter = self.add_parameter( name="sweep_type", get_cmd=f"SENS{n}:SWE:TYPE?", set_cmd=self._set_sweep_type, val_mapping={ "Linear": "LIN\n", "Logarithmic": "LOG\n", "Power": "POW\n", "CW_Time": "CW\n", "CW_Point": "POIN\n", "Segmented": "SEGM\n", }, docstring="The sweep_type parameter is used to set " "the type of measurement sweeps. It " "allows switching the default linear " "VNA sweep type to other types. Note that " "at the moment only the linear and " "CW_Point modes have supporting " "measurement parameters.", )¶
The sweep_type parameter is used to set the type of measurement sweeps. It allows switching the default linear VNA sweep type to other types. Note that at the moment only the linear and CW_Point modes have supporting measurement parameters.
- cw_frequency: Parameter = self.add_parameter( name="cw_frequency", get_cmd=f"SENS{n}:FREQ:CW?", set_cmd=self._set_cw_frequency, get_parser=float, vals=vals.Numbers( self._parent._min_freq + 0.5, self._parent._max_freq - 10 ), docstring="Parameter for setting frequency and " "querying for it when VNA sweep type is " "set to CW_Point mode.", )¶
Parameter for setting frequency and querying for it when VNA sweep type is set to CW_Point mode.
- cw_check_sweep_first: ManualParameter = self.add_parameter( "cw_check_sweep_first", parameter_class=ManualParameter, initial_value=True, vals=vals.Bool(), docstring="Parameter that enables a few commands " "which are called before each get in " "continuous wave mode checking whether " "the vna is setup correctly. Is recommended " "to be turned, but can be turned off if " "one wants to minimize overhead in fast " "measurements. ", )¶
Parameter that enables a few commands which are called before each get in continuous wave mode checking whether the vna is setup correctly. Is recommended to be turned, but can be turned off if one wants to minimize overhead in fast measurements.
- trace_fixed_frequency: FixedFrequencyTraceIQ = self.add_parameter( name="trace_fixed_frequency", npts=self.npts(), bandwidth=self.bandwidth(), parameter_class=FixedFrequencyTraceIQ, )¶
Parameter trace_fixed_frequency
- point_fixed_frequency: FixedFrequencyPointIQ = self.add_parameter( name="point_fixed_frequency", parameter_class=FixedFrequencyPointIQ )¶
Parameter point_fixed_frequency
- point_fixed_frequency_mag_phase: FixedFrequencyPointMagPhase = ( self.add_parameter( name="point_fixed_frequency_mag_phase", parameter_class=FixedFrequencyPointMagPhase, ) )¶
Parameter point_fixed_frequency_mag_phase
- averaging_enabled: Parameter = self.add_parameter( name="averaging_enabled", initial_value=False, get_cmd=None, set_cmd=self._enable_averaging, vals=vals.Bool(), val_mapping=create_on_off_val_mapping(on_val="ON", off_val="OFF"), )¶
Parameter averaging_enabled
- auto_sweep_time_enabled: Parameter = self.add_parameter( name="auto_sweep_time_enabled", initial_value=False, get_cmd=None, set_cmd=self._enable_auto_sweep_time, vals=vals.Bool(), val_mapping=create_on_off_val_mapping(on_val="ON", off_val="OFF"), docstring="When enabled, the (minimum) sweep time is " "calculated internally using the other channel settings " "and zero delay", )¶
When enabled, the (minimum) sweep time is calculated internally using the other channel settings and zero delay
- parameters: dict[str, ParameterBase] = {}¶
All the parameters supported by this instrument. Usually populated via
add_parameter()
.
- functions: dict[str, Function] = {}¶
All the functions supported by this instrument. Usually populated via
add_function()
.
- submodules: dict[str, InstrumentModule | ChannelTuple] = {}¶
All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via
add_submodule()
.
- instrument_modules: dict[str, InstrumentModule] = {}¶
All the
InstrumentModule
of this instrument Usually populated viaadd_submodule()
.
- log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)¶
- update_lin_traces() None [source]¶
Updates start, stop and npts of all trace parameters so that the x-coordinates are updated for the sweep.
- update_cw_traces() None [source]¶
Updates the bandwidth and npts of all fixed frequency (CW) traces.
- setup_cw_sweep() None [source]¶
This method sets the VNA to CW mode. CW Mode sweeps are performed at fixed frequency and allow to perform measurements versus time instead of versus frequency. See (https://www.rohde-schwarz.com/webhelp/ZNB_ZNBT_HTML_UserManual_en /ZNB_ZNBT_HTML_UserManual_en.htm) under GUI reference -> sweep softtool -> sweep type tab -> CW mode