User manual
Section 7: Buffer: Data Storage and Retrieval Series 3700 System Switch/Multimeter Reference Manual
7-22 3700S-901-01 Rev. C / July 2008
Example:
Create a buffer with:
A capacity for 50 readings
Append mode enabled
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).
Because 30 readings are already stored, only 20 readings are taken and
stored. Error message 4915 is displayed.
3. The third time the measurement is called, the buffer is full (already has 50
readings). Because there is no more room, no readings are taken (nil
response for reading) and error message 4915 is again displayed.
The following listing provides the coding for the previous example:
-- Create a buffer named buf and allocate space for 50
readings.
buf = dmm.makebuffer(50)
-- Enable append buffer mode.
buf.appendmode = 1
-- Set count to 30.
dmm.measurecount = 30
-- Show the current number of readings in the buffer, and
then measure and store readings in the buffer (first
pass).
-- Output from the print command:
-- 0.000000000e+000
-- 5.245720223e-002
print(buf.n, dmm.measure(buf))
-- Show the current number of readings in the buffer, and
then measure and store readings in the buffer (second
pass).
-- Output from the print command:
-- 3.000000000e+001
-- -1.388141960e-001
-- 4915, Attempting to store past capacity of reading
buffer
print(buf.n, dmm.measure(buf))