Model 2651A High Power System SourceMeter® Instrument Reference Manual
Section 3: Functions and features
2651A-901-01 Rev. A / March 2011
3-15
Example
:
The following programming example illustrates how to output mean and standard deviation statistics
from buffer 1:
statistics = smua.buffer.getstats(smua.nvbuffer1)
print(statistics.mean, statistics.stddev)
Reading buffer attributes
Use the reading buffer attributes to access the reading buffer data. The table below displays the
attributes that you can use to access the reading buffer data.
Recall attributes
Recall attribute*
Description
measurefunctions
An array (a Lua table) of strings indicating the function measured for the
reading (current, voltage, ohms, or watts).
measureranges
An array (a Lua table) of full-scale range values for the measure range used
when the measurement was made.
readings
An array (a Lua table) of the readings stored in the reading buffer. This array
holds the same data that is returned when the reading buffer is accessed
directly; that is,
rb[2]
and
rb.readings[2]
access the same value.
sourcefunctions
An array (a Lua table) of strings indicating the source function at the time of the
measurement (current or voltage).
sourceoutputstates
An array (a Lua table) of strings indicating the state of the source (off or on).
sourceranges
An array (a Lua table) of full-scale range values for the source range used
when the measurement was made.
sourcevalues
If enabled, an array (a Lua table) of the sourced values in effect at the time of
the reading.
statuses
An array (a Lua table) of status values for all of the readings in the buffer. The
status values are floating-point numbers that encode the status value into a
floating-point value. See
timestamps
If enabled, an array (a Lua table) of timestamps, in seconds, of when each
reading occurred. These are relative to the
basetimestamp
for the buffer. See
(on page 3-11).
*
The default attribute is
readings
, which can be omitted. For example, both
smua.nvbuffer1
and
smua.nvbuffer1.readings
will access readings from buffer 1.
Examples
:
The following programming example illustrates how to output 100 readings from Buffer 1:
printbuffer(1, 100, smua.nvbuffer1.readings)
Similarly, the following would output 100 source values from buffer 1:
printbuffer(1, 100, smua.nvbuffer1.sourcevalues)
The default reading attribute is
readings
, and can be omitted. Thus, the following would also output
100 readings from buffer 1:
printbuffer(1, 100, smua.nvbuffer1)