2606B System SourceMeter® Instrument Reference Manual
Section 3: Functions and features
2606B-901-01 Rev. B / May 2018
3-13
Buffer storage control programming examples
The programming examples below illustrate the use of buffer storage control attributes.
Buffer control programming examples:
Command
Description
smua.nvbuffer1.collectsourcevalues = 1
Enable source value storage.
smua.nvbuffer1.appendmode = 1
Enable buffer append mode.
smua.nvbuffer1.collecttimestamps = 0
Disable timestamp storage.
smua.nvbuffer1.timestampresolution = 0.001
Set timestamp resolution to 0.001024 s.
smua.nvbuffer1.fillcount = 50
Set 50 as the number of readings the
buffer will take before restarting at index
1.
smua.nvbuffer1.fillmode = 0
Set the reading buffer to fill once (do
not overwrite old data).
Buffer read-only attribute programming examples
The follow programming examples illustrate use of buffer read-only attributes.
Buffer read-only attribute programming examples:
Command
Description
number = smua.nvbuffer1.n
Request the number of readings in the
buffer.
buffer_size = smua.nvbuffer1.capacity
Request buffer size.
Statistic attributes
Use the
smu
X
.buffer.getstats()
function to access the reading buffer data statistics. The table
below displays the attributes that you can use to access the reading buffer statistics.
The returned parameter has the attributes described in the following table.
Attributes for accessing reading buffer data
Attribute
When returned
Description
n
Always
The number of data points on which the statistics are based.
mean
When
n
> 0
The average of all readings added to the buffer.
stddev
When
n
> 1
The standard deviation of all readings (samples) added to the buffer.
min
When
n
> 0
A table containing data about the minimum reading value added to the
buffer.
max
When
n
> 0
A table containing data about the maximum reading value added to the
buffer.
If
n
equals zero (0), all other attributes will be
nil
because there is no data to base any statistics on.
If
n
equals 1, the
stddev
attribute will be
nil
because the standard deviation of a sample size of 1 is
undefined.