Skip to content

Commit

Permalink
change to block_during_ramp param
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsharpe committed Nov 20, 2023
1 parent 723d75b commit 90916e8
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 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 @@ -385,6 +385,7 @@ class Keithley2450Source(InstrumentChannel):
def __init__(self, parent: "Keithley2450", name: str, proper_function: str) -> None:
super().__init__(parent, name)
self._proper_function = proper_function
self._block = False
range_vals = self.function_modes[self._proper_function]["range_vals"]
unit = self.function_modes[self._proper_function]["unit"]

Expand Down Expand Up @@ -472,9 +473,22 @@ def __init__(self, parent: "Keithley2450", name: str, proper_function: str) -> N
"when making a measurement.",
)

def _set_proper_function(self, value: float, block: bool = True) -> None:
self.add_parameter(
"block_during_ramp",
get_cmd=self._block,
set_cmd=self._set_block,
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_block(self, value: bool) -> None:
self._block = value

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

def get_sweep_axis(self) -> np.ndarray:
Expand Down

0 comments on commit 90916e8

Please sign in to comment.