Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a80172f
Add value types to Keysight driver parameters
jenshnielsen Oct 22, 2026
395bf8c
Add value types to Keithley, HP and Agilent driver parameters
jenshnielsen Oct 22, 2026
7cbc624
Add value types to Tektronix and Rigol driver parameters
jenshnielsen Oct 22, 2026
3efa1bf
Add value types to R&S and SRS driver parameters
jenshnielsen Oct 22, 2026
4651708
Add value types to Alazar, AMI, Oxford and Yokogawa parameters
jenshnielsen Oct 22, 2026
9686640
Add value types to remaining driver parameters
jenshnielsen Oct 22, 2026
7cc6fbf
Parse Keithley 2450 count and line frequency as int
jenshnielsen Oct 22, 2026
a3446cd
Parse SR86x captured kilobytes as int
jenshnielsen Oct 22, 2026
4d813ee
Fix Rigol DS4000 enable_auto_scale
jenshnielsen Oct 22, 2026
c966d32
Use seconds as unit of Keithley 7510 digitize aperture
jenshnielsen Oct 22, 2026
509d84a
Fix RTO1000 trigger_mode querying the trigger source
jenshnielsen Oct 22, 2026
686a823
Remove stray '?' from Keithley 6500 digits set command
jenshnielsen Oct 22, 2026
de106a9
Fix B1500 pch_query missing the '?'
jenshnielsen Oct 22, 2026
057d905
Only allow Lakeshore 325 high output range on loop 1
jenshnielsen Oct 22, 2026
8f877fe
Remove unused vals from Rigol DG1062 polarity
jenshnielsen Oct 22, 2026
88f7df8
Parse Keithley 2450 nplc and source delay as float
jenshnielsen Oct 22, 2026
a8ec2f7
Parse Keithley 7510 delay, counts and sample rate as numbers
jenshnielsen Oct 22, 2026
dcbce9d
Fix Agilent E8267C pulse width type and unit
jenshnielsen Oct 22, 2026
bba0716
Parse Rigol DG1062 burst settings and duty cycle as numbers
jenshnielsen Oct 22, 2026
a13aff6
Parse Rigol DS1074Z trigger level as float
jenshnielsen Oct 22, 2026
bc2599a
Parse Tektronix TPS2012 trigger level as float
jenshnielsen Oct 22, 2026
85c37c1
Make Keithley 2000 _get_mode_param generic
jenshnielsen Oct 22, 2026
368299d
Use on/off mapping for Tektronix AWG5014 states
jenshnielsen Oct 22, 2026
4b9b8ae
Parse R&S RTO1000 channel impedance as float
jenshnielsen Oct 22, 2026
593cda7
Parse Keysight E4980A impedance range as float
jenshnielsen Oct 23, 2026
c3a2c8e
Type Keysight 34980A modules by slot
jenshnielsen Oct 23, 2026
ce0ab04
Pass bool to R&S SGS100A status
jenshnielsen Oct 23, 2026
4989a68
Pass bool to Agilent E8257D output_enabled
jenshnielsen Oct 23, 2026
1d96fdd
Pass bool to CopperMountain averages trigger
jenshnielsen Oct 23, 2026
127787a
Pass bool to Tektronix DPO measurement state
jenshnielsen Oct 23, 2026
caafc08
Fix R&S ZNB non-integer bandwidth
jenshnielsen Oct 23, 2026
822da3c
Drop redundant parameter_class in mock instruments
jenshnielsen Oct 23, 2026
dceebfe
Fix B1500 compliance and volt monitor validators
jenshnielsen Oct 23, 2026
4494c3a
Add newsfragments for parameter value types
jenshnielsen Oct 23, 2026
066e1a6
Fix Lakeshore 325 curve index and curve data
jenshnielsen Oct 23, 2026
46c86b4
Allow clearing B1517A power compliance
jenshnielsen Oct 23, 2026
09e3c2f
Skip existing slots when rescanning 34980A
jenshnielsen Oct 23, 2026
dcb1924
Parse Tektronix DPO record length as int
jenshnielsen Oct 23, 2026
899fa47
Use Ints for Keysight PNA counts and trace number
jenshnielsen Oct 23, 2026
ab66340
Raise when no curve is selected on Lakeshore 325
jenshnielsen Oct 24, 2026
897f66a
Test Tektronix DPO7200xx trace data scaling
jenshnielsen Oct 24, 2026
83e6d3e
Add simulated tests for Agilent E8257D
jenshnielsen Oct 24, 2026
881fd6b
Clear B1517A power compliance with current compliance
jenshnielsen Oct 26, 2026
6246265
Accept whole-number floats for Keysight PNA counts
jenshnielsen Oct 26, 2026
27271ec
Accept whole-number floats for Lakeshore 325 curve index
jenshnielsen Oct 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/changes/newsfragments/8658.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Several instrument driver parameters now return numbers or booleans instead of the raw string
from the instrument, or an integer for an on/off state. Code that compares the returned value to
a string, or to ``0``/``1`` by identity, needs updating:

