Series 3700A System Switch/Multimeter Reference Manual
Section 6: Reading buffers
3700AS-901-01 Rev. D/June 2018
6-7
To delete a dynamically allocated buffer, use the command
bufferVar
= nil.
Command
Description
dmm.appendbuffer()
Creates a file on a USB flash drive if it doesn't already
exist. If the file already exists on the flash drive, it will be
overwritten.
dmm.buffer.catalog()
An iterator that can act on all reading buffer names in the
system.
dmm.buffer.info("buffer name")
Returns the number of stored readings in the specified
buffer, along with the overall buffer capacity. The first
returned value is the stored readings number, while the
second is the capacity.
dmm.buffer.maxcapacity
Returns the overall maximum storage capacity of all
reading buffers in the system.
dmm.buffer.usedcapacity
Returns the sum storage capacity allocated for all
currently created reading buffers in the system.
dmm.makebuffer()
Creates buffer to sore measurement data.
dmm.savebuffer()
Saves buffer data to a file on a USB flash drive. If the file
already exists on the flash drive, it will be overwritten.
To see the current storage number and capacity of all reading buffers in the system, use the following
at a Test Script Processor (TSP
TM
) prompt or in a script:
for n in dmm.buffer.catalog() do stored, cap = dmm.buffer.info(n) print(n, 'stored
= ' .. stored, 'capacity = ' .. cap) end
Sample output:
buf1
stored = 0
capacity = 1000
buf2
stored = 0
capacity = 2000
buf4
stored = 0
capacity = 4000
buf5
stored = 0
capacity = 5000
buf3
stored = 0
capacity = 3000
As the sample output shows, the system has five reading buffers, but currently none of them have
data stored in them (
stored = 0
). The storage capacity of the buffers ranges from 1000 to 5000. If
you send:
print(dmm.buffer.usedcapacity)
The output is 1.500004.
This means the system is allocating 15000 of its maximum storage capacity for reading buffers.
Reading buffers
A reading buffer is based on a Lua table. The measurements themselves are accessed by ordinary
array notation. If
rb
is a reading buffer, the first measurement is accessed as
rb[1]
, the ninth
measurement as
rb[9]
, and so on. The additional information in the table is accessed as additional
members of the table.