{ "cells": [ { "cell_type": "markdown", "id": "introduction", "metadata": {}, "source": [ "# Teledyne LeCroy T3PS30051P DC power supply\n", "\n", "This example adapts the single-output DC supply workflow to QCoDeS. The T3PS30051P supports 0-30 V and a 0-5 A current limit.\n", "\n", "This was tested on a unit running:\n", " - Software Version: 2.1.1.8\n", " - Hardware Version: V1.0\n", "\n", "This version requires the Output On/Off command of the form \"OUTP CH1,ON\", \"OUTP CH1,OFF\". Note other software versions may be slightly different\n", "\n", "You need a connected instrument and a working VISA backend. Replace the resource address below with your instrument's address. Check the wiring and choose limits appropriate for the connected device before enabling output. Construction does not reset or disable an already enabled output. Closing the connection does not disable it either.\n", "\n", "The example keeps the output disabled unless you explicitly uncomment the output-enable command.\n", "\n", "This model does not respond to `*IDN?`. The driver supplies the known vendor and model locally, with no serial number or firmware information, so initialization and station snapshots do not send identification queries. Queries wait one second before reading a response. Close any existing connection from another notebook or application before connecting here." ] }, { "cell_type": "code", "execution_count": 15, "id": "connect", "metadata": {}, "outputs": [], "source": [ "from qcodes_contrib_drivers.drivers.Teledyne import TeledyneT3PS30051P\n", "from qcodes.station import Station" ] }, { "cell_type": "code", "execution_count": 23, "id": "5f0c0dce", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: Teledyne LeCroy T3PS30051P (serial:None, firmware:None) in 0.02s\n" ] } ], "source": [ "resource_name = \"USB0::0xF4EC::0x1410::T0103C21190153::0::INSTR\"\n", "pwr = TeledyneT3PS30051P(\"pwr\", resource_name)\n", "station = Station(pwr)" ] }, { "cell_type": "markdown", "id": "configure-description", "metadata": {}, "source": [ "## Configure voltage and current\n", "\n", "Turn the output off before changing the setpoints. QCoDeS parameters validate values before sending commands. Unlike the original standalone driver, getters return numeric values instead of just printing them." ] }, { "cell_type": "code", "execution_count": 24, "id": "configure", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Voltage setpoint: 5.0 V\n", "Current limit: 0.5 A\n" ] } ], "source": [ "pwr.output(False)\n", "pwr.voltage(5.0)\n", "pwr.current(0.5)\n", "print(f\"Voltage setpoint: {pwr.voltage()} V\")\n", "print(f\"Current limit: {pwr.current()} A\")" ] }, { "cell_type": "markdown", "id": "status-description", "metadata": {}, "source": [ "## Inspect status and control output\n", "\n", "`output` reads status bit 4, while `mode` reports constant-voltage (`CV`) or constant-current (`CC`) operation. `status` returns the complete status register as an integer.\n", "\n", "Uncomment the output-enable command only after checking that the voltage and current limit are appropriate." ] }, { "cell_type": "code", "execution_count": 25, "id": "status", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Status register: 0x0000\n", "Output enabled: False\n", "Regulation mode: CV\n" ] } ], "source": [ "print(f\"Status register: {pwr.status():#06x}\")\n", "print(f\"Output enabled: {pwr.output()}\")\n", "print(f\"Regulation mode: {pwr.mode()}\")\n", "\n" ] }, { "cell_type": "markdown", "id": "70f7378f", "metadata": {}, "source": [ "## Enable the Output" ] }, { "cell_type": "code", "execution_count": 26, "id": "dc145273", "metadata": {}, "outputs": [], "source": [ "pwr.output(True)" ] }, { "cell_type": "markdown", "id": "measure-description", "metadata": {}, "source": [ "## Read the actual output\n", "\n", "Measurements are separate from programmed setpoints. A station snapshot records both settings and measurements." ] }, { "cell_type": "code", "execution_count": 27, "id": "measure", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Measured voltage: 5.002 V\n", "Measured current: 0.0 A\n", "Measured power: 0.0 W\n" ] } ], "source": [ "print(f\"Measured voltage: {pwr.measured_voltage()} V\")\n", "print(f\"Measured current: {pwr.measured_current()} A\")\n", "print(f\"Measured power: {pwr.measured_power()} W\")\n", "snapshot = station.snapshot(update=\"All\")" ] }, { "cell_type": "markdown", "id": "close-description", "metadata": {}, "source": [ "## Disable output and close\n", "\n", "Run this cleanup cell even if a preceding cell raises an error. For unattended scripts, put output shutdown and connection cleanup in a `try`/`finally` block." ] }, { "cell_type": "code", "execution_count": 28, "id": "close", "metadata": {}, "outputs": [], "source": [ "try:\n", " pwr.output(False)\n", "finally:\n", " pwr.close()" ] } ], "metadata": { "kernelspec": { "display_name": ".venv (3.14.10)", "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.14.10" }, "nbsphinx": { "execute": "never" } }, "nbformat": 4, "nbformat_minor": 5 }