![Keithley 2290-5 User Manual Download Page 42](http://html1.mh-extra.com/html/keithley/2290-5/2290-5_user-manual_4043252042.webp)
Model 2290-5 5 kV Power Supply User's Manual
Section 7: Typical applications
2290-5-900-01 Rev. A/December 2013
7-3
Example program code
The following code was created and tested using the Python programming language using the
pyVISA module. To learn more about Python, go to www.python.org.
The example python program code below can be copied and pasted for your testing purposes,
however, the code must match to include the indents of specific lines.
# Import pyVisa and time modules into the Python environment
import visa
import time
# Open a VISA session with the 2290 at GPIB address 14
ki2290 = visa.instrument("GPIB::14")
# Reset and clear the status of the 2290
ki2290.write("*RST")
ki2290.write("*CLS")
ki2290.write("*RCL 0")
# Define sweep variables for the programmed output voltage and
# measured current readings
voltage = 0
currReading = ""
currRdgList = []
# Turn on the output of the 2290
time.sleep(1)
ki2290.write("HVON")
# Perform a sweep from 0 to 3000V and make current measurements
# at each point of the sweep
for n in range(0,11):
ki2290.write("VSET " + str(voltage))
time.sleep(2) # Allow new voltage level to stabilize
currReading = ki2290.ask("IOUT?")
currRdgList.append(currReading)
voltage = v 300
# Set the voltage of the 2290 to 0V and turn off its output
ki2290.write("VSET 0")
ki2290.write("HVOF")
# Print the current measurements
print "Current Measurements: ", currRdgList