{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Keithley 2182A Nanovoltmeter - Basic Usage\n", "\n", "This notebook demonstrates the essential functionality of the QCoDeS driver for the Keithley 2182A nanovoltmeter." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Import the driver\n", "from qcodes_contrib_drivers.drivers.Tektronix.Keithley_2182A import Keithley2182A" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Initialize the Instrument" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Connect to the instrument\n", "# Replace with your actual VISA address\n", "k2182a = Keithley2182A(\n", " 'k2182a', \n", " 'GPIB0::1::INSTR', \n", " pyvisa_sim_file='qcodes_contrib_drivers.sims:Keithley_2182A.yaml', # Comment for real instrument\n", " )\n", "\n", "# Check instrument identity\n", "print(\"Connected to:\", k2182a.IDN())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Basic Voltage Measurement" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Configure for basic voltage measurement\n", "k2182a.mode('dc voltage')\n", "k2182a.nplc(1.0) # 1 power line cycle for good balance of speed and accuracy\n", "\n", "# Take a voltage measurement\n", "voltage = k2182a.voltage()\n", "print(f\"Measured voltage: {voltage:.6f} V\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. MEASure vs FETCh Commands" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# MEASure command - triggers a new measurement\n", "measured_value = k2182a._measure_voltage()\n", "print(f\"MEASure result: {measured_value:.6f} V\")\n", "\n", "# FETCh command - gets the last measurement from buffer\n", "fetched_value = k2182a.fetch()\n", "print(f\"FETCh result: {fetched_value:.6f} V\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 4. Noise Reduction Settings" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Switch back to voltage mode\n", "k2182a.mode('dc voltage')\n", "\n", "\n", "# Enable filters\n", "k2182a.analog_filter(True)\n", "k2182a.digital_filter(True)\n", "\n", "# Take a low-noise measurement\n", "voltage = k2182a.voltage()\n", "print(f\"Low-noise measurement: {voltage:.6f} V\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 5. Quick Configuration Presets" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Optimize for maximum accuracy (slower but more precise)\n", "k2182a.optimize_for_low_noise()\n", "voltage_accurate = k2182a.voltage()\n", "print(f\"High accuracy measurement: {voltage_accurate:.6f} V\")\n", "\n", "# Optimize for speed (faster but less precise)\n", "k2182a.optimize_for_speed()\n", "voltage_fast = k2182a.voltage()\n", "print(f\"Fast measurement: {voltage_fast:.6f} V\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 6. Cleanup" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Close the connection\n", "k2182a.close()\n", "print(\"Instrument connection closed.\")" ] } ], "metadata": { "kernelspec": { "display_name": "qcodes-contrib-drivers-py3.12", "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.12.9" } }, "nbformat": 4, "nbformat_minor": 4 }