-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QSwitch driver with monitor support (#266)
* QSwitch QCodes driver with monitor support * Make compatible with 3.9 * More robust serial communication * New API with auto-grounding
- Loading branch information
Showing
19 changed files
with
1,619 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "c08d6367", | ||
"metadata": {}, | ||
"source": [ | ||
"# QSwitch debugging\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "85f2a1e0", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Connected to: Quantum Machines QSwitch (serial:5, firmware:0.160) in 0.11s\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import pprint\n", | ||
"pp = pprint.PrettyPrinter()\n", | ||
"from qcodes_contrib_drivers.drivers.QDevil import QSwitch\n", | ||
"qswitch_addr = '192.168.8.18'\n", | ||
"qswitch = QSwitch.QSwitch('switch', visalib='@py', address=f'TCPIP::{qswitch_addr}::5025::SOCKET')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "5c6c00b2", | ||
"metadata": {}, | ||
"source": [ | ||
" You can record the underlying SCPI commands that are sent to the QSwitch:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "d0c7fc28", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"qswitch.start_recording_scpi()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "64f0cbe6", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"'0,\"No error\"'" | ||
] | ||
}, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"qswitch.reset()\n", | ||
"qswitch.arrange(\n", | ||
" breakouts={'DMM': 5, 'VNA': 7},\n", | ||
" lines={'plunger': 23, 'sensor': 5})\n", | ||
"qswitch.connect('sensor')\n", | ||
"qswitch.breakout('sensor', 'DMM')\n", | ||
"qswitch.errors()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "0d8a7693", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"['*rst', 'stat?', 'clos (@5!9)', 'open (@5!0)', 'clos (@5!5)', 'all?']\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"pp.pprint(qswitch.get_recorded_scpi_commands())" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "4a00d73e-88e0-439c-9b80-15aaffaf2064", | ||
"metadata": {}, | ||
"source": [ | ||
"If you are connecting via USB, then you need `pyserial` installed." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "37ac76f2", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"('ASRL/dev/ttyS0::INSTR', 'ASRL/dev/ttyACM0::INSTR')" | ||
] | ||
}, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"import pyvisa\n", | ||
"rm = pyvisa.ResourceManager('@py')\n", | ||
"rm.list_resources()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"id": "d6bdb22e", | ||
"metadata": {}, | ||
"source": [ | ||
"See https://github.com/QDevil/qdac2-tools for more debugging tools." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.12" | ||
}, | ||
"nbsphinx": { | ||
"execute": "never" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.