{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Qcodes example with Aviosys IP Power 9258S" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T17:36:02.452172Z", "start_time": "2019-03-04T17:36:00.742189Z" } }, "outputs": [], "source": [ "from qcodes_contrib_drivers.drivers.Aviosys.IP_Power_9258S import Aviosys_IP_Power_9258S" ] }, { "cell_type": "markdown", "metadata": { "ExecuteTime": { "end_time": "2019-03-04T17:16:55.948389Z", "start_time": "2019-03-04T17:16:55.938389Z" }, "code_folding": [] }, "source": [ "## Initialize instrument\n", "In order to initialize the instrument, we need to provide the http address, the login name and the login password." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T17:36:02.472171Z", "start_time": "2019-03-04T17:36:02.452172Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: Aviosys IP Power 9258S (serial:None, firmware:None) in 0.00s\n" ] } ], "source": [ "ip_power = Aviosys_IP_Power_9258S(name=\"IP Power 9258S\", address='http://192.168.1.100', \n", " login_name='admin', login_password='12345678')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Read the power status\n", "We read the status of all sockets on the instrument." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T17:36:08.562111Z", "start_time": "2019-03-04T17:36:02.472171Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "power A : 0 \n", "power B : 0 \n", "power C : 0 \n", "power D : 0 \n" ] } ], "source": [ "print(ip_power.A.power.label, ': ', ip_power.A.power.get(), ip_power.A.power.unit)\n", "print(ip_power.B.power.label, ': ', ip_power.B.power.get(), ip_power.B.power.unit)\n", "print(ip_power.C.power.label, ': ', ip_power.C.power.get(), ip_power.C.power.unit)\n", "print(ip_power.D.power.label, ': ', ip_power.D.power.get(), ip_power.D.power.unit)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Set the power status\n", "We set the status of two of the instrument sockets and repeat the status reading." ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T17:36:11.592080Z", "start_time": "2019-03-04T17:36:08.562111Z" } }, "outputs": [], "source": [ "ip_power.B.power.set(True)\n", "ip_power.C.power.set(True)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T17:36:17.702019Z", "start_time": "2019-03-04T17:36:11.592080Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "power A : 0 \n", "power B : 1 \n", "power C : 1 \n", "power D : 0 \n" ] } ], "source": [ "print(ip_power.A.power.label, ': ', ip_power.A.power.get(), ip_power.A.power.unit)\n", "print(ip_power.B.power.label, ': ', ip_power.B.power.get(), ip_power.B.power.unit)\n", "print(ip_power.C.power.label, ': ', ip_power.C.power.get(), ip_power.C.power.unit)\n", "print(ip_power.D.power.label, ': ', ip_power.D.power.get(), ip_power.D.power.unit)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Turn of all sockets" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T17:36:23.991956Z", "start_time": "2019-03-04T17:36:17.702019Z" } }, "outputs": [], "source": [ "ip_power.A.power.set(False)\n", "ip_power.B.power.set(False)\n", "ip_power.C.power.set(False)\n", "ip_power.D.power.set(False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Close instrument" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2019-03-04T17:36:24.011956Z", "start_time": "2019-03-04T17:36:23.991956Z" } }, "outputs": [], "source": [ "ip_power.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 }