Skip to content

Commit

Permalink
Merge pull request #5547 from aaronsharpe/main
Browse files Browse the repository at this point in the history
Optional blocking in Keithley 2450
  • Loading branch information
jenshnielsen authored Nov 24, 2023
2 parents d917e4e + eb439f8 commit 8403882
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/changes/newsfragments/improved_driver.5547
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Keithley 2450s by default don't block when setting their output level, differing in behavior from the keithley 2400.
I added a manual boolian parameter 'block_during_ramp' which forces a check that the ramp command has been completed when True.
20 changes: 18 additions & 2 deletions src/qcodes/instrument_drivers/Keithley/Keithley_2450.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
create_on_off_val_mapping,
invert_val_mapping,
)
from qcodes.validators import Arrays, Enum, Ints, Lists, Numbers
from qcodes.validators import Arrays, Bool, Enum, Ints, Lists, Numbers


class _SweepDict(TypedDict):
Expand Down Expand Up @@ -424,7 +424,7 @@ def __init__(self, parent: "Keithley2450", name: str, proper_function: str) -> N

self.add_parameter(
self._proper_function,
set_cmd=f"SOUR:{self._proper_function} {{}}",
set_cmd=self._set_proper_function,
get_cmd=f"SOUR:{self._proper_function}?",
get_parser=float,
unit=unit,
Expand Down Expand Up @@ -472,6 +472,22 @@ def __init__(self, parent: "Keithley2450", name: str, proper_function: str) -> N
"when making a measurement.",
)

self.add_parameter(
"block_during_ramp",
initial_value=False,
get_cmd=None,
set_cmd=None,
vals=Bool(),
docstring="Setting the source output level alone cannot block the "
"execution of subsequent code. This parameter allows _proper_function"
"to either block or not.",
)

def _set_proper_function(self, value: float) -> None:
self.write(f"SOUR:{self._proper_function} {value}")
if self.block_during_ramp():
self.ask("*OPC?")

def get_sweep_axis(self) -> np.ndarray:
if self._sweep_arguments is None:
raise ValueError(
Expand Down

0 comments on commit 8403882

Please sign in to comment.