{ "cells": [ { "cell_type": "markdown", "id": "coated-savannah", "metadata": {}, "source": [ "# Example notebook for the Holzworth HS900B RF synthesizer" ] }, { "cell_type": "markdown", "id": "treated-gateway", "metadata": {}, "source": [ "First we need to import our driver and define our source" ] }, { "cell_type": "code", "execution_count": 1, "id": "olive-method", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Logging hadn't been started.\n", "Activating auto-logging. Current session state plus future input saved.\n", "Filename : C:\\Users\\G-GRE-GRE058050\\.qcodes\\logs\\command_history.log\n", "Mode : append\n", "Output logging : True\n", "Raw input log : False\n", "Timestamping : True\n", "State : active\n", "Qcodes Logfile : C:\\Users\\G-GRE-GRE058050\\.qcodes\\logs\\210923-47112-qcodes.log\n" ] } ], "source": [ "from qcodes_contrib_drivers.drivers.Holzworth.HS900 import HS900" ] }, { "cell_type": "code", "execution_count": 2, "id": "marked-certificate", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: Holzworth Instrumentation HS9002B (serial:#020, firmware:Ver:2.22) in 0.28s\n" ] } ], "source": [ "source = HS900(name=\"RF_source\", address=\"TCPIP0::192.168.0.2::9760::SOCKET\")" ] }, { "cell_type": "markdown", "id": "ready-working", "metadata": {}, "source": [ "Now we have access to our driver. Let us first see which channels are available" ] }, { "cell_type": "code", "execution_count": 3, "id": "dated-regulation", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"['CH1', 'CH2']\"" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.channel_names()" ] }, { "cell_type": "markdown", "id": "current-import", "metadata": {}, "source": [ "Now we can easily access any channel of our RF source by specifying the channel after source. Let's check the state of our two channels." ] }, { "cell_type": "code", "execution_count": 4, "id": "mexican-motorcycle", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH1.state()" ] }, { "cell_type": "code", "execution_count": 5, "id": "psychological-intelligence", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH2.state()" ] }, { "cell_type": "markdown", "id": "contemporary-queens", "metadata": {}, "source": [ "We can also change the state by giving 'ON' or 'OFF' as the argument" ] }, { "cell_type": "code", "execution_count": 6, "id": "patient-toyota", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH1.state('OFF')\n", "source.CH1.state()" ] }, { "cell_type": "code", "execution_count": 7, "id": "silver-inspector", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH1.state('ON')\n", "source.CH1.state()" ] }, { "cell_type": "markdown", "id": "foreign-destination", "metadata": {}, "source": [ "Let's get an overview over the different parameters. We can see frequency, phase, power, temperature at the output and the state" ] }, { "cell_type": "code", "execution_count": 8, "id": "utility-hotel", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "RF_source:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "IDN :\t{'vendor': 'Holzworth Instrumentation', 'model': 'HS9002B', '...\n", "channel_names :\t['CH1', 'CH2'] \n", "ref :\tInternal 100MHz \n", "ref_locked :\tFalse \n", "timeout :\t5 (s)\n", "RF_source_CH1:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "frequency :\t1.7e+09 (Hz)\n", "phase :\t12.5 (deg)\n", "power :\t7.5 (dBm)\n", "state :\tTrue \n", "temp :\t30 (C)\n", "RF_source_CH2:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "frequency :\t6e+09 (Hz)\n", "phase :\t120 (deg)\n", "power :\t-25 (dBm)\n", "state :\tTrue \n", "temp :\t30 (C)\n" ] } ], "source": [ "source.print_readable_snapshot(update=True)" ] }, { "cell_type": "markdown", "id": "natural-hawaiian", "metadata": {}, "source": [ "Frequency is always indicated in Hertz, phase always in degree, power always in dBm and temperature always in C. Except of temperatures all quantities are settable, just by giving the value to be set as an argument." ] }, { "cell_type": "code", "execution_count": 9, "id": "rolled-columbus", "metadata": {}, "outputs": [], "source": [ "source.CH1.frequency(1.7e9)\n", "source.CH2.frequency(6e9)" ] }, { "cell_type": "markdown", "id": "freelance-albany", "metadata": {}, "source": [ "As before we can read out the frequency by giving no argument." ] }, { "cell_type": "code", "execution_count": 10, "id": "stunning-burton", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1700000000.0" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH1.frequency()" ] }, { "cell_type": "code", "execution_count": 11, "id": "corresponding-cyprus", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6000000000.0" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH2.frequency()" ] }, { "cell_type": "markdown", "id": "right-address", "metadata": {}, "source": [ "Same applies to power and phase" ] }, { "cell_type": "code", "execution_count": 12, "id": "complimentary-arizona", "metadata": { "scrolled": true }, "outputs": [], "source": [ "source.CH1.power(7.5)\n", "source.CH2.power(-25)" ] }, { "cell_type": "code", "execution_count": 13, "id": "objective-cassette", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7.5" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH1.power()" ] }, { "cell_type": "code", "execution_count": 14, "id": "optical-stephen", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-25.0" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH2.power()" ] }, { "cell_type": "code", "execution_count": 15, "id": "abstract-founder", "metadata": {}, "outputs": [], "source": [ "source.CH1.phase(12.5)\n", "source.CH2.phase(120)" ] }, { "cell_type": "code", "execution_count": 16, "id": "effective-arthur", "metadata": { "scrolled": true }, "outputs": [ { "data": { "text/plain": [ "12.5" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH1.phase()" ] }, { "cell_type": "code", "execution_count": 17, "id": "sacred-regression", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "120.0" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH2.phase()" ] }, { "cell_type": "markdown", "id": "spanish-pursuit", "metadata": {}, "source": [ "The temperature at the output can only be gotten and not be set." ] }, { "cell_type": "code", "execution_count": 18, "id": "danish-purchase", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "30.0" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH1.temp()" ] }, { "cell_type": "code", "execution_count": 19, "id": "sunrise-roulette", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "30.0" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "source.CH2.temp()" ] }, { "cell_type": "markdown", "id": "physical-skating", "metadata": {}, "source": [ "Let's have a look at the summary of our set properties again." ] }, { "cell_type": "code", "execution_count": 23, "id": "bearing-serial", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "RF_source:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "IDN :\t{'vendor': 'Holzworth Instrumentation', 'model': 'HS9002B', '...\n", "channel_names :\t['CH1', 'CH2'] \n", "ref :\tInternal 100MHz \n", "ref_locked :\tFalse \n", "timeout :\t5 (s)\n", "RF_source_CH1:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "frequency :\t1.7e+09 (Hz)\n", "phase :\t12.5 (deg)\n", "power :\t7.5 (dBm)\n", "state :\tTrue \n", "temp :\t30 (C)\n", "RF_source_CH2:\n", "\tparameter value\n", "--------------------------------------------------------------------------------\n", "frequency :\t6e+09 (Hz)\n", "phase :\t120 (deg)\n", "power :\t-25 (dBm)\n", "state :\tTrue \n", "temp :\t30 (C)\n" ] } ], "source": [ "source.print_readable_snapshot(update=True)" ] }, { "cell_type": "markdown", "id": "textile-slovenia", "metadata": {}, "source": [ "This concludes the introduction to the HS9002B driver. If required more advanced functions of the RF source like frequencies sweeps and modulation may be added. For the time being this was not required. Theoretically it should be compatible with other RF synthesizers from the HS900 series from Holzworth, but no checks have been conducted regarding the compatibility in practice." ] } ], "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.8.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": true } }, "nbformat": 4, "nbformat_minor": 5 }