- ``Keithley2450.line_frequency`` and ``Keithley2450Sense.count`` now return ``int``, and
``Keithley2450Sense.nplc`` and ``Keithley2450Source.delay`` return ``float``.
- ``Keithley7510Sense.user_delay`` now returns ``float``, and
``Keithley7510Sense.average_count``, ``Keithley7510DigitizeSense.acq_rate`` and
``Keithley7510DigitizeSense.count`` return ``int``.
- ``SR86xBuffer.count_capture_kilobytes`` now returns ``int``.
- ``RigolDG1062Burst.ncycles`` now returns ``int``, and ``RigolDG1062Burst.phase``,
``RigolDG1062Burst.time_delay`` and ``RigolDG1062Channel.duty_cycle`` return ``float``.
- ``RigolDS1074Z.trigger_level`` and ``TektronixTPS2012.trigger_level`` now return ``float``.
- ``TektronixDPOHorizontal.record_length`` now returns ``int`` instead of ``float``, as the
record length is a number of samples.
- ``AgilentE8267C.pulse_width`` now returns ``float`` and its unit is ``s`` instead of ``ns``,
matching the value sent to and returned by the instrument.
- ``RohdeSchwarzRTO1000ScopeChannel.impedance`` and ``KeysightE4980A.range`` now return
``float``.
- ``RohdeSchwarzZNBChannel.bandwidth`` now returns ``float``, e.g. ``10000.0`` instead of
``10000``.
- The channel ``state`` and ``direct_output`` and the instrument ``DC_output`` of
``TektronixAWG5014`` now return ``bool``. They accept ``True``/``False``, ``1``/``0`` and
``"on"``/``"off"``. ``TektronixAWG5014.sequence_pos`` now returns ``int``.
- ``KeysightB1520A.ac_dc_volt_monitor`` now returns ``bool`` and also accepts ``1``/``0``
and ``"on"``/``"off"``.
39 changes: 39 additions & 0 deletions docs/changes/newsfragments/8658.improved_driver
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Most instrument driver parameters are now annotated with the type of their value, e.g.
``Parameter[float, Self]``, so static type checkers can infer the type returned by ``get``
and accepted by ``set``. As part of this, the mock instruments no longer pass the default
``parameter_class=Parameter`` explicitly, and ``Keysight34980A.module`` is typed as a mapping
from slot number to switch matrix submodule.

Fixed the following driver bugs found along the way:

