GithubHelp home page GithubHelp logo

samdejong86 / keithley-2220-30-1-control Goto Github PK

View Code? Open in Web Editor NEW
5.0 0.0 1.0 31 KB

Control script for a Keithley 2220-30-1 DC power supply

Python 100.00%
scpi keithley keithley-2220-30-1 usbtmc

keithley-2220-30-1-control's Introduction

Keithley 2220-30-1 DC Power Supply Control

Description

Script for controlling a Keithley 2220-30-1 DC power supply via SCPI commands sent via USB:

KeithleyControl.py is a command line script for setting the voltage and current, checking the status of the device, and monitoring the output values.

KeithleyGUI.py is a GUI based on matplotlib which allows the user to change the voltage and current.

Information on the SCPI interface for the Keithley 2200 series devices can be found in this document

Requirements

Install the python-usbtmc package:

pip install python-usbtmc

You will likely need to edit /etc/udev/rules.d/99-garmin.rules as root, adding this line:

UBSYSTEM=="usb", ATTR{idVendor}=="VVVV", ATTR{idProduct}=="PPPP", MODE="666"

where VVVV and PPPP are the vendor and product id, and can be found by running

lsusb

which yeilds this output:

  Bus 001 Device 067: ID VVVV:PPPP Keithley Instruments

Once the file has been edited, restart udev with:

sudo udevadm trigger

Usage

KeithleyControl.py

usage: KeithleyControl.py [-h] [-v1 VOLTAGE1] [-v2 VOLTAGE2] [-c1 CURRENT1]
                      [-c2 CURRENT2] [-s] [-o {off,on,keep}] [-f MACRO]
                      [-l LINE] [-u VENDOR_ID PRODUCT_ID] [-m FILE]

Program a Keithley 2220-30-1 DC power supply

optional arguments:
  -h, --help            show this help message and exit
  -v1 VOLTAGE1, --voltage1 VOLTAGE1
                        Voltage setting for channel 1 in volts
  -v2 VOLTAGE2, --voltage2 VOLTAGE2
                        Voltage setting for channel 2 in volts
  -c1 CURRENT1, --current1 CURRENT1
                        Current setting for channel 1 in mA
  -c2 CURRENT2, --current2 CURRENT2
                        Current setting for channel 2 in mA
  -s, --status          Display voltage and current settings
  -o {off,on,keep}, --output {off,on,keep}
                        Enable/disable output
  -f MACRO, --macro MACRO
                        A SCPI macro file
  -l LINE, --line LINE  A single command to send to the device
  -u VENDOR_ID PRODUCT_ID, --usb VENDOR_ID PRODUCT_ID
                        USB vendor and product IDs
  -m FILE, --monitor FILE
                        Measure voltage, current, and power on all channels at
                        1Hz, writing to FILE

KeithleyGUI.py

alt text

Clicking the "Measure" Button will refresh the measured voltage and current displayed in the red boxes.

Typing a number into the "Voltage" or "Current" field in the lower half of the window will change the setting on the appropriate channel.

Clicking the "Output enabled / Output disabled" button at the bottom will toggle the output of the device.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.