![Tektronix Keithley SourceMeter 2450 User Manual Download Page 82](http://html1.mh-extra.com/html/tektronix/keithley-sourcemeter-2450/keithley-sourcemeter-2450_user-manual_1077861082.webp)
Model 2450 Interactive SourceMeter® Instrument User's Manual
Section 8: Rechargeable battery measurements
2450-900-01 Rev. A / June 2013
8-9
Send the following TSP commands for this example application:
--Reset the instrument and clear the buffer.
reset()
--Source settings.
smu.source.func = smu.FUNC_DC_VOLTAGE
smu.source.offmode = smu.OFFMODE_HIGHZ
smu.source.level = 1
smu.source.range = 2
smu.source.readback = smu.ON
smu.source.ilimit.level = 460e-3
--Measurement settings.
smu.measure.func = smu.FUNC_DC_CURRENT
smu.measure.range = 460e-3
smu.measure.sense = smu.SENSE_4WIRE
--Set the voltage limit at which the battery will stop discharging.
--Set the variable for the number of iterations.
voltLimit = 1.0
iteration = 1
--Turn on the source output.
smu.source.output = smu.ON
--Change the display to the USER DISPLAY screen.
display.screen = display.SCREEN_USER_SWIPE
--Keep taking readings in the while loop until the measured voltage
--is equal to the voltage limit.
while true do
--Take a reading and get the current, voltage, and relative
--timestamp values.
curr = smu.measure.read(defbuffer1)
volt = defbuffer1.sourcevalues[iteration]
time = defbuffer1.relativetimestamps[iteration]
hours = time/3600
--Print the number of completed cycles, the voltage, and the time
--for the iteration. Display information on the front panel.
print("Completed Cycles: ", iteration, "Voltage: ", volt,
"Time:", time)
display.settext(display.TEXT1, string.format("Voltage = %.4fV", volt))
display.settext(display.TEXT2, string.format("Current = %.2fA,
Time = %.2fHrs", curr, hours))
--Increment the number of iterations and wait 10 seconds.
--Compare the measured voltage to the voltage limit.
--Exit the loop if the voltage limit has been reached.
if volt <= voltLimit then
break
end
iteration = ite 1
delay(10)
end
--Turn the output off when the voltage limit is reached.
smu.source.output = smu.OFF
--Print the measured values in a four-column format.
print("\nIteration:\tCurrent:\tVoltage:\tTime:\n")
for i = 1, defbuffer1.n do
print(i, "\t", defbuffer1[i], "\t", defbuffer1.sourcevalues[i],
"\t", defbuffer1.relativetimestamps[i])
end