- ``RigolDS4000.enable_auto_scale`` always read back as ``True``, since ``bool("0")`` is
``True``, and was set with ``True``/``False`` instead of ``1``/``0``.
- ``RohdeSchwarzRTO1000.trigger_mode`` queried the trigger source instead of the trigger mode.
- ``Keithley6500.digits`` sent a set command with a stray ``?``.
- ``MessageBuilder.pch_query`` of the Keysight B1500 sent ``PCH`` instead of ``PCH?``.
- ``LakeshoreModel325Heater.output_range`` accepted the high (25 W) range on loop 2, which is
only supported on loop 1.
- ``LakeshoreModel325Sensor.curve_index`` now accepts ``0`` (no curve), which the instrument
also reports when the selected curve does not match the input, and rejects non-integer values.
Whole-number floats such as ``23.0`` are still accepted and sent as integers.
- The ``LakeshoreModel325`` curve list now includes user curve 35, so ``upload_curve(35, ...)``
no longer raises an ``IndexError``.
- ``LakeshoreModel325Curve.get_data`` now reads all 200 points of a curve instead of 199.
- ``LakeshoreModel325Curve.set_data`` now writes curve points with 6 significant digits, the
resolution of the instrument, instead of rounding them to 3 decimals.
- ``LakeshoreModel325Sensor.curve`` now raises a ``RuntimeError`` when no curve is selected for
the sensor, instead of returning a curve 0, which the instrument does not have.
- ``RohdeSchwarzZNBChannel.bandwidth`` failed to read a non-integer bandwidth such as 1.5 Hz,
which the instrument supports.
- The ``current_compliance`` and ``power_compliance`` of the ``KeysightB1517A`` sweep could not
be set back to ``None``, which leaves the compliance out of the ``WV`` command. Since a power
compliance can only be sent together with a current compliance, clearing the current
compliance also clears the power compliance.
- ``Keysight34980A.scan_slots`` can now be called again; it skips slots that already have a
module instead of failing to register a duplicate submodule.
- ``Keithley7510DigitizeSense.aperture`` was labelled in ``us`` although the instrument uses
seconds; its unit is now ``s``.
- ``averages``, ``points`` and ``active_trace`` of the Keysight PNA (``KeysightPNABase``) drivers
Comment thread
jenshnielsen marked this conversation as resolved.
now reject non-integer values. Previously ``averages`` failed to format a float such as
``2.5`` and the others sent it to the instrument. Whole-number floats such as ``2.0`` are
still accepted and sent as integers.
30 changes: 30 additions & 0 deletions src/qcodes/instrument/sims/Agilent_E8257D.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SIMULATED INSTRUMENT FOR Agilent E8257D
# Only covers what is needed to create the driver and switch the RF output.
# The installed options are frequency option 520 (20 GHz) and the step
# attenuator (1E1).
spec: "1.0"
devices:
device 1:
eom:
GPIB INSTR:
q: "\n"
r: "\n"
error: ERROR
dialogues:
- q: "*IDN?"
r: "Agilent Technologies, E8257D, US00000000, C.06.28"
- q: "DIAG:CPU:INFO:OPT:DET?"
r: "1E1,520,UNT"

properties:
output_enabled:
default: "0"
getter:
q: ":OUTP?"
r: "{}"
setter:
q: "OUTP {}"

resources:
GPIB::1::INSTR:
device: device 1
41 changes: 41 additions & 0 deletions src/qcodes/instrument/sims/Agilent_E8267C.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
spec: "1.0"
devices:
device 1:
eom:
GPIB INSTR:
q: "\n"
r: "\n"
error: ERROR
dialogues:
- q: "*IDN?"
r: "Agilent Technologies, E8267C, US00000000, C.04.84"

properties:
power:
default: 0
getter:
q: "POW?"
r: "{}"
setter:
q: "POW {}"

power_offset:
default: 0
getter:
q: "POW:OFFS?"
r: "{}"
setter:
q: "POW:OFFS {}"

pulse_width:
# *RST value according to the E8257D/67D SCPI command reference
default: "+1.00000000E-006"
getter:
q: "PULM:INT:PWID?"
r: "{}"
setter:
q: "PULM:INT:PWID {}"

resources:
GPIB::1::INSTR:
device: device 1
36 changes: 36 additions & 0 deletions src/qcodes/instrument/sims/Keithley_2450.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,42 @@ devices:
setter:
q: "TRACe:CLEar"

sense_count:
default: 1
getter:
q: ":SENSe:COUNt?"
r: "{}"
setter:
q: ":SENSe:COUNt {}"
specs:
type: int

line_frequency:
default: "5.000000E+01"
getter:
q: ":SYSTem:LFRequency?"
r: "{}"

sense_current_nplc:
default: 1
getter:
q: ":SENSe:current:NPLCycles?"
r: "{}"
setter:
q: ":SENSe:current:NPLCycles {}"
specs:
type: float

source_current_delay:
default: 0
getter:
q: ":SOURce:current:DELay?"
r: "{}"
setter:
q: ":SOURce:current:DELay {}"
specs:
type: float

