qcodes_contrib_drivers.drivers.Rigol package¶
Submodules¶
qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900 module¶
QCoDeS driver for the Rigol DHO900 series oscilloscopes.
Models: DHO914, DHO914S, DHO924, DHO924S (four analog channels; the “S” models have a built-in 25 MHz function generator). The DHO800 series shares the programming guide; the driver connects to it as well, but has only been run on a DHO914S.
Programming reference: RIGOL DHO800/DHO900 Programming Guide (August 2023). Tested on a DHO914S, firmware 00.01.04, over USBTMC (NI-VISA).
Where the instrument deviates from the guide, the driver follows the instrument:
*OPC?returns 0 while an acquisition is in progress instead of waiting, so the end of a single acquisition is detected by polling:TRIGger:STATus?for STOP (RigolDHO900.digitize()).The channels share the ADC, interleaved, but the preamble gives them the same time axis: with four channels on, CH1 lagged CH2 by 0.8 ns (one sample period at 1.25 GSa/s) more than with two.
RigolDHO900FrequencyResponse. calibrate_through()measures and corrects the difference between two channels.At some vertical scales between the steps of the 1-2-5 sequence (0.301, 0.341, 0.461, 0.505 V/div with a 10:1 probe) the gain differs from the preamble’s conversion by up to 0.11 dB; the autoscale of frequency_response uses the steps.
A
:SINGlewhile the acquisition runs occasionally stops it without an acquisition (an empty memory);RigolDHO900.digitize()stops it first.:RUNtakes effect 0.1 s to 0.4 s after it and occasionally not at all; a pending:RUNturns a following:SINGleinto continuous acquisition.RigolDHO900.run()returns once the acquisition runs and sends:RUNagain otherwise.Out-of-range values are clipped without an error (a vertical scale of 1000 V/div becomes 100 V/div, a generator frequency of 30 MHz becomes 25 MHz). The driver refuses them against the limits of the guide or, where they differ, of the instrument, which depend on other settings (vertical scale, waveform function), and reads back the settings whose limits depend on the instrument state (vertical offset and bias, memory depth, horizontal scale and offset, zoom, pulse widths, the Bode plot’s frequencies): a value the instrument clipped stays set, is logged as a warning and is the value cached. Delay calibration and measurement thresholds, whose out-of-range values the instrument ignores rather than clips, raise
ValueErrornaming the value that remains.Setting the generator above 10 MHz lowers an amplitude above 5 V to 5 V without an error; the driver refuses such a frequency.
A query the instrument rejects receives no response at all, so the client waits for the full VISA timeout. The driver avoids such queries (the DVM reading while the DVM is off, the long form
:SOURce:MOD:AM:INTernal:FREQuency?).A device clear (USBTMC) after such a query leaves the USB interface unable to respond (VI_ERROR_INP_PROT_VIOL, then timeouts); repeated, the instrument drops off the bus until it is power-cycled, while its display keeps working. The driver therefore connects without a device clear (
device_clear=False).The modulation type is ignored without an error while the modulation is off, and the modulation settings (depth, deviation, modulating frequency and waveform) unless the modulation is on and of their type; the driver refuses a change otherwise. The modulating waveforms are accepted only as SIN, SQU, TRI, UPRAMP, DNRAMP and NOISE (the guide’s SINusoid, UPR, NOIS etc. are rejected, -222), and a query returns these words, not the guide’s UPR, DNR and NOIS.
The counter statistics (
:COUNter:TOTalize:ENABle) are rejected (-200) while the counter is off.The measurement thresholds (
:MEASure:SETup:MAXetc.) misread a number in exponent form; the driver sends plain numbers. Duty cycles, overshoot and preshoot are ratios, not percent.:WAVeform:FORMat ASCiioccasionally omits the comma between two values of a long record; waveforms are therefore read in WORD format only.Reading the memory (
:WAVeform:MODE RAW) while the acquisition runs returns an empty block without an error; the driver refuses the read instead.:SOURce:FUNCtion:SQUare:DUYT, as spelled in the guide, is a command error; the driver uses:SOURce:FUNCtion:SQUare:DUTY. Its range is 1 % to 99 %.:CHANnel<n>:POSition(“bias voltage”) adds its value to the waveform data and to the measurements; it is not a display position (RigolDHO900Channel.bias).Measurements that cannot be made return 9.9E37; the driver returns NaN. An item is computed only after the query that adds it, within about 0.35 s, which
RigolDHO900.measure()waits for.:MEASure:ITEM?of a channel that is off turns the channel on; the driver returns NaN for it without a query. On a stopped acquisition, the instrument computes only some of the items added (RigolDHO900.measure()).The frequency counter counts only while the acquisition runs (reading 0 while stopped); the DVM measures in either state.
A channel that is off ignores changes of its scale and offset (other settings are taken); the driver refuses them. Its waveform preamble reports 0 points.
The delay calibration (
:CHANnel<n>:TCALibrate) is rejected at time bases slower than 10 us/div, also for the unchanged value, which the driver does not write.The vertical offset limits change at 58 mV/div, 250 mV/div and 2.55 V/div (at a probe ratio of 1), not at the guide’s 65 mV, 260 mV and 2.65 V/div.
The preamble’s point count is that between
:WAVeform:STARtand:STOP, not the record length; in the normal mode, and in the maximum mode while running, a start or stop beyond 1000 is rejected (-200) rather than clipped.Binary blocks read with the termination character on (a read ends at each 0x0A byte of the data) intermittently stalled for a whole VISA timeout; the driver reads them with it off (
RigolDHO900.query_block()).The Bode plot (:BODeplot) has no command that reads its results.
:BODeplot:ENABle 0turns the generator output off, also when the plot is off already; the driver does not write it then. The sources read as CHAN1 (the guide: CHANnel1); the same channel as input and output is rejected (-222), and writing a source turns that channel on, even unchanged (the driver writes only a change). A sweep leaves the input and output channels AC-coupled. Start, stop, points and amplitude out of range are clipped without an error (RigolDHO900Bode).
Besides the instrument’s Bode plot (bode), the driver measures gain and phase
from the waveforms (frequency_response, after https://github.com/wjakob/rigol):
a least-squares sine fit at the generator frequency to the input and output traces
of one acquisition, with the vertical scales adjusted to each signal. On a DHO914S
its floor with an open output channel was -75 dB to -119 dB, against -51 dB to
-65 dB of the instrument’s own plot (both 2 Vpp, 100 Hz to 25 MHz).
- exception qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.EmptyReadError[source]¶
Bases:
RuntimeErrorThe instrument returned an empty block for a memory read.
The acquisition was not stopped, or a single acquisition did not take place.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900(*args: Any, **kwargs: Any)[source]¶
Bases:
VisaInstrumentQCoDeS driver for the Rigol DHO900 (and DHO800) series oscilloscopes.
The driver writes nothing at connect. A trace sets the waveform source, format and the start and stop points before it reads.
- Parameters:
name – Name of the instrument.
address – VISA address, e.g.
USB0::0x1AB1::0x044C::<serial>::INSTR.**kwargs – Passed on to VisaInstrument.
- autoset() None[source]¶
Adjust scales, time base and trigger to the input signals (AUTO key).
Changes most settings.
- digitize(timeout: float = 10.0, poll_interval: float = 0.02) None[source]¶
Acquire one waveform and wait until the acquisition has stopped.
The channels’ traces and the measurements then come from the same acquisition.
- Parameters:
timeout – Longest wait for the trigger in s.
poll_interval – Interval in s between the queries of the trigger status.
- Raises:
TimeoutError – If no trigger arrives within timeout; the instrument then remains armed (force_trigger() completes it).
- load_setup(setup: bytes) None[source]¶
Load a setup read by save_setup.
- Parameters:
setup – The binary block that save_setup() returned.
- measure(item: str, source: str = 'ch1', source2: str | None = None, wait: float | None = None) float[source]¶
One automatic measurement.
The instrument adds the item to the measurements on the display and computes it afterwards: while the result is invalid, it is queried again for up to wait seconds. On a stopped acquisition the instrument computes only some of the items added (about 14 added one at a time, none of many added in quick succession); an item still invalid there is queried once more after the display’s items are removed (:MEASure:CLEar).
- Parameters:
item – A key of MEASUREMENT_ITEMS, e.g. “vpp”, “frequency”, “phase_rr”.
source – “ch1”, …, “math1”, …
source2 – The second source of delays and phases.
wait – Longest wait in s for a valid result; by default measurement_wait.
- Returns:
The result; NaN when it cannot be measured, and for a channel that is off (which the instrument would turn on to measure it).
- Raises:
ValueError – If the item or a source is unknown, or a delay or phase has no second source.
- measure_statistics(item: str, source: str = 'ch1', source2: str | None = None) dict[str, float][source]¶
The statistics of a measurement, switching its statistics on first.
- Parameters:
item – A key of MEASUREMENT_ITEMS.
source – “ch1”, …, “math1”, …
source2 – The second source of delays and phases.
- Returns:
current, average, minimum, maximum, deviation and count. NaN where there is no value yet, and for a channel that is off.
- Return type:
By key
- Raises:
ValueError – As measure().
- query_block(command: str, datatype: str) NDArray[Any][source]¶
Query a definite-length binary block (#N…) and return its values.
Read with the termination character off, to the USBTMC end of message: with it on, a read ends at each 0x0A byte of the data, and full-memory reads then intermittently stalled for the whole VISA timeout.
- Parameters:
command – The query.
datatype – Struct format character of the values, e.g. “H”.
- Returns:
The values of the block.
- run() None[source]¶
Start acquiring continuously; returns once the acquisition runs.
The instrument applies :RUN 0.1 s to 0.4 s after it, and occasionally not at all. A :RUN still pending when a :SINGle arrives turns the single acquisition into a continuous one. run() therefore polls the trigger status until it leaves STOP, sends :RUN again after run_confirm_time, and raises TimeoutError after three attempts.
- save_setup() bytes[source]¶
The instrument setup as a binary block (:SYSTem:SETup?), for load_setup.
- screenshot(image_format: str = 'png') bytes[source]¶
The display as an image file.
- Parameters:
image_format – “png”, “bmp” or “jpg”.
- Returns:
The content of the image file.
- Raises:
ValueError – If the format is not one of these.
- stop() None[source]¶
Stop acquiring; returns once the acquisition has stopped.
The memory keeps the last acquisition.
- Raises:
TimeoutError – If the trigger status has not read STOP within run_confirm_time after the second :STOP.
- acquisition: RigolDHO900Acquisition = self.add_submodule( "acquisition", RigolDHO900Acquisition(self, "acquisition") )¶
Acquisition settings.
- arming_time = 1.0¶
SINGle within which a STOP without a preceding arming is taken as the instrument not yet armed, not as an acquisition that completed before the first poll: after a reconfiguration (run, time base, memory depth) the status read STOP for up to 0.44 s before the instrument armed
- Type:
s after
- awg: RigolDHO900AWG | None = None¶
The function generator; None on models without one.
- bode: RigolDHO900Bode | None = None¶
The instrument’s own Bode plot; None on models without a generator.
- channel_settling = 1.0¶
s after a channel was turned on or off before digitize() arms an acquisition
- channels = self.add_submodule("channels", channels.to_channel_tuple())¶
The analog channels, also as ch1, ch2, …
- counter: RigolDHO900Counter = self.add_submodule( "counter", RigolDHO900Counter(self, "counter") )¶
The frequency counter.
- 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.
- 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.
- dvm: RigolDHO900DVM = self.add_submodule( "dvm", RigolDHO900DVM(self, "dvm") )¶
The digital voltmeter.
- frequency_response: RigolDHO900FrequencyResponse | None = None¶
Gain and phase measured from the waveforms; None on models without a generator.
- measurement: RigolDHO900Measurement = self.add_submodule( "measurement", RigolDHO900Measurement(self, "measurement") )¶
Measurement settings.
- measurement_wait = 0.5¶
an item queried for the first time, or right after an acquisition, was computed within 0.05 s to 0.35 s
- Type:
seconds measure() queries again while a measurement is invalid
- run_confirm_time = 1.0¶
RUN within which the trigger status must leave STOP before run() sends :RUN again; 0 turns the check off
- Type:
s after
- timebase: RigolDHO900Timebase = self.add_submodule( "timebase", RigolDHO900Timebase(self, "timebase") )¶
The horizontal system.
- trigger: RigolDHO900Trigger = self.add_submodule( "trigger", RigolDHO900Trigger(self, "trigger") )¶
Trigger settings and status.
- waveform: RigolDHO900Waveform = self.add_submodule( "waveform", RigolDHO900Waveform(self, "waveform") )¶
Waveform readout.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900AWG(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]The built-in function generator of the DHO914S and DHO924S (GI output).
Amplitudes and offsets are those into a high impedance load: on a DHO914S an amplitude of 2 V gave 1.99 Vpp at a 1 MOhm input. Arbitrary waveforms cannot be loaded through SCPI.
- FUNCTIONS: ClassVar[dict[str, str]] = {'arb': 'ARB', 'dc': 'DC', 'noise': 'NOIS', 'ramp': 'RAMP', 'sine': 'SIN', 'square': 'SQU'}¶
- MODULATION_FUNCTIONS: ClassVar[dict[str, str]] = {'down_ramp': 'DNRAMP', 'noise': 'NOISE', 'sine': 'SIN', 'square': 'SQU', 'triangle': 'TRI', 'up_ramp': 'UPRAMP'}¶
the long forms SINusoid, SQUare and TRIangle and the short forms UPR, DNR and NOIS of the guide are rejected (-222), and a query returns UPRAMP, DNRAMP and NOISE
- Type:
the keywords as the instrument accepts and returns them
- am_depth: Parameter = self.add_parameter( "am_depth", label="AM depth", unit="%", get_cmd=":SOURce:MOD:AM:DEPTh?", set_cmd=self._modulation_setter("AM", ":SOURce:MOD:AM:DEPTh", "am_depth"), get_parser=float, vals=Numbers(0, 120), )¶
Amplitude modulation depth. Can be changed only while the modulation is on with type am.
- amplitude: Parameter = self.add_parameter( "amplitude", label="Amplitude", unit="Vpp", get_cmd=":SOURce:VOLTage:AMPLitude?", set_cmd=self._set_amplitude, get_parser=float, vals=Numbers(AWG_MIN_AMPLITUDE, AWG_MAX_AMPLITUDE[0][1]), )¶
2 mV to 10 V up to 10 MHz, to 5 V above, and at most twice the margin the offset leaves.
- Type:
Peak-to-peak amplitude into a high impedance
- fm_deviation: Parameter = self.add_parameter( "fm_deviation", label="FM deviation", unit="Hz", get_cmd=":SOURce:MOD:FM:DEViation?", set_cmd=self._modulation_setter( "FM", ":SOURce:MOD:FM:DEViation", "fm_deviation" ), get_parser=float, vals=Numbers(2e-3, 25e6), )¶
Peak frequency deviation, up to the carrier frequency. Can be changed only while the modulation is on with type fm.
- frequency: Parameter = self.add_parameter( "frequency", label="Frequency", unit="Hz", get_cmd=":SOURce:FREQuency?", set_cmd=self._set_frequency, get_parser=float, vals=Numbers(AWG_MIN_FREQUENCY, max(AWG_MAX_FREQUENCY.values())), )¶
2 mHz to 25 MHz (sine), 15 MHz (square), 150 kHz (ramp) or 10 MHz (arb). Above 10 MHz the amplitude is limited to 5 V: a frequency above 10 MHz at a higher amplitude is refused, since the instrument would lower the amplitude.
- Type:
Frequency
- function: Parameter = self.add_parameter( "function", label="Waveform", get_cmd=":SOURce:FUNCtion?", set_cmd=self._set_function, val_mapping=self.FUNCTIONS, )¶
The waveform. A function whose frequency limit is below the current frequency is refused: lower the frequency first.
- modulation: Parameter = self.add_parameter( "modulation", label="Modulation", get_cmd=":SOURce:MOD:STATe?", set_cmd=":SOURce:MOD:STATe {}", val_mapping=_ON_OFF, )¶
Whether the output is modulated.
- modulation_type: Parameter = self.add_parameter( "modulation_type", label="Modulation type", get_cmd=":SOURce:MOD:TYPe?", set_cmd=self._set_modulation_type, val_mapping={"am": "AM", "fm": "FM", "pm": "PM"}, )¶
Amplitude, frequency or phase modulation by an internal waveform. Can be changed only while the modulation is on (the instrument ignores it otherwise).
- offset: Parameter = self.add_parameter( "offset", label="Offset", unit="V", get_cmd=":SOURce:VOLTage:OFFSet?", set_cmd=self._set_offset, get_parser=float, vals=Numbers(-5, 5), )¶
within +-(maximum amplitude - amplitude) / 2.
- Type:
DC offset
- output: Parameter = self.add_parameter( "output", label="Generator output", get_cmd=":SOURce:OUTPut:STATe?", set_cmd=":SOURce:OUTPut:STATe {}", val_mapping=_ON_OFF, )¶
Whether the generator output is on.
- phase: Parameter = self.add_parameter( "phase", label="Start phase", unit="deg", get_cmd=":SOURce:PHASe?", set_cmd=":SOURce:PHASe {:.6e}", get_parser=float, vals=Numbers(0, 360), )¶
Start phase of the waveform.
- pm_deviation: Parameter = self.add_parameter( "pm_deviation", label="PM deviation", unit="deg", get_cmd=":SOURce:MOD:PM:DEViation?", set_cmd=self._modulation_setter( "PM", ":SOURce:MOD:PM:DEViation", "pm_deviation" ), get_parser=float, vals=Numbers(0, 360), )¶
Peak phase deviation. Can be changed only while the modulation is on with type pm.
- ramp_symmetry: Parameter = self.add_parameter( "ramp_symmetry", label="Ramp symmetry", unit="%", get_cmd=":SOURce:FUNCtion:RAMP:SYMMetry?", set_cmd=":SOURce:FUNCtion:RAMP:SYMMetry {:.6e}", get_parser=float, vals=Numbers(0, 100), )¶
Share of the period the ramp rises.
- square_duty_cycle: Parameter = self.add_parameter( "square_duty_cycle", label="Square duty cycle", unit="%", get_cmd=":SOURce:FUNCtion:SQUare:DUTY?", set_cmd=":SOURce:FUNCtion:SQUare:DUTY {:.6e}", get_parser=float, vals=Numbers(1, 99), )¶
Share of the period the square wave is high, 1 % to 99 % (the guide’s 0 to 100 % is clipped by the instrument).
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900Acquisition(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]Acquisition mode, averaging, memory depth and sample rate.
- averages: Parameter = self.add_parameter( "averages", label="Averages", get_cmd=":ACQuire:AVERages?", set_cmd=":ACQuire:AVERages {}", get_parser=int, vals=Enum(*(2**n for n in range(1, 17))), )¶
a power of 2 from 2 to 65536.
- Type:
Number of averages in the average mode
- memory_depth: Parameter = self.add_parameter( "memory_depth", parameter_class=_ReadBackParameter, label="Memory depth", unit="pts", get_cmd=":ACQuire:MDEPth?", set_cmd=self._set_memory_depth, get_parser=float, vals=MultiType(Enum("auto"), Enum(*MEMORY_DEPTHS)), )¶
“auto” or 1e3, 1e4, 1e5, 1e6, 1e7, 2.5e7, 5e7. The largest depth depends on the number of channels on (DHO900: 50M for one, 25M for two, 10M for three or four); the trigger source counts as a channel on, also while it is off. A read returns the depth in use, also in auto. A depth the instrument does not accept is replaced by the one it sets, which is logged as a warning and cached.
- Type:
Points per acquisition
- sample_rate: Parameter = self.add_parameter( "sample_rate", label="Sample rate", unit="Sa/s", get_cmd=":ACQuire:SRATe?", get_parser=float, )¶
The current sample rate.
- type: Parameter = self.add_parameter( "type", label="Acquisition mode", get_cmd=":ACQuire:TYPE?", set_cmd=":ACQuire:TYPE {}", val_mapping={ "normal": "NORM", "peak": "PEAK", "average": "AVER", "ultra": "ULTR", }, )¶
normal, peak detection, average or UltraAcquire (segmented).
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900Bode(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]The instrument’s own Bode plot (:BODeplot, DHO914S and DHO924S).
It sweeps the generator and draws gain and phase on the display.
The programming guide has no command that reads the results; they are available only on the display (screenshot()). frequency_response measures gain and phase from the waveforms instead and returns them.
While it runs, the instrument sets the input and output channels to AC coupling and leaves them so, and changes their vertical scales, the time base and the memory depth; the generator output is on during the sweep and off at its end. Input and output must be different channels (the instrument rejects the same channel, -222), and writing a source turns that channel on, also an unchanged source while the plot is off (the driver writes only a change). Out-of-range values are clipped without an error (a start frequency above the stop becomes stop - 10 Hz, a stop below the start becomes start + 10 Hz, an amplitude of 6 V becomes 1.705 V); the driver refuses values outside the guide’s ranges, and a start or stop frequency the instrument clips against the other is logged as a warning and cached as clipped.
- sweep(timeout: float = 3600.0, poll_interval: float = 0.5) float[source]¶
Run one sweep and return when it has ended.
The results are shown on the display only.
- Parameters:
timeout – Longest duration of the sweep in s.
poll_interval – Interval in s between the queries of the sweep’s state.
- Returns:
The duration of the sweep in s.
- Raises:
TimeoutError – If the sweep has not ended within timeout; the sweep is then stopped.
- amplitude: Parameter = self.add_parameter( "amplitude", label="Bode amplitude", unit="Vpp", get_cmd=":BODeplot:VOLTage? ALL", set_cmd=":BODeplot:VOLTage ALL,{:.6e}", get_parser=float, vals=Numbers(20e-3, 5.0), )¶
Generator amplitude of the whole sweep, 20 mV to 5 V peak-to-peak. The amplitudes of the frequency ranges (:BODeplot:VOLTage <range>,<amp>) are separate settings that this one does not change.
- enabled: Parameter = self.add_parameter( "enabled", label="Bode plot shown", get_cmd=":BODeplot:ENABle?", set_cmd=self._set_enabled, val_mapping=_ON_OFF, )¶
Whether the Bode plot window is shown. Turning it off turns the generator output off; the driver therefore writes nothing when it is off already.
- input_source: Parameter = self.add_parameter( "input_source", label="Bode input", get_cmd=":BODeplot:REF:IN?", set_cmd=self._source_setter(":BODeplot:REF:IN", ":BODeplot:REF:OUT?"), val_mapping=sources, )¶
The channel at the input of the device under test; not the output channel. A change turns the channel on.
- output_source: Parameter = self.add_parameter( "output_source", label="Bode output", get_cmd=":BODeplot:REF:OUT?", set_cmd=self._source_setter(":BODeplot:REF:OUT", ":BODeplot:REF:IN?"), val_mapping=sources, )¶
The channel at the output of the device under test; not the input channel. A change turns the channel on.
- points_per_decade: Parameter = self.add_parameter( "points_per_decade", label="Bode points per decade", get_cmd=":BODeplot:POINts?", set_cmd=":BODeplot:POINts {}", get_parser=int, vals=Ints(10, 300), )¶
Frequency points per decade (logarithmic sweep).
- running: Parameter = self.add_parameter( "running", label="Bode sweep in progress", get_cmd=":BODeplot:RUNStop?", val_mapping=_ON_OFF, )¶
Whether a sweep is in progress; start() and stop() change it.
- start_frequency: Parameter = self.add_parameter( "start_frequency", parameter_class=_ReadBackParameter, label="Bode start frequency", unit="Hz", get_cmd=":BODeplot:STARt?", set_cmd=lambda value: parent._write_checked( ":BODeplot:STARt", value, self.start_frequency ), get_parser=float, vals=Numbers(10, 24.99e6), )¶
Start frequency, 10 Hz to 24.99 MHz, below the stop frequency.
- stop_frequency: Parameter = self.add_parameter( "stop_frequency", parameter_class=_ReadBackParameter, label="Bode stop frequency", unit="Hz", get_cmd=":BODeplot:STOP?", set_cmd=lambda value: parent._write_checked( ":BODeplot:STOP", value, self.stop_frequency ), get_parser=float, vals=Numbers(100, 25e6), )¶
Stop frequency, 100 Hz to 25 MHz, above the start frequency.
- sweep_type: Parameter = self.add_parameter( "sweep_type", label="Bode sweep type", get_cmd=":BODeplot:SWEeptype?", set_cmd=":BODeplot:SWEeptype {}", val_mapping={"log": "LOG", "linear": "LINE"}, )¶
Logarithmic or linear frequency steps.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900Channel(parent: RigolDHO900, name: str, channel: int, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentChannel[RigolDHO900]An analog input channel: vertical settings, waveform and measurements.
- bandwidth_limit: Parameter = self.add_parameter( "bandwidth_limit", label="20 MHz bandwidth limit", get_cmd=f"{prefix}:BWLimit?", set_cmd=f"{prefix}:BWLimit {{}}", val_mapping={False: "OFF", True: "20M"}, )¶
Whether the 20 MHz bandwidth limit is on.
- bias: Parameter = self.add_parameter( "bias", parameter_class=_ReadBackParameter, label="Bias voltage", unit="V", get_cmd=f"{prefix}:POSition?", set_cmd=self._set_bias, get_parser=float, vals=Numbers(), )¶
POSition): added to the waveform data and to the measurements, unlike offset. Same range and clipping as offset.
- Type:
Bias voltage (
- Type:
CHANnel<n>
- coupling: Parameter = self.add_parameter( "coupling", label="Coupling", get_cmd=f"{prefix}:COUPling?", set_cmd=f"{prefix}:COUPling {{}}", val_mapping={"dc": "DC", "ac": "AC", "gnd": "GND"}, )¶
Input coupling.
- delay_calibration: Parameter = self.add_parameter( "delay_calibration", label="Delay calibration", unit="s", get_cmd=f"{prefix}:TCALibrate?", set_cmd=self._set_delay_calibration, get_parser=float, vals=Numbers(-100e-9, 100e-9), )¶
Channel delay calibration (deskew), -100 ns to 100 ns. The instrument accepts a change only at fast time bases (it rejected every value at 200 us/div and accepted them at 1 us/div, up to 10 us/div); a change it rejects raises, and the unchanged value is not written (it would be rejected too).
- enabled: Parameter = self.add_parameter( "enabled", label=f"Channel {channel} on", get_cmd=f"{prefix}:DISPlay?", set_cmd=self._set_enabled, val_mapping=_ON_OFF, )¶
Whether the channel is on. While it is off, the instrument ignores changes of scale and offset, and its trace and measurements are not available.
- invert: Parameter = self.add_parameter( "invert", label="Invert", get_cmd=f"{prefix}:INVert?", set_cmd=f"{prefix}:INVert {{}}", val_mapping=_ON_OFF, )¶
Whether the waveform is inverted (also in the waveform data).
- label_text: Parameter = self.add_parameter( "label_text", label="Label", get_cmd=f"{prefix}:LABel:CONTent?", set_cmd=f"{prefix}:LABel:CONTent {{}}", vals=Strings(min_length=1), )¶
The channel’s label on the display.
- label_visible: Parameter = self.add_parameter( "label_visible", label="Show label", get_cmd=f"{prefix}:LABel:SHOW?", set_cmd=f"{prefix}:LABel:SHOW {{}}", val_mapping=_ON_OFF, )¶
Whether the label is shown on the display.
- offset: Parameter = self.add_parameter( "offset", parameter_class=_ReadBackParameter, label="Vertical offset", unit="V", get_cmd=f"{prefix}:OFFSet?", set_cmd=self._set_offset, get_parser=float, vals=Numbers(), )¶
shifts the waveform on the display; the voltage at the screen center is -offset. Its range depends on the scale and probe ratio; the instrument clips a value outside it, which is logged as a warning, and the clipped value is the one cached.
- Type:
Vertical offset
- probe_ratio: Parameter = self.add_parameter( "probe_ratio", label="Probe ratio", get_cmd=f"{prefix}:PROBe?", set_cmd=f"{prefix}:PROBe {{:g}}", get_parser=float, vals=Enum(*PROBE_RATIOS), )¶
Probe attenuation ratio. Scale, offset, bias and levels are in volts at the probe tip; setting the ratio rescales them.
- scale: Parameter = self.add_parameter( "scale", label="Vertical scale", unit="V/div", get_cmd=f"{prefix}:SCALe?", set_cmd=self._set_scale, get_parser=float, vals=Numbers(200e-6 * min(PROBE_RATIOS), 10 * max(PROBE_RATIOS)), )¶
200 uV/div to 10 V/div times the probe ratio.
- Type:
Vertical scale
- trace: ParameterWithSetpoints = self.add_parameter( "trace", label=f"Channel {channel}", unit="V", get_cmd=self._get_trace, setpoints=(parent.waveform.time_axis,), vals=Arrays(shape=(parent.waveform.points,)), parameter_class=ParameterWithSetpoints, snapshot_value=False, )¶
the display (normal), or the memory of a stopped acquisition (raw).
- Type:
The channel’s waveform in V, as selected by waveform.mode
- units: Parameter = self.add_parameter( "units", label="Units", get_cmd=f"{prefix}:UNITs?", set_cmd=f"{prefix}:UNITs {{}}", val_mapping={ "volt": "VOLT", "ampere": "AMP", "watt": "WATT", "unknown": "UNKN", }, )¶
The amplitude unit shown on the display. The driver’s parameters keep their units (V).
- vernier: Parameter = self.add_parameter( "vernier", label="Fine scale adjustment", get_cmd=f"{prefix}:VERNier?", set_cmd=f"{prefix}:VERNier {{}}", val_mapping=_ON_OFF, )¶
Whether the front-panel knob adjusts the vertical scale in fine steps. The scale parameter accepts any value in range either way.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900Counter(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]The hardware frequency counter.
- digits: Parameter = self.add_parameter( "digits", label="Counter digits", get_cmd=":COUNter:NDIGits?", set_cmd=":COUNter:NDIGits {}", get_parser=int, vals=Ints(3, 6), )¶
Resolution in digits (frequency and period).
- enabled: Parameter = self.add_parameter( "enabled", label="Counter on", get_cmd=":COUNter:ENABle?", set_cmd=":COUNter:ENABle {}", val_mapping=_ON_OFF, )¶
Whether the counter is on.
- mode: Parameter = self.add_parameter( "mode", label="Counter mode", get_cmd=":COUNter:MODE?", set_cmd=":COUNter:MODE {}", val_mapping={"frequency": "FREQ", "period": "PER", "totalize": "TOT"}, )¶
frequency, period, or totalize (edge count).
- source: Parameter = self.add_parameter( "source", label="Counter source", get_cmd=":COUNter:SOURce?", set_cmd=":COUNter:SOURce {}", val_mapping=parent._source_mapping(), )¶
The counted channel.
- statistics: Parameter = self.add_parameter( "statistics", label="Counter statistics", get_cmd=":COUNter:TOTalize:ENABle?", set_cmd=self._set_statistics, val_mapping=_ON_OFF, )¶
TOTalize:ENABle; frequency and period). Can be changed only while the counter is on (the instrument rejects it otherwise).
- Type:
Whether the counter’s statistics are on (
- Type:
COUNter
- value: Parameter = self.add_parameter( "value", label="Counter reading", get_cmd=":COUNter:CURRent?", get_parser=_float_or_nan, snapshot_get=False, )¶
The reading in Hz, s or counts, depending on mode; NaN while the counter is off. Right after it is turned on, or after a change of mode or digits, the reading is 0 or NaN until the first gate time has passed.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900DVM(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]The digital voltmeter (4 digits, independent of the acquisition).
- enabled: Parameter = self.add_parameter( "enabled", label="DVM on", get_cmd=":DVM:ENABle?", set_cmd=":DVM:ENABle {}", val_mapping=_ON_OFF, )¶
Whether the voltmeter is on.
- mode: Parameter = self.add_parameter( "mode", label="DVM mode", get_cmd=":DVM:MODE?", set_cmd=":DVM:MODE {}", val_mapping={"ac_rms": "ACRM", "dc": "DC", "dc_rms": "DCRM"}, )¶
mean; dc_rms: RMS.
- Type:
ac_rms
- Type:
RMS without the DC component; dc
- source: Parameter = self.add_parameter( "source", label="DVM source", get_cmd=":DVM:SOURce?", set_cmd=":DVM:SOURce {}", val_mapping={ f"ch{n}": f"CHAN{n}" for n in range(1, parent.n_channels + 1) }, )¶
The measured channel.
- value: Parameter = self.add_parameter( "value", label="DVM reading", unit="V", get_cmd=self._get_value, snapshot_get=False, )¶
The reading; NaN while the voltmeter is off. After it is turned on, the voltmeter reads 0 for 1.5 s to 3 s, then once a value near 0, then the reading.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900FrequencyResponse(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]Gain and phase of a device under test from the generator and two channels.
Measured with the generator (DHO914S, DHO924S) and the waveforms of two channels, the method of https://github.com/wjakob/rigol (BSD-3-Clause).
At each frequency the generator outputs a sine; one single acquisition records the input and output channels over at least
cyclesperiods, and a sine at the generator’s frequency is fitted to each trace by least squares (fit_sine). Gain and phase are the ratio of the fitted amplitudes and the difference of the fitted phases. With autoscale, the vertical scales are adjusted between acquisitions, in steps of the 1-2-5 sequence, so that the peak of each signal lies at 1.6 to 4 of the 4 divisions above the center line without clipping, which keeps the 12-bit resolution over a wide range of gains.The settings of this module are kept by the driver, not by the instrument; they do not change the instrument’s own Bode plot (bode).
- calibrate_through(frequencies: ArrayLike | None = None) dict[str, Any][source]¶
Measure the reference of the through correction.
Connect the input and output channel to the same node (the generator’s output, or the input of the device under test) before. The sweep then measures the difference between the two channels and their probes: delay (channel skew, and the interleaving of the instrument’s ADC between the channels, 0.8 ns between CH1 and CH2 with four channels on), gain and the frequency response of the probes. Later sweeps with the same input and output source are corrected by it while through_correction is on. A reference that deviates by more than 3 dB or 45 deg is logged as a warning: the channels are then probably not on the same node.
- Parameters:
frequencies – Frequencies in Hz; by default those of the settings (frequencies). Later sweeps must lie within their range.
- Returns:
The reference, also kept as through_calibration.
- Raises:
RuntimeError – As sweep().
ValueError – As sweep().
TimeoutError – As sweep().
- clear_through_calibration() None[source]¶
Discard the through calibration; later sweeps are uncorrected.
- sweep(frequencies: ArrayLike | None = None) dict[str, NDArray[float64]][source]¶
Measure gain and phase at the frequencies of the settings or at given ones.
Changes the instrument settings: generator (sine, amplitude, no offset or modulation, frequency; the output is on during the sweep and back in its previous state afterwards), the two channels (on, offset 0, scales with autoscale), time base (main mode, no auto roll, offset 0), memory depth, edge trigger on the input channel (on the output channel with “awg” as input) at 0 V, rising, and the waveform mode (raw). Coupling, bandwidth limit and probe ratio stay as set. Turns on CH1 (and CH2, CH3) where the instrument records the measured channels into the memory only with them (memory_channels).
With a through calibration (calibrate_through()) and through_correction on, gain and phase are corrected by the reference: the gain in dB and the phase are its differences from the reference, interpolated between the reference’s frequencies (the gain over log f, the phase linearly over f, exact for a delay).
- Parameters:
frequencies – Frequencies in Hz; by default those of the settings (frequencies).
- Returns:
frequency (the generator’s, Hz), gain (dB), phase (deg, unwrapped over the sweep; NaN with “awg” as input), raw_gain and raw_phase (without the through correction; equal to gain and phase without it), input_amplitude and output_amplitude (V, peak), input_scale and output_scale (V/div of the acquisition used).
- Return type:
Arrays by key, also kept as last_sweep
- Raises:
RuntimeError – If the instrument has no generator.
ValueError – If input and output are the same channel, there are no frequencies, a frequency lies outside the generator’s range, or the amplitude exceeds the generator’s limit at the highest frequency; with the through correction, if the calibration was measured with other channels or a frequency lies outside its range.
TimeoutError – If an acquisition does not end, also after a forced trigger.
- accepted_divisions = (1.5, 4.0)¶
the range of the signal peak, in divisions, that autoscale accepts without a change of a scale of the 1-2-5 sequence; a new scale is the step of that sequence that places the peak at or below the upper end (1.6 to 4 div)
- amplitude: Parameter = self.add_parameter( "amplitude", label="Generator amplitude", unit="Vpp", initial_value=1.0, set_cmd=None, vals=Numbers(AWG_MIN_AMPLITUDE, AWG_MAX_AMPLITUDE[0][1]), )¶
Peak-to-peak amplitude of the generator’s sine into a high impedance; at most 5 V for a sweep above 10 MHz.
- autoscale: Parameter = self.add_parameter( "autoscale", label="Adjust vertical scales", initial_value=True, set_cmd=None, vals=Bool(), )¶
Whether the vertical scales are adjusted to each signal (see the class docstring); otherwise they stay as set.
- cycles: Parameter = self.add_parameter( "cycles", label="Periods per acquisition", initial_value=10, set_cmd=None, vals=Ints(1, 10000), )¶
the time base is the 1-2-5 step at or above cycles / frequency / 10 div. The record can extend beyond the screen at fast time bases.
- Type:
Periods on the screen at least
- frequencies: Parameter = self.add_parameter( "frequencies", label="Frequency", unit="Hz", get_cmd=self._get_frequencies, snapshot_value=False, )¶
The frequencies of the sweep, from sweep type, start, stop and points per decade (logarithmic) or points (linear).
- input_source: Parameter = self.add_parameter( "input_source", label="Input", initial_value="ch1", set_cmd=None, vals=Enum("awg", *channels), )¶
the set generator amplitude is the input then, and the phase is NaN.
- Type:
The channel at the input of the device under test, or “awg”
- last_sweep: dict[str, npt.NDArray[np.float64]] | None = None¶
The result of the most recent sweep() (see there).
- max_acquisitions = 6¶
acquisitions per frequency at most, while autoscale adjusts the scales
- memory_depth: Parameter = self.add_parameter( "memory_depth", label="Memory depth", unit="pts", initial_value=1e4, set_cmd=None, vals=Enum(*MEMORY_DEPTHS[:4]), )¶
Memory depth of the acquisitions, 1e3 to 1e6 points.
- output_source: Parameter = self.add_parameter( "output_source", label="Output", initial_value="ch2", set_cmd=None, vals=Enum(*channels), )¶
The channel at the output of the device under test.
- points: Parameter = self.add_parameter( "points", label="Points", initial_value=50, set_cmd=None, vals=Ints(2, 10000), )¶
Number of equally spaced frequency points of a linear sweep, start and stop included.
- points_per_decade: Parameter = self.add_parameter( "points_per_decade", label="Points per decade", initial_value=10, set_cmd=None, vals=Ints(1, 1000), )¶
Frequency points per decade of a logarithmic sweep (log_frequencies).
- response: RigolDHO900ResponseParameter = self.add_parameter( "response", parameter_class=RigolDHO900ResponseParameter )¶
Gain (dB) and phase (deg) from one sweep, for the QCoDeS dataset.
- settling_time: Parameter = self.add_parameter( "settling_time", label="Settling time", unit="s", initial_value=0.0, set_cmd=None, vals=Numbers(0, 3600), )¶
Delay between a frequency change and the acquisition, for a device under test with long time constants.
- start_frequency: Parameter = self.add_parameter( "start_frequency", label="Start frequency", unit="Hz", initial_value=1e3, set_cmd=None, vals=Numbers(0.1, 25e6), )¶
First frequency of the sweep.
- stop_frequency: Parameter = self.add_parameter( "stop_frequency", label="Stop frequency", unit="Hz", initial_value=1e6, set_cmd=None, vals=Numbers(0.1, 25e6), )¶
Last frequency of the sweep.
- sweep_type: Parameter = self.add_parameter( "sweep_type", label="Sweep type", initial_value="log", set_cmd=None, vals=Enum("log", "linear"), )¶
Logarithmic frequency steps (points_per_decade) or linear steps (points).
- through_calibrated: Parameter = self.add_parameter( "through_calibrated", label="Through calibration available", get_cmd=lambda: self.through_calibration is not None, )¶
Whether a through calibration exists (through_calibration).
- through_calibration: dict[str, Any] | None = None¶
arrays by key frequency (Hz), gain (dB) and phase (deg), and the input_source and output_source it was measured with. Can be saved and set again for a later session with the same probes and channels.
- Type:
The reference of calibrate_through(), or None
- through_correction: Parameter = self.add_parameter( "through_correction", label="Apply the through calibration", initial_value=True, set_cmd=None, vals=Bool(), )¶
Whether sweep() corrects gain and phase by the through calibration (calibrate_through()), while one exists.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900Measurement(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]Settings of the automatic measurements.
- amplitude_method: Parameter = self.add_parameter( "amplitude_method", label="Amplitude method", get_cmd=":MEASure:AMP:TYPE?", set_cmd=":MEASure:AMP:TYPE {}", val_mapping={"auto": "AUTO", "manual": "MAN"}, )¶
How the top and base levels are found.
- area: Parameter = self.add_parameter( "area", label="Measurement range", get_cmd=":MEASure:AREA?", set_cmd=":MEASure:AREA {}", val_mapping={"main": "MAIN", "zoom": "ZOOM"}, )¶
Measure over the main or the zoomed time base (zoom requires timebase.delay_enabled).
- statistics_count: Parameter = self.add_parameter( "statistics_count", label="Statistics count", get_cmd=":MEASure:STATistic:COUNt?", set_cmd=":MEASure:STATistic:COUNt {}", get_parser=int, vals=Ints(2, 100_000), )¶
Number of measurements the statistics cover.
- statistics_display: Parameter = self.add_parameter( "statistics_display", label="Show statistics", get_cmd=":MEASure:STATistic:DISPlay?", set_cmd=":MEASure:STATistic:DISPlay {}", val_mapping=_ON_OFF, )¶
Whether the statistics are shown on the display.
- threshold_type: Parameter = self.add_parameter( "threshold_type", label="Threshold type", get_cmd=":MEASure:THReshold:TYPE?", set_cmd=":MEASure:THReshold:TYPE {}", val_mapping={"percent": "PERC", "absolute": "ABS"}, )¶
Whether the thresholds are in % of the amplitude or in V.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900ResponseParameter(name: str, instrument: RigolDHO900FrequencyResponse, **kwargs: Any)[source]¶
Bases:
MultiParameterGain (dB) and phase (deg) against frequency from one frequency_response sweep.
The frequencies are those of its settings.
- get_raw() tuple[NDArray[float64], NDArray[float64]][source]¶
Run a sweep and return its gain and phase.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900Timebase(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]The horizontal system.
- auto_roll: Parameter = self.add_parameter( "auto_roll", label="Automatic roll mode", get_cmd=":TIMebase:ROLL?", set_cmd=":TIMebase:ROLL {}", val_mapping=_ON_OFF, )¶
Whether the roll mode starts by itself at 50 ms/div and slower.
- delay_enabled: Parameter = self.add_parameter( "delay_enabled", label="Zoom (delayed sweep)", get_cmd=":TIMebase:DELay:ENABle?", set_cmd=":TIMebase:DELay:ENABle {}", val_mapping=_ON_OFF, )¶
Whether the zoomed (delayed) time base is shown.
- delay_offset: Parameter = self.add_parameter( "delay_offset", parameter_class=_ReadBackParameter, label="Zoom offset", unit="s", get_cmd=":TIMebase:DELay:OFFSet?", set_cmd=lambda value: parent._write_checked( ":TIMebase:DELay:OFFSet", value, self.delay_offset ), get_parser=float, vals=Numbers(), )¶
Offset of the zoomed time base; the zoomed window lies within the main one.
- delay_scale: Parameter = self.add_parameter( "delay_scale", parameter_class=_ReadBackParameter, label="Zoom scale", unit="s/div", get_cmd=":TIMebase:DELay:SCALe?", set_cmd=lambda value: parent._write_checked( ":TIMebase:DELay:SCALe", value, self.delay_scale ), get_parser=float, vals=Numbers(0, 1000), )¶
Scale of the zoomed time base, at most the main scale, in 1-2-5 steps.
- mode: Parameter = self.add_parameter( "mode", label="Time base mode", get_cmd=":TIMebase:MODE?", set_cmd=":TIMebase:MODE {}", val_mapping={"main": "MAIN", "roll": "ROLL"}, )¶
YT (main) or roll mode.
- offset: Parameter = self.add_parameter( "offset", parameter_class=_ReadBackParameter, label="Horizontal offset", unit="s", get_cmd=":TIMebase:MAIN:OFFSet?", set_cmd=lambda value: parent._write_checked( ":TIMebase:MAIN:OFFSet", value, self.offset ), get_parser=float, vals=Numbers(), )¶
Time of the screen center relative to the trigger. Its range depends on the scale and the run state; a value the instrument clips is logged as a warning and cached as clipped.
- reference: Parameter = self.add_parameter( "reference", label="Horizontal reference", get_cmd=":TIMebase:HREFerence:MODE?", set_cmd=":TIMebase:HREFerence:MODE {}", val_mapping={ "center": "CENT", "left": "LB", "right": "RB", "trigger": "TRIG", "user": "USER", }, )¶
The point the waveform expands or compresses about when the scale changes.
- reference_position: Parameter = self.add_parameter( "reference_position", label="User reference position", get_cmd=":TIMebase:HREFerence:POSition?", set_cmd=":TIMebase:HREFerence:POSition {}", get_parser=int, vals=Ints(-500, 500), )¶
The user-defined horizontal reference position, -500 to 500.
- scale: Parameter = self.add_parameter( "scale", parameter_class=_ReadBackParameter, label="Horizontal scale", unit="s/div", get_cmd=":TIMebase:MAIN:SCALe?", set_cmd=self._set_scale, get_parser=float, vals=Numbers(1e-9, 1000), )¶
Horizontal scale; the screen is 10 divisions wide. The fastest scale depends on the model’s bandwidth (2 ns/div on the DHO914S), the slowest is 500 s/div.
- vernier: Parameter = self.add_parameter( "vernier", label="Fine horizontal adjustment", get_cmd=":TIMebase:VERNier?", set_cmd=":TIMebase:VERNier {}", val_mapping=_ON_OFF, )¶
Whether the front-panel knob adjusts the horizontal scale in fine steps.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900Trigger(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]Trigger: sweep, status and the edge and pulse trigger settings.
- coupling: Parameter = self.add_parameter( "coupling", label="Trigger coupling", get_cmd=":TRIGger:COUPling?", set_cmd=":TRIGger:COUPling {}", val_mapping={ "dc": "DC", "ac": "AC", "lf_reject": "LFR", "hf_reject": "HFR", }, )¶
Coupling of the edge trigger on an analog channel.
- edge_level: Parameter = self.add_parameter( "edge_level", label="Edge trigger level", unit="V", get_cmd=":TRIGger:EDGE:LEVel?", set_cmd=lambda value: self._set_level( "EDGE", self.edge_source, value, self.edge_level ), get_parser=float, vals=Numbers(), )¶
Edge trigger level, within +-4.5 divisions of the screen center of the source channel.
- edge_slope: Parameter = self.add_parameter( "edge_slope", label="Edge trigger slope", get_cmd=":TRIGger:EDGE:SLOPe?", set_cmd=":TRIGger:EDGE:SLOPe {}", val_mapping={"rising": "POS", "falling": "NEG", "either": "RFAL"}, )¶
The edge the edge trigger fires on.
- edge_source: Parameter = self.add_parameter( "edge_source", label="Edge trigger source", get_cmd=":TRIGger:EDGE:SOURce?", set_cmd=":TRIGger:EDGE:SOURce {}", val_mapping=sources, )¶
Source of the edge trigger.
- holdoff: Parameter = self.add_parameter( "holdoff", label="Trigger holdoff", unit="s", get_cmd=":TRIGger:HOLDoff?", set_cmd=":TRIGger:HOLDoff {:.6e}", get_parser=float, vals=Numbers(8e-9, 10), )¶
Time after a trigger during which the trigger is not rearmed.
- noise_reject: Parameter = self.add_parameter( "noise_reject", label="Noise rejection", get_cmd=":TRIGger:NREJect?", set_cmd=":TRIGger:NREJect {}", val_mapping=_ON_OFF, )¶
Whether noise rejection is on.
- pulse_level: Parameter = self.add_parameter( "pulse_level", label="Pulse trigger level", unit="V", get_cmd=":TRIGger:PULSe:LEVel?", set_cmd=lambda value: self._set_level( "PULSe", self.pulse_source, value, self.pulse_level ), get_parser=float, vals=Numbers(), )¶
Pulse trigger level, within +-4.5 divisions of the screen center of the source channel.
- pulse_lower_width: Parameter = self.add_parameter( "pulse_lower_width", parameter_class=_ReadBackParameter, label="Pulse lower width", unit="s", get_cmd=":TRIGger:PULSe:LWIDth?", set_cmd=lambda value: parent._write_checked( ":TRIGger:PULSe:LWIDth", value, self.pulse_lower_width ), get_parser=float, vals=Numbers(1e-9, 10), )¶
Lower pulse width limit (greater, between).
- pulse_polarity: Parameter = self.add_parameter( "pulse_polarity", label="Pulse polarity", get_cmd=":TRIGger:PULSe:POLarity?", set_cmd=":TRIGger:PULSe:POLarity {}", val_mapping={"positive": "POS", "negative": "NEG"}, )¶
Polarity of the pulses the pulse trigger qualifies.
- pulse_source: Parameter = self.add_parameter( "pulse_source", label="Pulse trigger source", get_cmd=":TRIGger:PULSe:SOURce?", set_cmd=":TRIGger:PULSe:SOURce {}", val_mapping=sources, )¶
Source of the pulse trigger.
- pulse_upper_width: Parameter = self.add_parameter( "pulse_upper_width", parameter_class=_ReadBackParameter, label="Pulse upper width", unit="s", get_cmd=":TRIGger:PULSe:UWIDth?", set_cmd=lambda value: parent._write_checked( ":TRIGger:PULSe:UWIDth", value, self.pulse_upper_width ), get_parser=float, vals=Numbers(1e-9, 10), )¶
Upper pulse width limit (less, between).
- pulse_when: Parameter = self.add_parameter( "pulse_when", label="Pulse condition", get_cmd=":TRIGger:PULSe:WHEN?", set_cmd=":TRIGger:PULSe:WHEN {}", val_mapping={"greater": "GRE", "less": "LESS", "between": "GLES"}, )¶
Trigger on pulses wider than pulse_lower_width (greater), narrower than pulse_upper_width (less), or between the two.
- status: Parameter = self.add_parameter( "status", label="Trigger status", get_cmd=":TRIGger:STATus?", val_mapping={ "triggered": "TD", "wait": "WAIT", "run": "RUN", "auto": "AUTO", "stop": "STOP", }, snapshot_get=False, )¶
triggered, wait (armed), run, auto (acquiring without a trigger) or stop.
- sweep: Parameter = self.add_parameter( "sweep", label="Trigger sweep", get_cmd=":TRIGger:SWEep?", set_cmd=":TRIGger:SWEep {}", val_mapping={"auto": "AUTO", "normal": "NORM", "single": "SING"}, )¶
only on a trigger; single: one acquisition on the next trigger, then stop.
- Type:
auto
- Type:
acquires without a trigger as well; normal
- type: Parameter = self.add_parameter( "type", label="Trigger type", get_cmd=":TRIGger:MODE?", set_cmd=":TRIGger:MODE {}", val_mapping={ "edge": "EDGE", "pulse": "PULS", "slope": "SLOP", "video": "VID", "pattern": "PATT", "duration": "DUR", "timeout": "TIM", "runt": "RUNT", "window": "WIND", "delay": "DEL", "setup_hold": "SET", "nth_edge": "NEDG", "rs232": "RS232", "iic": "IIC", "spi": "SPI", "can": "CAN", "lin": "LIN", }, )¶
The trigger type. The driver has the settings of the edge and pulse triggers.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.RigolDHO900Waveform(parent: RigolDHO900, name: str, **kwargs: Unpack[InstrumentBaseKWArgs])[source]¶
Bases:
InstrumentModule[RigolDHO900]Waveform readout: the mode and the time axis of the channels’ traces.
- preamble(source: str = 'CHANnel1') dict[str, float][source]¶
The waveform preamble of a source in the current mode, for the whole record.
Selects the whole record first (:WAVeform:STARt 1, :WAVeform:STOP at its end): the points the preamble reports are those between start and stop, not the record length.
- Parameters:
source – Waveform source as in :WAVeform:SOURce, e.g. “CHANnel1”.
- Returns:
format, type, points, count, xincrement, xorigin, xreference, yincrement, yorigin and yreference.
- Return type:
By key
- Raises:
RuntimeError – If the preamble does not have ten fields.
- read(source: str) NDArray[float64][source]¶
Read the waveform of a source.
- Parameters:
source – Waveform source as in :WAVeform:SOURce, e.g. “CHANnel1”.
- Returns:
The samples in V.
- Raises:
RuntimeError – As read_with_preamble().
- read_with_preamble(source: str) tuple[NDArray[float64], dict[str, float]][source]¶
Read the waveform of a source, with the preamble of the read.
- Parameters:
source – Waveform source as in :WAVeform:SOURce, e.g. “CHANnel1”.
- Returns:
The samples in V, and the preamble of the read (see preamble()) for their time axis.
- Raises:
RuntimeError – If the memory (raw mode) is read while the acquisition runs; if the memory of the source is not its own for the channels on (memory_channels), or channels were turned on or off since the acquisition; if the source has no samples; if a block has another number of points than requested.
- chunk_points = 250000¶
DATA? from the memory
- Type:
points read per
- Type:
WAVeform
- mode: Parameter = self.add_parameter( "mode", label="Waveform read mode", get_cmd=":WAVeform:MODE?", set_cmd=":WAVeform:MODE {}", val_mapping={"normal": "NORM", "maximum": "MAX", "raw": "RAW"}, )¶
normal, the 1000 points on the display; raw, the memory (memory depth points), only while stopped; maximum, the display while running and the memory while stopped.
- Type:
What a trace reads
- points: Parameter = self.add_parameter( "points", label="Waveform points", get_cmd=self._get_points, snapshot_get=False, )¶
The number of points a trace has in the current mode and state.
- time_axis: Parameter = self.add_parameter( "time_axis", label="Time", unit="s", get_cmd=self._get_time_axis, vals=Arrays(shape=(self.points,)), snapshot_value=False, )¶
The time of each trace point relative to the trigger.
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.awg_max_amplitude(frequency: float) float[source]¶
The highest generator amplitude at a frequency.
- Parameters:
frequency – Generator frequency in Hz.
- Returns:
The highest peak-to-peak amplitude in V into a high impedance.
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.fit_sine(t: ArrayLike, y: ArrayLike, frequency: float) tuple[float, float, float][source]¶
Least-squares fit of y = A sin(2 pi f t + phase) + c at a known frequency f.
The fit rejects noise and harmonics that a peak or zero-crossing measurement picks up, and needs no whole number of periods.
- Parameters:
t – Sample times in s.
y – Sample values.
frequency – The known frequency f in Hz.
- Returns:
The amplitude A, the phase in rad and the offset c.
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.linear_frequencies(start: float, stop: float, points: int) NDArray[float64][source]¶
Equally spaced frequencies from start to stop.
- Parameters:
start – First frequency in Hz.
stop – Last frequency in Hz.
points – Number of frequencies.
- Returns:
The frequencies in Hz, start and stop included.
- Raises:
ValueError – If start is not below stop.
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.log_frequencies(start: float, stop: float, points_per_decade: int) NDArray[float64][source]¶
Logarithmically spaced frequencies from start to stop.
The frequencies are start * 10**(k / n) for n points per decade, and stop. The instrument’s Bode plot uses the same grid (1 kHz, 1.259 kHz, 1.585 kHz, … at 10 points per decade).
- Parameters:
start – First frequency in Hz.
stop – Last frequency in Hz.
points_per_decade – Number of points per decade.
- Returns:
The frequencies in Hz, start and stop included.
- Raises:
ValueError – If start is not below stop.
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.memory_channels(enabled: Sequence[int]) tuple[int, ...][source]¶
The channels whose samples the memory contains, in its order.
Firmware 00.01.04, DHO914S: CH1 alone with one channel on, CH1 and the other channel with CH1 among two, CH1 and CH2 with two others, CH1 to CHn with n of three or four. A memory read of the k-th channel that is on returns the k-th of these; the memory of a channel that is on is its own only where the two agree.
- Parameters:
enabled – Numbers of the channels that are on.
- Returns:
Numbers of the channels recorded into the memory, in its order.
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.readable_channels(enabled: Sequence[int], n_channels: int = 4) tuple[int, ...][source]¶
The channels to turn on for a memory read.
The fewest channels, those that are on included, whose memory is their own (memory_channels).
- Parameters:
enabled – Numbers of the channels that are on.
n_channels – Number of analog channels of the instrument.
- Returns:
Numbers of the channels to have on.
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.scale_125(value: float) float[source]¶
The smallest value of the 1-2-5 sequence (1, 2, 5, 10, …) at or above value.
- Parameters:
value – A positive number.
- Returns:
The value of the sequence.
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.AWG_MAX_AMPLITUDE = ((10000000.0, 10.0), (inf, 5.0))¶
up to 10 MHz, above
- Type:
generator amplitude limits (Vpp, high impedance)
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.AWG_MAX_FREQUENCY = {'arb': 10000000.0, 'ramp': 150000.0, 'sine': 25000000.0, 'square': 15000000.0}¶
highest frequency of each generator function (Hz); DC and noise have none
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.AWG_MIN_FREQUENCY = 0.002¶
lowest generator frequency (Hz)
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.CHANNEL_MEASUREMENTS = (('vmax', 'Maximum', 'V'), ('vmin', 'Minimum', 'V'), ('vpp', 'Peak-to-peak', 'V'), ('vamp', 'Amplitude', 'V'), ('vavg', 'Mean', 'V'), ('vrms', 'RMS', 'V'), ('ac_rms', 'AC RMS', 'V'), ('frequency', 'Frequency', 'Hz'), ('period', 'Period', 's'), ('rise_time', 'Rise time', 's'), ('fall_time', 'Fall time', 's'), ('positive_duty', 'Positive duty cycle', ''))¶
(item, label, unit)
- Type:
the measurements a channel has as parameters
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.CLIP_DIVISIONS = 4.3¶
the ADC range ends at +-4.369 div (DHO914S)
- Type:
a sample this many divisions from the screen center or farther is clipped
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.MEASUREMENT_ITEMS = {'ac_rms': 'ACRMs', 'area': 'MARea', 'delay_ff': 'FFDelay', 'delay_fr': 'FRDelay', 'delay_rf': 'RFDelay', 'delay_rr': 'RRDelay', 'fall_time': 'FTIMe', 'falling_edges': 'NEDGes', 'frequency': 'FREQuency', 'negative_duty': 'NDUTy', 'negative_pulses': 'NPULses', 'negative_slew_rate': 'NSLewrate', 'negative_width': 'NWIDth', 'overshoot': 'OVERshoot', 'period': 'PERiod', 'period_area': 'MPARea', 'period_vrms': 'PVRMs', 'phase_ff': 'FFPHase', 'phase_fr': 'FRPHase', 'phase_rf': 'RFPHase', 'phase_rr': 'RRPHase', 'positive_duty': 'PDUTy', 'positive_pulses': 'PPULses', 'positive_slew_rate': 'PSLewrate', 'positive_width': 'PWIDth', 'preshoot': 'PREShoot', 'rise_time': 'RTIMe', 'rising_edges': 'PEDGes', 'tvmax': 'TVMAX', 'tvmin': 'TVMIN', 'vamp': 'VAMP', 'variance': 'VARiance', 'vavg': 'VAVG', 'vbase': 'VBASe', 'vlower': 'VLOWer', 'vmax': 'VMAX', 'vmid': 'VMID', 'vmin': 'VMIN', 'vpp': 'VPP', 'vrms': 'VRMS', 'vtop': 'VTOP', 'vupper': 'VUPPer'}¶
ITEM? by the names of RigolDHO900.measure
- Type:
the measurement items of
- Type:
MEASure
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.MEMORY_DEPTHS = (1000.0, 10000.0, 100000.0, 1000000.0, 10000000.0, 25000000.0, 50000000.0)¶
memory depths (points) the instrument accepts besides “auto”
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.PROBE_RATIOS = (0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000, 20000, 50000)¶
probe ratios the instrument accepts
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.STATISTICS = {'average': 'AVERages', 'count': 'CNT', 'current': 'CURRent', 'deviation': 'DEViation', 'maximum': 'MAXimum', 'minimum': 'MINimum'}¶
STATistic:ITEM? by the keys of measure_statistics
- Type:
the results of
- Type:
MEASure
- qcodes_contrib_drivers.drivers.Rigol.Rigol_DHO900.TWO_SOURCE_ITEMS = frozenset({'delay_ff', 'delay_fr', 'delay_rf', 'delay_rr', 'phase_ff', 'phase_fr', 'phase_rf', 'phase_rr'})¶
the items that take two sources
qcodes_contrib_drivers.drivers.Rigol.Rigol_DP932 module¶
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DP932.RigolDP932E(*args: Any, **kwargs: Any)[source]¶
Bases:
VisaInstrumentQCoDeS driver for the Rigol DP932E Programmable DC Power Supply.
- measure_current(channel: int) float[source]¶
Measures the current at the output terminal of the specified channel.
- measure_power(channel: int) float[source]¶
Measures the power at the output terminal of the specified channel.
- measure_voltage(channel: int) float[source]¶
Measures the voltage at the output terminal of the specified channel.
- set_current(channel: int, current: float)[source]¶
Sets the output current for the specified channel.
qcodes_contrib_drivers.drivers.Rigol.Rigol_DSA800 module¶
Driver for Rigol DSA800 series spectrum analyzers.
Programming reference: https://m.testlink.co.kr/download/rigol/DSA800_ProgrammingGuide_EN.pdf
I have tested this driver on a DSA815-TG, but it should be compatible with other DSA800 models as well.
See docs/examples/ for example notebooks.
Written by Edward Laird (http://wp.lancs.ac.uk/laird-group/).
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DSA800.RigolDSA800(*args: Any, **kwargs: Any)[source]¶
Bases:
VisaInstrumentQCoDeS driver for Rigol DSA800 series spectrum analyzers.
- acquire_trace(trace_index: int = 1, timeout: float | None = None) NDArray[float64][source]¶
Run a single sweep and return the requested trace.
- Parameters:
trace_index – Trace number to read back.
timeout – Optional timeout in seconds for the sweep.
- Returns:
The acquired trace data.
- single_sweep(timeout: float | None = None) None[source]¶
Run a single sweep and wait for completion.
- Parameters:
timeout – Optional timeout in seconds for the sweep.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DSA800.RigolDSA800Marker(parent: RigolDSA800, name: str, marker_index: int)[source]¶
Bases:
InstrumentChannelMarker control and readout for a single analyzer marker.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DSA800.RigolDSA800Trace(*args: Any, trace_index: int, **kwargs: Any)[source]¶
Bases:
ParameterWithSetpointsTrace parameter with analyzer axis setpoints.
- get_raw() NDArray[float64][source]¶
get_rawis called to perform the actual data acquisition from the instrument. This method should either be overwritten to perform the desired operation or alternatively forParametera suitable method is automatically generated ifget_cmdis supplied to the parameter constructor. The method is automatically wrapped to provide agetmethod on the parameter instance.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DSA800.RigolDSA800TraceChannel(parent: RigolDSA800, name: str, trace_index: int)[source]¶
Bases:
InstrumentChannelTrace configuration and readout for a single displayed trace.
- class qcodes_contrib_drivers.drivers.Rigol.Rigol_DSA800.RigolDSA800TrackingGenerator(parent: RigolDSA800, name: str)[source]¶
Bases:
InstrumentChannelTracking-generator control for TG-equipped DSA800 analyzers.
qcodes_contrib_drivers.drivers.Rigol.Rigol_DSG3136B module¶
Driver for Rigol DSG3136B microwave signal generator
Written by Edward Laird (http://wp.lancs.ac.uk/laird-group/) based on another Rigol driver by Matthew Green.
A documentation notebook is in the docs/examples/ directory.