{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Qcodes example with Lakeshore 311" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:52:00.433389Z", "start_time": "2019-03-05T08:51:58.913404Z" } }, "outputs": [], "source": [ "from qcodes_contrib_drivers.drivers.Lakeshore.Model_331 import Model_331" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Initialize instrument\n", "We connect to the instrument using its GPIB address." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:52:01.353380Z", "start_time": "2019-03-05T08:52:01.203381Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: LSCI 331S (serial:331259, firmware:032301) in 0.13s\n" ] } ], "source": [ "lakeshore = Model_331(name=\"Lakeshore\", address='GPIB0::12::INSTR')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Read temperatures\n", "We read the temperatures for both channels." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:52:02.913364Z", "start_time": "2019-03-05T08:52:02.853365Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "temperature A : 294.63 K\n", "temperature B : 284.32 K\n" ] } ], "source": [ "print(lakeshore.A.temperature.label, ': ', lakeshore.A.temperature.get(), lakeshore.A.temperature.unit)\n", "print(lakeshore.B.temperature.label, ': ', lakeshore.B.temperature.get(), lakeshore.B.temperature.unit)" ] }, { "cell_type": "markdown", "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:47:08.800305Z", "start_time": "2019-03-05T08:47:08.780305Z" } }, "source": [ "## Heater configuration\n", "We read the heater output, heater range, heater input channel and heater setpoint." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:52:04.353350Z", "start_time": "2019-03-05T08:52:04.293350Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "heater output : 0.0 %\n", "heater range : off \n", "input : A \n", "setpoint : 290.0 K\n" ] } ], "source": [ "print(lakeshore.heater_output.label, ': ', lakeshore.heater_output.get(), lakeshore.heater_output.unit)\n", "print(lakeshore.heater_range.label, ': ', lakeshore.heater_range.get(), lakeshore.heater_range.unit)\n", "print(lakeshore.input.label, ': ', lakeshore.input.get(), lakeshore.input.unit)\n", "print(lakeshore.setpoint.label, ': ', lakeshore.setpoint.get(), lakeshore.setpoint.unit)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now let's turn on the heater and read the status again." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:52:12.775266Z", "start_time": "2019-03-05T08:52:12.745266Z" } }, "outputs": [], "source": [ "lakeshore.setpoint.set(300)\n", "lakeshore.heater_range.set('5W')" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:52:17.365220Z", "start_time": "2019-03-05T08:52:17.295220Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "heater output : 100.0 %\n", "heater range : 5W \n", "input : A \n", "setpoint : 300.0 K\n" ] } ], "source": [ "print(lakeshore.heater_output.label, ': ', lakeshore.heater_output.get(), lakeshore.heater_output.unit)\n", "print(lakeshore.heater_range.label, ': ', lakeshore.heater_range.get(), lakeshore.heater_range.unit)\n", "print(lakeshore.input.label, ': ', lakeshore.input.get(), lakeshore.input.unit)\n", "print(lakeshore.setpoint.label, ': ', lakeshore.setpoint.get(), lakeshore.setpoint.unit)" ] }, { "cell_type": "markdown", "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:50:58.823005Z", "start_time": "2019-03-05T08:50:58.803005Z" } }, "source": [ "Now turn the heater off again." ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:52:21.295180Z", "start_time": "2019-03-05T08:52:21.275181Z" } }, "outputs": [], "source": [ "lakeshore.heater_range.set('off')" ] }, { "cell_type": "markdown", "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:51:44.133552Z", "start_time": "2019-03-05T08:51:44.123552Z" } }, "source": [ "## Close the instrument" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2019-03-05T08:52:22.555168Z", "start_time": "2019-03-05T08:52:22.535168Z" } }, "outputs": [], "source": [ "lakeshore.close()" ] } ], "metadata": { "hide_input": false, "kernelspec": { "display_name": "Python 3", "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.6.8" }, "nbsphinx": { "execute": "never" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }