
Model 2657A High Power System SourceMeter® Instrument Reference Manual
Section 3: Functions and features
2657A-901-01 Rev. B/December 2012
3-17
Buffer examples
Dedicated reading buffer example
The following programming example illustrates how to store data using dedicated reading buffer 1. In
the example, the Model 2657A loops for voltages from 21 V to 120 V with 1 V steps (essentially
performing a staircase sweep), stores 100 current readings and source values in buffer 1, and then
recalls all 100 readings and source values.
-- Restore Model 2657A defaults.
smua.reset()
-- Set display.
display.screen = display.SMUA
-- Display current.
display.smua.measure.func = display.MEASURE_DCAMPS
-- Select measure I autorange.
smua.measure.autorangei = smua.AUTORANGE_ON
-- Select ASCII data format.
format.data = format.ASCII
-- Clear buffer 1.
smua.nvbuffer1.clear()
-- Enable append buffer mode.
smua.nvbuffer1.appendmode = 1
-- Enable source value storage.
smua.nvbuffer1.collectsourcevalues = 1
-- Set count to 1.
smua.measure.count = 1
-- Select source voltage function.
smua.source.func = smua.OUTPUT_DCVOLTS
-- Set bias voltage to 0 V.
smua.source.levelv = 0.0
-- Turn on output.
smua.source.output = smua.OUTPUT_ON
-- Loop for voltages from 21 V to 120 V.
for v = 21, 120 do
-- Set source voltage.
smua.source.levelv = v
-- Measure current and store in nvbuffer1.
smua.measure.i(smua.nvbuffer1)
end
-- Turn off output.
smua.source.output = smua.OUTPUT_OFF
-- Output readings 1 to 100.
printbuffer(1, smua.nvbuffer1.n, smua.nvbuffer1.readings)
-- Output source values 1 to 100.
printbuffer(1, smua.nvbuffer1.n, smua.nvbuffer1.sourcevalues)
Summary of Contents for 2657A
Page 3: ......