From aba0a0ca691662861aa3a7de5e18799e98f14244 Mon Sep 17 00:00:00 2001 From: Jens Peter Secher Date: Wed, 22 Nov 2023 15:51:18 +0100 Subject: [PATCH 1/3] Fix sweep generation --- docs/examples/QDevil/QDAC2/Sweep.ipynb | 5 +++-- qcodes_contrib_drivers/drivers/QDevil/QDAC2.py | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/examples/QDevil/QDAC2/Sweep.ipynb b/docs/examples/QDevil/QDAC2/Sweep.ipynb index dd159fab6..8841ef600 100644 --- a/docs/examples/QDevil/QDAC2/Sweep.ipynb +++ b/docs/examples/QDevil/QDAC2/Sweep.ipynb @@ -126,6 +126,7 @@ "source": [ "dc_sweep = qdac.ch03.dc_sweep(\n", " repetitions=2,\n", + " stepped=True,\n", " start_V=-1,\n", " stop_V=1,\n", " points=11,\n", @@ -247,7 +248,7 @@ ], "metadata": { "kernelspec": { - "display_name": "qcodespip311", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -261,7 +262,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.0 | packaged by conda-forge | (main, Jan 16 2023, 14:12:30) [MSC v.1916 64 bit (AMD64)]" + "version": "3.10.12" }, "nbsphinx": { "execute": "never" diff --git a/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py b/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py index 5baa7f4aa..160cf7afd 100644 --- a/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py +++ b/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py @@ -7,7 +7,7 @@ from pyvisa.errors import VisaIOError from qcodes.utils import validators from typing import NewType, Tuple, Sequence, List, Dict, Optional -from packaging.version import Version, parse +from packaging.version import parse import abc # Version 1.8.0 @@ -400,7 +400,7 @@ def __init__(self, channel: 'QDac2Channel', start_V: float, stop_V: float, channel.write_channel('sour{0}:volt:mode swe') self._set_voltages(start_V, stop_V) channel.write_channel(f'sour{"{0}"}:swe:poin {points}') - self._set_trigger_mode(stepped) + self._set_generation_mode(stepped) channel.write_channel(f'sour{"{0}"}:swe:dwel {dwell_s}') super()._set_delay(delay_s) self._set_direction(backwards) @@ -411,10 +411,10 @@ def _set_voltages(self, start_V: float, stop_V: float): self._write_channel(f'sour{"{0}"}:swe:star {start_V}') self._write_channel(f'sour{"{0}"}:swe:stop {stop_V}') - def _set_trigger_mode(self, stepped: bool) -> None: + def _set_generation_mode(self, stepped: bool) -> None: if stepped: return self._write_channel('sour{0}:swe:gen step') - self._write_channel('sour{0}:swe:gen auto') + self._write_channel('sour{0}:swe:gen anal') def _set_direction(self, backwards: bool) -> None: if backwards: @@ -1578,7 +1578,7 @@ def dc_sweep(self, start_V: float, stop_V: float, points: int, dwell_s (float, optional): Seconds between each voltage (default 1ms) delay_s (float, optional): Seconds of delay after receiving a trigger (default 0) backwards (bool, optional): Sweep in reverse (default is forward) - stepped (bool, optional): True means that each step needs to be triggered (default False) + stepped (bool, optional): True means discrete steps (default True) Returns: Sweep_Context: context manager From 6124a66d82acdd823dbf4bd3dd1b2d7f1c9854f6 Mon Sep 17 00:00:00 2001 From: Jens Peter Secher Date: Wed, 22 Nov 2023 15:57:20 +0100 Subject: [PATCH 2/3] . --- qcodes_contrib_drivers/drivers/QDevil/QDAC2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py b/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py index 160cf7afd..d627e068a 100644 --- a/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py +++ b/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py @@ -10,7 +10,7 @@ from packaging.version import parse import abc -# Version 1.8.0 +# Version 1.9.0 # # Guiding principles for this driver for QDevil QDAC-II # ----------------------------------------------------- From ff0ac4bdcfb4aec6accb9116bb74c70ae7a681f9 Mon Sep 17 00:00:00 2001 From: Jens Peter Secher Date: Wed, 3 Jan 2024 15:47:21 +0100 Subject: [PATCH 3/3] Eliminate snapshot warnings regarding ext triggers --- qcodes_contrib_drivers/drivers/QDevil/QDAC2.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py b/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py index d627e068a..7d4a3a36c 100644 --- a/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py +++ b/qcodes_contrib_drivers/drivers/QDevil/QDAC2.py @@ -10,7 +10,7 @@ from packaging.version import parse import abc -# Version 1.9.0 +# Version 1.10.0 # # Guiding principles for this driver for QDevil QDAC-II # ----------------------------------------------------- @@ -28,9 +28,9 @@ # # qdac.n_channels() # -# 3. Allocation of resources should be automated as much as possible, preferably -# by python context managers that automatically clean up on exit. Such -# context managers have a name with a '_Context' suffix. +# 3. Allocation of resources should be automated as much as possible, +# preferably by python context managers that automatically clean up on exit. +# Such context managers have a name with a '_Context' suffix. # # 4. Any generator should by default be set to start on the BUS trigger # (*TRG) so that it is possible to synchronise several generators without @@ -139,14 +139,12 @@ def __init__(self, parent: 'QDac2', name: str, external: int): name='source_from_input', # Route external input to external output set_cmd='outp:trig{0}:sour ext{1}'.format(external, '{}'), - get_parser=int ) self.add_parameter( name='source_from_trigger', # Route internal trigger to external output set_parser=_trigger_context_to_value, set_cmd='outp:trig{0}:sour int{1}'.format(external, '{}'), - get_parser=int ) self.add_parameter( name='width_s', @@ -2058,7 +2056,7 @@ def currents_A(self, nplc: int = 1, current_range: str = "low") -> Sequence[floa channels_suffix = self._all_channels_as_suffix() self._qdac.write(f'sens:rang {current_range},{channels_suffix}') # Wait for relays to finish switching by doing a query - self._qdac.ask(f'*stb?') + self._qdac.ask('*stb?') self._qdac.write(f'sens:nplc {nplc},{channels_suffix}') # Wait for the current sensors to stabilize and then read slowest_line_freq_Hz = 50 @@ -2219,9 +2217,9 @@ def _calculate_detune_values(self, contacts: Sequence[str], start_V: Sequence[fl def leakage(self, modulation_V: float, nplc: int = 2) -> np.ndarray: """Run a simple leakage test between the contacts - Each contact is changed in turn and the resulting change in current from - steady-state is recorded. The resulting resistance matrix is calculated - as modulation_voltage divided by current_change. + Each contact is changed in turn and the resulting change in current + from steady-state is recorded. The resulting resistance matrix is + calculated as modulation_voltage divided by current_change. Args: modulation_V (float): Virtual voltage added to each contact