High Voltage SourceMeter Instrument Reference Manual Section 14:
2470-901-01 Rev. A / May 2019 14-11
The statsVar 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 table includes:
ï‚§ reading: The reading value
ï‚§ timestamp: The timestamp of the minimum data point in the buffer
ï‚§ seconds: The time in seconds
ï‚§
: The time in fractional seconds
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
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
ï‚§
: The fractional seconds
If n equals zero (0), all other values are nil. If n equals 1, stddev is nil because the standard
dev
iation 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
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)