
Section 6
:
Buffer: Data Storage and Retrieval
Series 3700 System Switch/Multimeter Reference Manual
6-12
Document Number: 3700S-901-01 Rev. A / August 2007
Create a buffer with:
A capacity for 50 readings
Append mode
Measure count to 30
Tell the instrument to print the current number of buffer elements stored and take readings to
store in the buffer. The following occurs:
1. The first time the measurement is called, the buffer is empty (no readings) so it stores 30
readings.
2. The second time the measurement is called it stores only 20 readings. This is because 30 +
30 is 60 readings, which exceeds buffer capacity (50). Since, 30 readings are already
stored, only 20 readings are taken and stored. Error message 4915 is generated.
3. The third time the measurement is called, the buffer is full (already has 50 readings). Since
there is no more room, no readings taken (nil response for reading) and error message 4915
is again generated.
The following listing provides programming for the previous example:
Command
Description
buf = dmm.makebuffer(50)
Create a buffer named "buf" and allocated
space for 50 readings.
buf.appendmode = 1
Enable append buffer mode.
dmm.measurecount = 30
Set count to 1.
print(buf.n, dmm.measure(buf))
Show the current number of readings in the
buffer then measure and store readings in
buffer (1st time).
Display:
0.000000
5.245720223e-002
print(buf.n, dmm.measure(buf))
Show the current number of readings in the
buffer, then measure and store readings in
buffer (2nd time).
Display:
3.000001
-1.388141960e-001
4915, Attempting to store past
capacity of reading buffer
print(buf.n, dmm.measure(buf))
Show the current number of readings in the
buffer then measure and store readings in
buffer (3rd time).
Display:
5.000001
nil
4915, Attempting to store past
capacity of reading buffer