2470 High Voltage SourceMeter Instrument Reference Manual
Section 14: TSP command reference
2470-901-01 Rev. A /
May
2019
14-11
The
statsVar
parameter contains the values described in the following table.
Attribute
When returned
Description
min
n
> 0
A table that contains data about the minimum reading value that was added
to the buffer; the table includes:
reading
: The reading value
timestamp
: The timestamp of the minimum data point in the buffer
seconds
: The time in seconds
fractionalseconds
: The time in fractional seconds
mean
n
> 0
The average of all readings added to the buffer
stddev
n
> 1
The standard deviation of all readings that were added to the buffer
n
Always
The number of data points on which the statistics are based
max
n
> 0
A table that contains data about the maximum reading value that was added
to the buffer; the table includes:
reading
: The reading value
timestamp
: The timestamp of the maximum data point in the buffer
seconds
: The time in seconds
fractionalseconds
: The fractional seconds
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 values from
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
.min.seconds)
print(
statsVar
.min.fractionalseconds)
print(
statsVar
.max.reading)
print(
statsVar
.max.seconds)
print(
statsVar
.max.fractionalseconds)
print(
statsVar
.max.timestamp)
Example
reset()
trigger.model.load("SimpleLoop", 12, 0.001, defbuffer1)
trigger.model.initiate()
waitcomplete()
stats = buffer.getstats(defbuffer1)
print(stats.n)
print(stats.min.reading)
print(stats.max.reading)
print(stats.stddev)