7-12
Return to
2600AS-901-01 Rev. B / September 2008
Section 7: Reading Buffers
Series 2600A System SourceMeter® Instruments Reference Manual
Dynamically allocated buffer example
The listing below shows a programming example for storing data using an allocated buffer called
mybuffer for Channel A. The Series 2600A stores 100 current readings in mybuffer and then
recalls all the readings.
-- Restore Series 2600A defaults.
smua.reset()
-- Select measure I auto range.
smua.measure.autorangei = smua.AUTORANGE_ON
-- Select measure V auto range.
smua.measure.autorangev = smua.AUTORANGE_ON
-- Select ASCII data format.
format.data = format.ASCII
-- Set buffer count to 100.
smua.measure.count = 100
--Set measure interval to 0.1 s.
smua.measure.interval = 0.1
-- Select source voltage function.
smua.source.func = smua.OUTPUT_DCVOLTS
-- Output 1 V.
smua.source.levelv = 1
-- Turn on output.
smua.source.output = smua.OUTPUT_ON
-- Store current readings in mybuffer.
smua.measure.overlappedi(mybuffer)
-- Wait for buffer to fill.
waitcomplete()
-- Turn off output.
smua.source.output = smua.OUTPUT_OFF
-- Return 1 readings 1-100 from mybuffer.
printbuffer(1, 100, mybuffer)
-- Delete mybuffer.
mybuffer = nil