Keithley 2450 Reference Manual page 177

Interactive sourcemeter instrument
Table of Contents

Advertisement

Section 3: Functions and features
Reading buffer for . . . do loops
The following TSP examples illustrate the use of for . . . do loops when recalling data from a reading
buffer called mybuffer. The following code may be sent as one command line or as part of a script.
Sample outputs follow the line of code. Also see the
This example loop uses the printbuffer() command to show the reading, units, and relative
timestamps for all readings stored in the reading buffer. The information for each reading (reading,
units, and relative timestamps) is shown on a single line with the elements comma-delimited.
for x = 1, mybuffer.n do
printbuffer(x,x,mybuffer, mybuffer.units, mybuffer.relativetimestamps)
end
Example comma-delimited output of above code:
-1.5794739960384e-09, Amp DC, 0
-1.5190692453926e-11, Amp DC, 0.411046134
-2.9570144943758e-11, Amp DC, 0.819675745
-2.9361919146043e-11, Amp DC, 1.228263492
-3.0666566508408e-11, Amp DC, 1.636753752
-4.0868204653766e-11, Amp DC, 2.034403917
The following loop uses the print command instead of the printbuffer command. This loop
shows the same information described in the previous example (reading, units, and relative
timestamps for all readings stored in the buffer). However, because the print() command is used
instead of printbuffer(), each line is tab-delimited (rather than comma-delimited) to produce a
columnar output, as shown below:
for x = 1, mybuffer.n do
print(mybuffer.readings[x], mybuffer.units[x], mybuffer.relativetimestamps[x])
end
Example columnar-delimited output of above code:
-1.5794739960384e-09 Amp DC
-1.5190692453926e-11 Amp DC
-2.9570144943758e-11 Amp DC
-2.9361919146043e-11 Amp DC
-3.0666566508408e-11 Amp DC
-4.0868204653766e-11 Amp DC
Exceeding reading buffer capacity
When the reading buffer fill mode is set to fill once and the reading buffer count is not exceeded,
readings are stored as expected. But if new readings would exceed reading buffer capacity when they
are added to the active buffer index, the count is lowered to a new count so it does not exceed the
reading buffer capacity. Once the reading buffer is full (to the new count), no more readings are taken
and error message 4915 is displayed, stating that you attempted to exceed the capacity of the
reading buffer. If you attempt to store additional readings in a full reading buffer, the same message
appears, and no readings are taken.
3-32
Model 2450 Interactive SourceMeter® Instrument Reference Manual
printbuffer()
0
0.411046134
0.819675745
1.228263492
1.636753752
2.034403917
(on page 8-78) command.
2450-901-01 Rev. B/September 2013

Advertisement

Table of Contents
loading

Table of Contents