Controlling the Power Supplies Through the Computer

Both the Keithley (High Voltage source) and the Keysight (LV and LVDS power supply) can be controlled through the computer. They are connected to each other and the computer through a GPIB connector bus, then controlled from python scripts (temporarily in ~/Desktop/Haugen/New_Scripts). These are based heavily on the scripts from timon and allow for powering on, powering off, ramping high voltage, performing an IV scan, and recording the data. There is documentation for the connector here.

The communication happens through a serial port name /dev/ttyUSB0

Each device on the bus has to have a unique ID number between 0-30. I have set the Keysight supply to be ID 05, and the Keithley supply to be ID 10.

To change the ID:

  • Keysight:
    • press the I/O config button
    • Select HPIB / 488 (if the screen shows this press I/O Config again, if not scroll the adjust wheel till it does)
    • set the address
  • Keysight:
    • Press MENU
    • select COMMUNICATION
    • select GPIB
    • set the address
    • select GPIB protocol (SCPI)
While remote control through the GPIB connector is on, none of the buttons on either of the power supplies will be useable. Local control can be regained on either supply by pressing the "local" button

Code for Control

A whole bunch of code is written for interfacing with the power supplies. These have all been written in python and combined into one library called this is also currently in the directory ~/Desktop/Haugen/New_Scripts. This library is sort of a collection of raw code and it has a lot of different procedures that can be run. To actually run any of these scripts it is best to run which takes input from the user, interprets them and then runs the relevant script. It offers tab completion and help with the different commands (tells you what commands it accepts and the arguments that those commands take).

To get help in enter help, to get help with a certain command enter [name of command] -h. Arguments for commands are entered with flags, each flag is seperated with a space then the corresponding value is after that flag with another space, for example

read_arduino -f Arduino_Data.dat_ would read the arduino data then save it to the file Arduino_Data.dat

Some flags/arguments are optional. These are all listed under the specific help for that command

If you prefer to avoid the interface then you can do this:

  1. run python
  2. import SerialCommands as ser
  3. open the serial port (s = ser.Open_Serial('/dev/ttyUSB0', 115200))
  4. run whatever command you want, for example to power on enter ser.Power_On(s,1.5,4.2). Almost all of the commands take the serial port as an argument
-- Tom-Erik Haugen - 2016-10-21


Topic attachments
I Attachment History Action Size DateSorted ascending Who Comment
Unknown file formatEXT Makefile r1 manage 0.8 K 2016-10-21 - 22:54 TomErikHaugen  
C source code filecpp SerialCom.cpp r1 manage 1.8 K 2016-10-21 - 22:54 TomErikHaugen  
Header fileh SerialCom.h r1 manage 0.7 K 2016-10-21 - 22:54 TomErikHaugen  
Unknown file formatcxx power_off.cxx r1 manage 2.3 K 2016-10-21 - 22:54 TomErikHaugen  
Unknown file formatcxx power_on.cxx r1 manage 4.2 K 2016-10-21 - 22:54 TomErikHaugen  
Unknown file formatcxx start_mon.cxx r1 manage 3.7 K 2016-10-21 - 22:54 TomErikHaugen  
Texttxt r2 r1 manage 9.0 K 2016-10-28 - 22:54 TomErikHaugen  
Texttxt r2 r1 manage 8.4 K 2016-10-28 - 22:54 TomErikHaugen  
Edit | Attach | Watch | Print version | History: r11 | r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r7 - 2016-10-28 - TomErikHaugen
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback