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