Skip to content

Commit 9a007d1

Browse files
jenshnielsenWilliamHPNielsen
authored andcommitted
Mercury when aborting a ramp switch the magnet to hold (#792)
1 parent 139c3a8 commit 9a007d1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

qcodes/instrument_drivers/oxford/mercuryiPS.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,12 @@ def _ramp_to_setpoint(self, ax, cmd, setpoint):
207207
self._set_fld(ax, cmd, setpoint)
208208
self.rtos()
209209
if self.hold_after_set():
210-
while not all(['HOLD' == getattr(self, a.lower() + '_ACTN')() for a in ax]):
211-
time.sleep(0.1)
210+
try:
211+
while not all(['HOLD' == getattr(self, a.lower() + '_ACTN')() for a in ax]):
212+
time.sleep(0.1)
213+
except KeyboardInterrupt:
214+
self.hold()
215+
raise KeyboardInterrupt
212216

213217
def _ramp_to_setpoint_and_wait(self, ax, cmd, setpoint):
214218
error = 0.2e-3

0 commit comments

Comments
 (0)