resources:
GPIB::1::INSTR:
device: device wrong_mode
Expand Down
38 changes: 38 additions & 0 deletions src/qcodes/instrument/sims/Keithley_6500.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
spec: "1.0"
devices:
device 1:
eom:
GPIB INSTR:
q: "\n"
r: "\n"
error: ERROR
dialogues:
- q: "*IDN?"
r: "KEITHLEY INSTRUMENTS,MODEL DMM6500,04000000,1.0.0"
- q: "*LANG?"
r: "SCPI"

properties:
data_format:
default: ASCII
getter:
q: "FORM:DATA?"
r: "{}"
setter:
q: "FORM:DATA {}"

display_digits:
default: 6
getter:
q: "DISP:VOLT:DC:DIG?"
r: "{}"
setter:
q: "DISP:VOLT:DC:DIG {}"
specs:
type: int
min: 4
max: 7

resources:
GPIB::1::INSTR:
device: device 1
17 changes: 17 additions & 0 deletions src/qcodes/instrument/sims/Keysight_E4980A.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,23 @@ devices:
setter:
q: ":CURRent:LEVel {}"

impedance_range:
# preset value according to the E4980A/AL user's guide
default: "+1.00000E+02"
getter:
q: ":FUNCtion:IMPedance:RANGe?"
r: "{}"
setter:
q: ":FUNCtion:IMPedance:RANGe {}"

impedance_autorange:
default: 1
getter:
q: ":FUNCtion:IMPedance:RANGe:AUTO?"
r: "{}"
setter:
q: ":FUNCtion:IMPedance:RANGe:AUTO {}"

resources:
GPIB::1::INSTR:
device: device 1
65 changes: 65 additions & 0 deletions src/qcodes/instrument/sims/Keysight_N5222B.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SIMULATED INSTRUMENT FOR Keysight PNA N5222B
# Only covers what is needed to create the driver and a few parameters.
# The instrument has a single measurement "CH1_S11_1" (trace number 1).
# Commands that are only written are modelled as properties with a setter
# without a response, so that they do not leave a reply in the read buffer.
spec: "1.0"
devices:
N5222B:
eom:
GPIB INSTR:
q: "\n"
r: "\n"
error: ERROR
dialogues:
- q: "*IDN?"
r: "Keysight Technologies,N5222B,MY12345678,A.13.95.09"
- q: "*OPT?"
r: '""'
- q: "CALC:PAR:CAT:EXT?"
r: '"CH1_S11_1,S11"'

properties:

data_format:
default: "REAL,32"
setter:
q: "FORM {}"

byte_order:
default: "NORM"
setter:
q: "FORM:BORD {}"

selected_measurement_name:
default: "'CH1_S11_1'"
setter:
q: "CALC:PAR:SEL {}"

active_trace:
default: 1
getter:
q: "CALC:PAR:MNUM?"
r: "{}"
setter:
q: "CALC:PAR:MNUM {}"

averages:
default: 1
getter:
q: "SENS:AVER:COUN?"
r: "{}"
setter:
q: "SENS:AVER:COUN {}"

points:
default: 201
getter:
q: "SENS:SWE:POIN?"
r: "{}"
setter:
q: "SENS:SWE:POIN {}"

resources:
GPIB::1::INSTR:
device: N5222B
19 changes: 18 additions & 1 deletion src/qcodes/instrument/sims/RTO_1000.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ devices:
q: "TRIGger1:SOURce?"
r: "{}"
setter:
q: "TRIGger1:SOURce? {}"
q: "TRIGger1:SOURce {}"

trigger level 1:
default: 0
Expand All @@ -35,6 +35,14 @@ devices:
setter:
q: "TRIGger1:LEVel1 {}"

trigger mode:
default: AUTO
getter:
q: "TRIGger:MODE?"
r: "{}"
setter:
q: "TRIGger:MODE {}"

channel range 1:
default: 5
getter:
Expand All @@ -49,6 +57,15 @@ devices:
setter:
q: "CHANnel1:OFFSet {}"

channel impedance 1:
# *RST value according to the R&S RTO user manual
default: 50
getter:
q: "CHANnel1:IMPedance?"
r: "{}"
setter:
q: "CHANnel1:IMPedance {}"

resources:
GPIB::1::INSTR:
device: device 1
Loading
Loading