7-10
Return to
2600AS-901-01 Rev. B / September 2008
Section 7: Reading Buffers
Series 2600A System SourceMeter® Instruments Reference Manual
Dynamic reading buffers
Reading buffers can also be allocated dynamically. Dynamic reading buffers are created and
allocated with the
smuX.makebuffer(n)
command, where
n
is the number of readings the
buffer can store. For example, the following command allocates a Channel A reading buffer named
mybuffer
that can store 100 readings:
mybuffer = smua.makebuffer(100)
Allocated reading buffers can be deleted as follows:
mybuffer = nil
Dynamically allocated reading buffers can be used interchangeably with the
smuX.nvbufferY
Buffer examples
Defined buffer example
The listing below shows a programming example for storing data using the pre-defined Buffer 1 for
Channel A. The Series 2600A loops for voltages from 0.01V to 1V with 0.01V 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 Series 2600A defaults.
smua.reset()
-- Select Channel A display.
display.screen = 0
-- Display current.
display.smua.measure.func = display.MEASURE_DCAMPS
-- Select measure I auto range.
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 0V.
smua.source.levelv = 0.0
-- Turn on output.
smua.source.output =smua.OUTPUT_ON
-- Loop for voltages from 0.01 V to 1 V.
for v = 0.01, 1.0, 0.01 do
-- Set source voltage
smua.source.levelv = v
-- Measure current, store in buffer.
smua.measure.i(smua.nvbuffer1)
--Wait for reading to complete.
waitcomplete()
end
-- Turn off output.
smua.source.output =smua.OUTPUT_OFF
-- Return readings 1-100.
printbuffer(1, 100, smua.nvbuffer1.readings)