8: TSP command reference Model 2450 Interactive SourceMeter® Instrument
8-10 2450-901-01 Rev. B/September 2013
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 older data with new data, the buffer statistics
include the data that was overwritten.
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 statistics parameter contains the values described in the following table.
Attribute When returned Description
A table that contains data about the minimum reading value that was added
to the buffer
The average of all readings added to the buffer
The standard deviation of all readings that were added to the buffer
The number of data points on which the statistics are based
n > 0
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.
Use the following command to get statsVar; a table with the following entries in it: n, min, max, mean, and
stddev.
statsVar = buffer.getstats(bufferVar)
Use the following commands to print these entries:
print(statsVar.n)
print(statsVar.mean)
print(statsVar.stddev)
print(statsVar.min.reading)
print(statsVar.min.timestamp)
print(statsVar.max.reading)
print(statsVar.max.timestamp)
The commands that return minimum and maximum values each also return tables. These tables contain the
following values:
Attribute Description
The min.timestamp is the timestamp of the minimum data point in the
buffer and the max.timestamp is the timestamp of the maximum data
point in the buffer