diff --git a/automated-iv-curves/Keithley196_commands.py b/automated-iv-curves/command_functions/Keithley196_commands.py similarity index 100% rename from automated-iv-curves/Keithley196_commands.py rename to automated-iv-curves/command_functions/Keithley196_commands.py diff --git a/automated-iv-curves/SIM900_commands.py b/automated-iv-curves/command_functions/SIM900_commands.py similarity index 100% rename from automated-iv-curves/SIM900_commands.py rename to automated-iv-curves/command_functions/SIM900_commands.py diff --git a/automated-iv-curves/SIM928_commands.py b/automated-iv-curves/command_functions/SIM928_commands.py similarity index 100% rename from automated-iv-curves/SIM928_commands.py rename to automated-iv-curves/command_functions/SIM928_commands.py diff --git a/automated-iv-curves/iv_functions.py b/automated-iv-curves/iv_functions.py index 8b431bd..d01632a 100644 --- a/automated-iv-curves/iv_functions.py +++ b/automated-iv-curves/iv_functions.py @@ -13,9 +13,9 @@ from pathlib import Path import tomllib rm = pyvisa.ResourceManager() -import SIM900_commands as SIM900_comm -import SIM928_commands as SIM928_comm -import Keithley196_commands as Keithley_comm +from command_functions import SIM900_commands as SIM900_comm +from command_functions import SIM928_commands as SIM928_comm +from command_functions import Keithley196_commands as Keithley_comm with open("automated-iv-curves/config.toml", "rb") as f: cfg = tomllib.load(f) diff --git a/automated-iv-curves/test.ipynb b/automated-iv-curves/test.ipynb deleted file mode 100644 index bda08bc..0000000 --- a/automated-iv-curves/test.ipynb +++ /dev/null @@ -1,130 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "7e9d23ea", - "metadata": {}, - "outputs": [], - "source": [ - "# -*- coding: utf-8 -*-\n", - "\"\"\"\n", - "Created on Mon Oct 10 16:05:44 2022\n", - "\n", - "@author: gac-x01dc\n", - "\"\"\"\n", - "\n", - "# Program to do I-V measurements\n", - "# Using SIM928 voltage source within SIM900 mainframe\n", - "# Using Keithley196 for voltage measurement\n", - "\n", - "import time\n", - "import datetime\n", - "import os.path\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt\n", - "import pyvisa\n", - "from pathlib import Path\n", - "rm = pyvisa.ResourceManager()\n", - "\n", - "import SIM900_commands as SIM900_comm\n", - "import SIM928_commands as SIM928_comm\n", - "import Keithley196_commands as Keithley_comm\n", - "\n", - "Keithley_address = 'TCPIP0::Prologix-00-21-69-01-4e-fb.psi.ch::1234::SOCKET'\n", - "# Keithley_address = 'GPIB0::6::INSTR'\n", - "SIM900_address = 'TCPIP0::ir-moxa01.psi.ch::3001::SOCKET'#'ASRL1::INSTR'\n", - "\n", - "Keithley = rm.open_resource(Keithley_address)\n", - "SIM900 = rm.open_resource(SIM900_address)\n", - "SIM928_port = 1\n", - "\n", - "# Initialise Keithley\n", - "Keithley.clear()\n", - "Keithley.timeout = 5000\n", - "Keithley.read_termination = '\\n'\n", - "Keithley.write(\"T5X\\n\") # Ensures the Keithley reads when it is triggered by \"X\" write\n", - "Keithley_comm.Set_Mode(Keithley, \"DC V\")\n", - "Keithley_comm.Set_Range(Keithley, \"Auto\")\n", - "Keithley.read() # Throwaway\n", - "\n", - "# Initialise SIM900\n", - "SIM900_comm.flush_main(SIM900)\n", - "SIM900_comm.reset(SIM900)\n", - "SIM900_comm.flush_port(SIM900, SIM928_port)" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "91371dcc", - "metadata": {}, - "outputs": [], - "source": [ - "V_value = -0.2\n", - "SIM900_comm.send_command(SIM900, SIM928_port, SIM928_comm.set_voltage(V_value)) # get voltage \n", - "\n", - "SIM900_comm.send_command(SIM900, SIM928_port, SIM928_comm.V_source_state(\"on\"))" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "5236610b", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "9298c70d", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "-0.2001732" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# time.sleep(0.1)\n", - "Keithley_comm.Voltage(Keithley)" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "19bb6089", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "automated-iv-curves", - "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.13" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -}