Section 6: Reading buffers
Series 3700A System Switch/Multimeter Reference Manual
6-16
3700AS-901-01 Rev. D/June 2018
The code for the previous example follows:
-- 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.000000
-- 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.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,
-- and then measure and store readings in the
-- buffer (third pass).
-- Output from the print command:
-- 5.000001
-- nil
-- 4915, Attempting to store past capacity of reading buffer
print(buf.n, dmm.measure(buf))