diff --git a/qcodes/instrument_drivers/QDev/QDac.py b/qcodes/instrument_drivers/QDev/QDac.py index f7d1221f247..0432ca93754 100644 --- a/qcodes/instrument_drivers/QDev/QDac.py +++ b/qcodes/instrument_drivers/QDev/QDac.py @@ -156,6 +156,22 @@ def __init__(self, name, address, num_chans=48, update_currents=True): set_cmd='ver {}', val_mapping={True: 1, False: 0}) + self.add_parameter(name='fast_voltage_set', + label='fast voltage set', + parameter_class=ManualParameter, + vals=vals.Bool(), + initial_value=False, + docstring=""""Toggles if DC voltage set should unset any ramp attached to this channel. + If you enable this you should ensure thay any function generator is unset + from the channel before setting voltage""") + self.add_parameter(name='voltage_set_dont_wait', + label='voltage set dont wait', + parameter_class=ManualParameter, + vals=vals.Bool(), + initial_value=False, + docstring=""""If enabled the voltage set does not wait for a reply from the + qdac. This is experimental and may break but has the potential to speed up + stepping the qdac""") # Initialise the instrument, all channels DC (unbind func. generators) for chan in self.chan_range: # Note: this call does NOT change the voltage on the channel @@ -208,18 +224,19 @@ def _set_voltage(self, chan, v_set): self._assigned_fgs[chan] = fg # We need .get and not get_latest in case a ramp was interrupted v_start = self.parameters['ch{:02}_v'.format(chan)].get() - time = abs(v_set-v_start)/slope - log.info('Slope: {}, time: {}'.format(slope, time)) + mytime = abs(v_set-v_start)/slope + log.info('Slope: {}, time: {}'.format(slope, mytime)) # Attenuation compensation and syncing # happen inside _rampvoltage - self._rampvoltage(chan, fg, v_start, v_set, time) + self._rampvoltage(chan, fg, v_start, v_set, mytime) else: # compensate for the 0.1 multiplier, if it's on if self.parameters['ch{:02}_vrange'.format(chan)].get_latest() == 1: v_set = v_set*10 # set the mode back to DC in case it had been changed - self.write('wav {} 0 0 0'.format(chan)) - self.write('set {} {:.6f}'.format(chan, v_set)) + if not self.fast_voltage_set(): + self.write('wav {} 0 0 0'.format(chan)) + self.write('set {} {:.6f}'.format(chan, v_set), fast=self.voltage_set_dont_wait()) def _set_vrange(self, chan, switchint): """ @@ -535,7 +552,7 @@ def _rampvoltage(self, chan, fg, v_start, setvoltage, ramptime): self.write(funmssg) - def write(self, cmd): + def write(self, cmd, fast=False): """ QDac always returns something even from set commands, even when verbose mode is off, so we'll override write to take this out @@ -553,7 +570,8 @@ def write(self, cmd): nr_bytes_written, ret_code = self.visa_handle.write(cmd) self.check_error(ret_code) - self._write_response = self.visa_handle.read() + if not fast: + self._write_response = self.visa_handle.read() def read(self): return self.visa_handle.read() diff --git a/qcodes/instrument_drivers/stanford_research/SR830.py b/qcodes/instrument_drivers/stanford_research/SR830.py index b7d315cd3c8..1b0827f6231 100644 --- a/qcodes/instrument_drivers/stanford_research/SR830.py +++ b/qcodes/instrument_drivers/stanford_research/SR830.py @@ -108,7 +108,8 @@ def get(self): # parse it realdata = np.fromstring(rawdata, dtype='