{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# QCoDeS Example with Yokogawa GS200/GS210" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import time\n", "import qcodes\n", "from qcodes.instrument_drivers.yokogawa.GS200 import GS200" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: YOKOGAWA GS210 (serial:91RB18719, firmware:2.02) in 0.12s\n" ] } ], "source": [ "gs = GS200(\"gs200\", address='USB::0xB21::0x39::91RB18719::INSTR', terminator=\"\\n\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The instrument turns on in the 'VOLT' mode:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'VOLT'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.source_mode()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The mode can be changed to 'CURR' via source_mode:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'CURR'" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.source_mode('CURR')\n", "gs.source_mode()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If the instrument is reconnected without turning it off and on, it will be connected with the previous session's mode:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Connected to: YOKOGAWA GS210 (serial:91RB18719, firmware:2.02) in 0.03s\n" ] }, { "data": { "text/plain": [ "'CURR'" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.close()\n", "gs = GS200(\"gs200\", address='USB::0xB21::0x39::91RB18719::INSTR', terminator=\"\\n\")\n", "gs.source_mode()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The source_mode can only be changed when the output is 'off'. By default the\n", "output is off and there is no actual current is flowing:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'off'" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.output()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Setting/ getting attributes/ methods of a mode ('VOLT' or 'CURR') is only possible if the source_mode is in that mode (in this case, we are in the'CURR' mode and trying to access voltage attributes/ methods):" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Exception correctly raised.\n", "Exception correctly raised.\n", "Exception correctly raised.\n", "Exception correctly raised.\n", "Exception correctly raised.\n" ] } ], "source": [ "try:\n", " gs.voltage(0.1) # Set the voltage\n", " print(\"Something has gone wrong.\")\n", "except: \n", " print(\"Exception correctly raised.\")\n", " \n", "try:\n", " gs.voltage() # Get the voltage\n", " print(\"Something has gone wrong.\")\n", "except: \n", " print(\"Exception correctly raised.\")\n", " \n", "try:\n", " gs.voltage_range(10) # Set the voltage_range\n", " print(\"Something has gone wrong.\")\n", "except: \n", " print(\"Exception correctly raised.\")\n", " \n", "try:\n", " gs.voltage_range() # Get the voltage_range\n", " print(\"Something has gone wrong.\")\n", "except: \n", " print(\"Exception correctly raised.\")\n", " \n", "try:\n", " gs.ramp_voltage(5, 1, 1) # Get the voltage_range\n", " print(\"Something has gone wrong.\")\n", "except: \n", " print(\"Exception correctly raised.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can set/ get current attributes in the 'CURR' mode:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.01" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.current_range()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "gs.current(0.001)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Snapshotting interactively changes when the source_mode is changed (voltage and voltage_range are excluded from snapshot in the 'CURR' mode and vice versa):" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'functions': {'reset': {}},\n", " 'submodules': {'measure': {'functions': {},\n", " 'submodules': {},\n", " '__class__': 'qcodes.instrument_drivers.yokogawa.GS200.GS200_Monitor',\n", " 'parameters': {'enabled': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_measure_enabled',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200_Monitor',\n", " 'instrument_name': 'gs200_measure',\n", " 'val_mapping': {'off': 0, 'on': 1},\n", " 'label': 'Measurement Enabled',\n", " 'unit': '',\n", " 'post_delay': 0,\n", " 'name': 'enabled',\n", " 'vals': \"\"},\n", " 'measure': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_measure_measure',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200_Monitor',\n", " 'instrument_name': 'gs200_measure',\n", " 'label': '',\n", " 'unit': 'V/I',\n", " 'post_delay': 0,\n", " 'name': 'measure'},\n", " 'NPLC': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_measure_NPLC',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200_Monitor',\n", " 'instrument_name': 'gs200_measure',\n", " 'label': 'NPLC',\n", " 'unit': '1/LineFreq',\n", " 'post_delay': 0,\n", " 'name': 'NPLC',\n", " 'vals': ''},\n", " 'delay': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_measure_delay',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200_Monitor',\n", " 'instrument_name': 'gs200_measure',\n", " 'label': 'Measurement Delay',\n", " 'unit': 'ms',\n", " 'post_delay': 0,\n", " 'name': 'delay',\n", " 'vals': ''},\n", " 'trigger': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_measure_trigger',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200_Monitor',\n", " 'instrument_name': 'gs200_measure',\n", " 'val_mapping': {'READY': 'READ',\n", " 'READ': 'READ',\n", " 'TIMER': 'TIM',\n", " 'TIM': 'TIM',\n", " 'COMMUNICATE': 'COMM',\n", " 'IMMEDIATE': 'IMM',\n", " 'IMM': 'IMM'},\n", " 'label': 'Trigger Source',\n", " 'unit': '',\n", " 'post_delay': 0,\n", " 'name': 'trigger',\n", " 'vals': \"\"},\n", " 'interval': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_measure_interval',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200_Monitor',\n", " 'instrument_name': 'gs200_measure',\n", " 'label': 'Measurement Interval',\n", " 'unit': 's',\n", " 'post_delay': 0,\n", " 'name': 'interval',\n", " 'vals': ''}},\n", " 'name': 'gs200_measure'}},\n", " '__class__': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'parameters': {'IDN': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_IDN',\n", " 'value': {'vendor': 'YOKOGAWA',\n", " 'model': 'GS210',\n", " 'serial': '91RB18719',\n", " 'firmware': '2.02'},\n", " 'raw_value': {'vendor': 'YOKOGAWA',\n", " 'model': 'GS210',\n", " 'serial': '91RB18719',\n", " 'firmware': '2.02'},\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'IDN',\n", " 'unit': '',\n", " 'post_delay': 0,\n", " 'name': 'IDN',\n", " 'vals': ''},\n", " 'timeout': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_timeout',\n", " 'value': 5,\n", " 'raw_value': 5,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'timeout',\n", " 'unit': 's',\n", " 'post_delay': 0,\n", " 'name': 'timeout',\n", " 'vals': '=0, Enum: {None}>'},\n", " 'output': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_output',\n", " 'value': 'off',\n", " 'raw_value': 0,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'val_mapping': {'off': 0, 'on': 1},\n", " 'label': 'Output State',\n", " 'unit': '',\n", " 'post_delay': 0,\n", " 'name': 'output',\n", " 'vals': \"\"},\n", " 'source_mode': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_source_mode',\n", " 'value': 'CURR',\n", " 'raw_value': 'CURR',\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Source Mode',\n", " 'unit': '',\n", " 'post_delay': 0,\n", " 'name': 'source_mode',\n", " 'vals': \"\"},\n", " 'current_range': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_current_range',\n", " 'value': 0.01,\n", " 'raw_value': 0.01,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Current Source Range',\n", " 'unit': 'I',\n", " 'post_delay': 0,\n", " 'name': 'current_range',\n", " 'vals': ''},\n", " 'range': {'__class__': 'qcodes.instrument.parameter.DelegateParameter',\n", " 'full_name': 'gs200_range',\n", " 'value': 0.01,\n", " 'raw_value': 0.01,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Current Source Range',\n", " 'unit': 'I',\n", " 'post_delay': 0,\n", " 'name': 'range',\n", " 'source_parameter': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_current_range',\n", " 'value': 0.01,\n", " 'raw_value': 0.01,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Current Source Range',\n", " 'unit': 'I',\n", " 'post_delay': 0,\n", " 'name': 'current_range',\n", " 'vals': ''}},\n", " 'auto_range': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_auto_range',\n", " 'value': False,\n", " 'raw_value': False,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Auto Range',\n", " 'unit': '',\n", " 'post_delay': 0,\n", " 'name': 'auto_range',\n", " 'vals': ''},\n", " 'current': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_current',\n", " 'value': 0.001,\n", " 'raw_value': 0.001,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Current',\n", " 'unit': 'I',\n", " 'post_delay': 0,\n", " 'name': 'current'},\n", " 'output_level': {'__class__': 'qcodes.instrument.parameter.DelegateParameter',\n", " 'full_name': 'gs200_output_level',\n", " 'value': 0.001,\n", " 'raw_value': 0.001,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Current',\n", " 'unit': 'I',\n", " 'post_delay': 0,\n", " 'name': 'output_level',\n", " 'source_parameter': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_current',\n", " 'value': 0.001,\n", " 'raw_value': 0.001,\n", " 'ts': '2020-09-24 13:47:53',\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Current',\n", " 'unit': 'I',\n", " 'post_delay': 0,\n", " 'name': 'current'}},\n", " 'voltage_limit': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_voltage_limit',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Voltage Protection Limit',\n", " 'unit': 'V',\n", " 'post_delay': 0,\n", " 'name': 'voltage_limit',\n", " 'vals': ''},\n", " 'current_limit': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_current_limit',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Current Protection Limit',\n", " 'unit': 'I',\n", " 'post_delay': 0,\n", " 'name': 'current_limit',\n", " 'vals': ''},\n", " 'four_wire': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_four_wire',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'val_mapping': {'off': 0, 'on': 1},\n", " 'label': 'Four Wire Sensing',\n", " 'unit': '',\n", " 'post_delay': 0,\n", " 'name': 'four_wire',\n", " 'vals': \"\"},\n", " 'guard': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_guard',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'val_mapping': {'off': 0, 'on': 1},\n", " 'label': 'Guard Terminal',\n", " 'unit': '',\n", " 'post_delay': 0,\n", " 'name': 'guard',\n", " 'vals': \"\"},\n", " 'line_freq': {'__class__': 'qcodes.instrument.parameter.Parameter',\n", " 'full_name': 'gs200_line_freq',\n", " 'value': None,\n", " 'raw_value': None,\n", " 'ts': None,\n", " 'inter_delay': 0,\n", " 'instrument': 'qcodes.instrument_drivers.yokogawa.GS200.GS200',\n", " 'instrument_name': 'gs200',\n", " 'label': 'Line Frequency',\n", " 'unit': 'Hz',\n", " 'post_delay': 0,\n", " 'name': 'line_freq'}},\n", " 'name': 'gs200',\n", " 'address': 'USB::0xB21::0x39::91RB18719::INSTR',\n", " 'terminator': '\\n',\n", " 'timeout': 5.0}" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.snapshot()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default, auto_range is in False state. So, setting voltage or current is\n", "limitted to the present voltage_range or current_range:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.auto_range()" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The current value is withing the present current_range\n", "Exception is correctly raised. The value is out of the present range of 0.01 A.\n" ] } ], "source": [ "gs.current_range(0.01)\n", "try:\n", " gs.current(0.009)\n", " print(\"The current value is withing the present current_range\")\n", "except:\n", " print(\"Exception incorrectly raised.\")\n", " \n", "try:\n", " gs.current(0.1)\n", " print(\"Something has gone wrong.\")\n", "except: \n", " print(f\"Exception is correctly raised. The value is out of the present \"\n", " f\"range of {gs.current_range()} A.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "auto_range can be used to set the value even if the value is out of the\n", "present range. If the value exceeds the present range, the range automatically switches to the higher range tier untill the maximum allowed limit is reached (0.2 A for current and 30 V for voltage).\n", "auto_range can be useful when one wants to ramp the value without worrying about the end value to be out of the present range. We ramp the current from 0.009 A to 0.02 A with the step of 0.001 A (delay between each step is set to 1 second) and time it. Our present range is 0.01 A, so we expect the range automatically switches to 0.1 A because of auto_range is True." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.01" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.auto_range(True)\n", "gs.current(0.009)\n", "gs.current_range()" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Ramping took 10.84 seconds\n" ] } ], "source": [ "t1 = time.time()\n", "gs.ramp_current(0.02, 0.001, 1)\n", "t2 = time.time()\n", "print(\"Ramping took {:.4} seconds\".format(t2-t1))" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.02" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.current()" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.1" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.current_range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, we turn off auto_range and set the current value out of the present range\n", "to test if we correctly get an error" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "gs.auto_range(False)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Exception is correctly raised. The value is out of the present range of 0.1 A.\n" ] } ], "source": [ "try:\n", " gs.current(0.15)\n", " print(\"Something has gone wrong\")\n", "except:\n", " print(f\"Exception is correctly raised. The value is out of the present \"\n", " f\"range of {gs.current_range()} A.\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, we want to test the ramping in the False state of auto_range. We expect the ramping to stop when we exceed the range and we get out of range error:" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "gs.auto_range(False)\n", "gs.current(0.007)\n", "gs.current_range(0.01)" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Exception is correctly raised. Ramping is stopped at 0.01 A because the range is exceeded\n" ] } ], "source": [ "try:\n", " gs.ramp_current(0.02, 0.001, 1)\n", "except:\n", " print(\"Exception is correctly raised. Ramping is stopped at {} A because the\"\n", " \" range is exceeded\".format(gs.current()))\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, we switch to the 'VOLT' mode and test a few things:\n" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "gs.source_mode('VOLT')" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.0" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.voltage()" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.0" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.voltage_range()" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.auto_range()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can look at the voltage_limit and current_limit limit in any source_mode:" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.2" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.current_limit()" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "30" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "gs.voltage_limit()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, we turn on the output to test if we see the correct output (in the 'CURR' and 'VOLT' mode, the voltage_limit and current_limit is active, respectively):" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "gs.output('on')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can verify that our multileter is reading 0.2 A. Now, we change the current_limit and test again:" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "gs.current_limit(0.1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As expected, the multimeter is reading 0.1 A." ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [], "source": [ "gs.output('off')" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "gs.close()" ] }, { "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.7.9" }, "nbsphinx": { "execute": "never" } }, "nbformat": 4, "nbformat_minor": 2 }