{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# QCoDeS Example with Tektronix Keithley 7510 Multimeter\n", "\n", "In this example we will show how to use a few basic functions of the Keithley 7510 DMM. We attached the 1k Ohm resistor to the front terminals, with no source current or voltage.\n", "\n", "For more detail about the 7510 DMM, please see the User's Manual: https://www.tek.com/digital-multimeter/high-resolution-digital-multimeters-manual/model-dmm7510-75-digit-graphical-sam-0, or Reference Manual: https://www.tek.com/digital-multimeter/high-resolution-digital-multimeters-manual-9" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from qcodes.instrument_drivers.tektronix.keithley_7510 import Keithley7510" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: KEITHLEY INSTRUMENTS DMM7510 (serial:04450363, firmware:1.6.7d) in 0.07s\n" ] } ], "source": [ "dmm = Keithley7510(\"dmm_7510\", 'USB0::0x05E6::0x7510::04450363::INSTR')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## To reset the system to default settings:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "dmm.reset()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## To perform measurement with different sense functions:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "When first turned on, the default sense function is for DC voltage" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'voltage'" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.function()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "to perform the measurement:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-3.910893e-06" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.voltage()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There'll be an error if try to call other functions, such as current:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "'Sense7510' object and its delegates have no attribute 'current'\n" ] } ], "source": [ "try:\n", " dmm.sense.current()\n", "except AttributeError as err:\n", " print(err)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To switch between functions, do the following:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'current'" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.function('current')\n", "dmm.sense.function()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.054986e-11" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.current()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And of course, once the sense function is changed to 'current', the user can't make voltage measurement" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "'Sense7510' object and its delegates have no attribute 'voltage'\n" ] } ], "source": [ "try:\n", " dmm.sense.voltage()\n", "except AttributeError as err:\n", " print(err)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The available functions in the driver now are 'voltage', 'current', 'Avoltage', 'Acurrent', 'resistance', and 'Fresistance', where 'A' means 'AC', and 'F' means 'Four-wire'" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(\"'ac current' is not in {'current', 'Acurrent', 'resistance', 'Fresistance', 'Avoltage', 'voltage'}; Parameter: dmm_7510.sense_function\", 'setting dmm_7510_sense_function to ac current')\n" ] } ], "source": [ "try:\n", " dmm.sense.function('ac current')\n", "except ValueError as err:\n", " print(err)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## To set measurement range (positive full-scale measure range):" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, the auto range is on" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can change it to 'off' as following" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_range(0)\n", "dmm.sense.auto_range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note: this auto range setting is for the sense function at this moment, which is 'current'" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'current'" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.function()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If switch to another function, the auto range is still on, by default" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'voltage'" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.function('voltage')\n", "dmm.sense.function()" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "to change the range, use the following" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "dmm.sense.range(10)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10.0" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This will also automatically turn off the auto range:" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "the allowed range (upper limit) value is a set of discrete numbers, for example, 100mV, 1V, 10V, 100V, 100V. If a value other than those allowed values is input, the system will just use the \"closest\" one:" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1000.0" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.range(150)\n", "dmm.sense.range()" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "100.0" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.range(105)\n", "dmm.sense.range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The driver will not give any error messages for the example above, but if the value is too large or too small, there'll be an error message:" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "('0.0001 is invalid: must be between 0.1 and 1000 inclusive; Parameter: dmm_7510_sense.range', 'setting dmm_7510_sense_range to 0.0001')\n" ] } ], "source": [ "try:\n", " dmm.sense.range(0.0001)\n", "except ValueError as err:\n", " print(err)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## To set the NPLC (Number of Power Line Cycles) value for measurements:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, the NPLC is 1 for each sense function" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.0" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.nplc()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To set the NPLC value:" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.1" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.nplc(.1)\n", "dmm.sense.nplc()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Same as the 'range' variable, each sense function has its own NPLC value:" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'resistance'" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.function('resistance')\n", "dmm.sense.function()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.0" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.nplc()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## To set the delay:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, the auto delay is enabled. According to the guide, \"When this is enabled, a delay is added after a range or function change to allow the instrument to settle.\" But it's unclear how much the delay is." ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "scrolled": false }, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_delay()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To turn off the auto delay:" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_delay(0)\n", "dmm.sense.auto_delay()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To turn the auto delay back on:" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_delay(1)\n", "dmm.sense.auto_delay()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There is also an \"user_delay\", but it is designed for rigger model, please see the user guide for detail." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To set the user delay time:\n", "\n", "First to set a user number to relate the delay time with: (default user number is empty, so an user number has to be set before setting the delay time)" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.user_number(1)\n", "dmm.sense.user_number()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, the user delay is 0s:" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'0'" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.user_delay()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Then to set the user delay as following:" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'0.1'" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.user_delay(0.1)\n", "dmm.sense.user_delay()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The user delay is tied to user number:" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.user_number(2)\n", "dmm.sense.user_number()" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'0'" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.user_delay()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For the record, the auto delay here is still on:" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_delay()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## To set auto zero (automatic updates to the internal reference measurements):" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, the auto zero is on" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_zero()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To turn off auto zero:" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_zero(0)\n", "dmm.sense.auto_zero()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The auto zero setting is also tied to each function, not universal:" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'current'" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.function('current')\n", "dmm.sense.function()" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.auto_zero()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There is way to ask the system to do auto zero once:" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [], "source": [ "dmm.sense.auto_zero_once()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "See P487 of the Reference Manual for how to use auto zero ONCE. Note: it's not funtion-dependent." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## To set averaging filter for measurements, including average count, and filter type:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, averaging is off:" ] }, { "cell_type": "code", "execution_count": 40, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.average()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To turn it on:" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.average(1)\n", "dmm.sense.average()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Default average count value is 10, **remember to turn average on**, or it will not work:" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'10'" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.average_count()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To change the average count:" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'23'" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.average_count(23)\n", "dmm.sense.average_count()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The range for average count is 1 to 100:" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "('200 is invalid: must be between 1 and 100 inclusive; Parameter: dmm_7510_sense.average_count', 'setting dmm_7510_sense_average_count to 200')\n" ] } ], "source": [ "try:\n", " dmm.sense.average_count(200)\n", "except ValueError as err:\n", " print(err)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are two average types, repeating (default) or moving filter:" ] }, { "cell_type": "code", "execution_count": 45, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'REP'" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.average_type()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To make changes:" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'MOV'" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dmm.sense.average_type('MOV')\n", "dmm.sense.average_type()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "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" } }, "nbformat": 4, "nbformat_minor": 2 }