Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions docs/changes/newsfragments/8697.breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
The ``current``, ``current_range`` and ``current_limit`` parameters of the ``YokogawaGS200``,
and its ``measure`` parameter in voltage source mode, now use the unit ``A`` instead of ``I``.
The ``ramp_rate`` and ``ramp_step`` parameters now start with the units ``A/s`` and ``A``
instead of ``V/s`` and ``V`` if the instrument is in current source mode when connecting, as
they already did after changing the source mode.

``YokogawaGS200Monitor.delay`` (``measure.delay``) is now in seconds, the unit the instrument
uses, instead of ms. The value was already sent to the instrument unconverted, so
``delay(500)`` set a delay of 500 s despite the ``ms`` unit. The parameter now accepts values
from 0 to 999.999 s in steps of 1 ms, e.g. ``delay(0.5)`` for 500 ms, and returns the delay
as a ``float`` in seconds instead of an ``int`` rounded to whole seconds.
16 changes: 16 additions & 0 deletions docs/changes/newsfragments/8697.improved_driver
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The remaining parameters of the ``YokogawaGS200`` driver are now annotated with the type of
their value, e.g. ``Parameter[float, Self]``. ``YokogawaGS200Program.count`` is annotated as
``int | Literal["MIN", "MAX"]``: it can be set to ``"MIN"`` or ``"MAX"``, and getting it
always returns an integer, but until it is read again the cached value is the keyword that was
set. The status register parameters return the ``StatusByte``, ``StandardEventRegister``,
``ExtendedEventRegister`` and ``ConditionRegister`` flags as before, and are now annotated as
such.

Fixed the following driver bugs found along the way:

- ``YokogawaGS200.ramp_voltage`` and ``ramp_current`` raised a ``TypeError`` when called with
``ramp_mode="SOFTWARE"``. They now perform the software ramp, and raise a ``ValueError`` if
``ramp_step`` is 0, which would otherwise jump directly to the target.
- A software ramp of the ``YokogawaGS200`` to a target outside the output range of the present
source range now raises before changing the output. Previously it stepped up to the limit of
the range before raising.
91 changes: 90 additions & 1 deletion src/qcodes/instrument/sims/Yokogawa_GS200.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,29 @@ devices:
r: "QCoDeS Yokogawa Mock,GS200,xxxxxxxx,MOCKFW"
- q: "*OPT?"
r: "NO OPTIONS"
# Status registers, see GS200 User's Manual IM GS210-01EN, 13.3.
# *STB?: RQS (bit 6) and EAV (bit 2)
- &stb
q: "*STB?"
r: "68"
# *ESR?: CME (bit 5)
- &esr
q: "*ESR?"
r: "32"
# :STAT:EVEN?: EOP (bit 7) and SCG (bit 5)
- &stat_even
q: ":STAT:EVEN?"
r: "160"
# :STAT:COND?: RFP (bit 8)
- &stat_cond
q: ":STAT:COND?"
r: "256"
# Only queried when *STB? reports EAV, so always return an error.
- &syst_err
q: ":SYSTem:ERRor?"
r: '-222,"Data out of range"'

properties:
properties: &gs200_properties
mode:
default: "VOLT"
getter:
Expand Down Expand Up @@ -45,15 +66,83 @@ devices:
q: ":SOUR:LEV {:e}"
specs:
type: float
# pyvisa-sim cannot convert MIN/MAX to the step numbers 1/10000 as the
# instrument does, so only set this to integers when reading it back.
program_count:
default: 1
getter:
q: ":PROG:COUN?"
r: "{}"
setter:
q: ":PROG:COUN {}"
Comment thread
jenshnielsen marked this conversation as resolved.
Resolved
auto_level:
default: 0.0
setter:
q: ":SOUR:LEV:AUTO {:e}"
specs:
type: float
# Measurement (/MON option) settings, only used by device 2
measurement_enabled:
default: 0
getter:
q: ":SENS?"
r: "{}"
setter:
q: ":SENS {}"
nplc:
default: "+1.0E+00"
getter:
q: ":SENS:NPLC?"
r: "{}"
setter:
q: ":SENS:NPLC {}"
measurement_delay:
default: "+0.0E+00"
getter:
q: ":SENS:DEL?"
r: "{}"
setter:
q: ":SENS:DEL {}"
measurement_trigger:
default: "READ"
getter:
q: ":SENS:TRIG?"
r: "{}"
setter:
q: ":SENS:TRIG {}"
measurement_interval:
default: "+0.5E+00"
getter:
q: ":SENS:INT?"
r: "{}"
setter:
q: ":SENS:INT {}"

# A GS200 with the /MON (monitoring) option
device 2:
eom:
GPIB INSTR:
q: "\n"
r: "\n"
error: ERROR
dialogues:
- q: "*IDN?"
r: "QCoDeS Yokogawa Mock,GS200,xxxxxxxx,MOCKFW"
- q: "*OPT?"
r: "/MON"
# Same status register and error responses as device 1
- *stb
- *esr
- *stat_even
- *stat_cond
- *syst_err
- q: ":MEAS?"
r: "+1.23450E-03"

properties: *gs200_properties

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