8: TSP command reference Model 2461 Interactive SourceMeter® Instrument Reference Manua
8-12 2461-901-01 A/November 2015
buffer.getstats()
This function returns statistics from a specified reading buffer.
Type TSP-Link accessible
Affected by Where saved Default value
Usage
buffer.getstats()
buffer.getstats(bufferVar)
statsVar = buffer.getstats(bufferVar)
The name of the reading buffer, which may be a default buffer (defbuffer1 or
defbuffer2) or a user-defined buffer; if no buffer is specified, this parameter
defaults to
A table with the following entries: n, min, max, mean, and stddev; see Details for
information on the entries
Details
This function returns a table with statistical data about the data that was placed in the reading buffer.
The instrument automatically updates reading buffer statistics as data is added to the reading buffer.
When the reading buffer is configured to fill continuously and overwrite old data with new data, the
buffer statistics include the data that was overwritten. To get statistics that do not include data that
has been overwritten, define a large buffer size that will accommodate the number of readings you
will make.
The table returned from this function provides statistics at the time the function is called. Although the
instrument continues to update the statistics, the table that is returned is not updated. To get fresh
statistics, call this function again.
The statsVar parameter contains the values described in the following table.
Attribute When returned Description
n > 0
A table that contains data about the minimum reading value that was added
The average of all readings added to the buffer
> 1
The standard deviation of all readings that were added to the buffer
The number of data points on which the statistics are based
A table that contains data about the maximum reading value that was added
to the buffer
If n equals zero (0), all other values are nil. If n equals 1, stddev is nil because the standard
deviation of a sample size of 1 is undefined.