Commit 090018e7 authored by Peter Jansweijer's avatar Peter Jansweijer

Added Keysight E36313A Triple Output Programmable DC Power Supply

parent c3553f31
#!/usr/bin/python
"""
Keysight E36313A Power Supply remote control
-------------------------------------------------------------------------------
Copyright (C) 2023 Peter Jansweijer, 'stolen' from Tjeerd Pinkert and freely
adjusted
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
-------------------------------------------------------------------------------
Usage:
Keysight_36313A.py <IP#>
Keysight_36313A.py -h | --help
IP IP number of the Waveform Generator
(for example: 192.168.32.242 which is its DevNet IP number)
Options:
-h --help Show this screen.
"""
import os
import sys
import time
import scipy
import struct
import datetime
import pdb
#TJP: installed from web python-vxi Alex
import vxi11
import matplotlib.pyplot as plt
############################################################################
###########################################################################
def e36313A_init(pwr_sup):
"""
Initialize the Power Supply for Channel 2, 12V output
pws_sup -- instance of python-vxi connected to the Power Supply
"""
# Configure Channel 2 for 12V output with 1A current limit
pwr_sup.write("APPLy CH2, 12, 1.0")
return
###########################################################################
def e36313A_enable(pwr_sup, enable):
"""
Yes/No enable the output of CHannel2
pws_sup -- instance of python-vxi connected to the Power Supply
enable -- Boolean
"""
if (enable):
pwr_sup.write("OUTPut ON ,(@2)")
else :
pwr_sup.write("OUTPut OFF ,(@2)")
return
############################################################################
##
## If run from commandline, we can test the library
##
"""
Usage:
Keysight_36313A.py <IP#>
Keysight_36313A.py -h | --help
IP IP number of the Waveform Generator
(for example: 192.168.32.137 which is its DevNet IP number)
Options:
-h --help Show this screen.
"""
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("ip", help="IP-Number of the Waveform Generator")
args = parser.parse_args()
print ("Use E36313A IP address: " + str(args.ip))
pwr_sup = vxi11.Instrument(args.ip)
#pwr_sup = vxi11.Instrument("192.168.32.234")
print(pwr_sup.ask("*IDN?"))
# Returns 'Keysight Technologies,E36313A,MY59001539,2.0.8-1.0.4-1.12'
e36313A_init(pwr_sup)
sys.exit()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment