
Section 6
:
Buffer: Data Storage and Retrieval
Series 3700 System Switch/Multimeter Reference Manual
6-10
Document Number: 3700S-901-01 Rev. A / August 2007
Dynamic buffer programming example
The listing below shows a programming example for storing data using a dynamically-allocated
buffer named "mybuff."
Command
Description
dmm.reset('all')
Resets the DMM.
mybuffer = dmm.makebuffer(100000)
Create a buffer named mybuffer and
allocate space for 100,000 readings.
mybuffer.appendmode = 1
Enable append buffer mode.
dmm.measurecount = 1
Set count to 1.
dmm.func = dmm.DC_VOLTS
Select the DMM function as DC volts.
for x = 1, 100 do
dmm.measure(mybuffer)
end
Start for…do loop.
Measure and store readings in buffer.
End loop.
printbuffer(1, 100, mybuffer.readings)
Return readings 1-100.
printbuffer(1, 100, mybuffer.units)
Return units 1-100.
Buffer for...do loops
The following examples illustrate the use of for...do loops with respect to recalling buffer 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
printbuffer
(on page 9-
155) ICL command.
NOTE
Buffer mybuffer has timestamp collection enabled.
for x = 1,mybuffer.n do
printbuffer(x,x,mybuffer, mybuffer.units,
mybuffer.relativetimestamps)
end
Sample output of above code:
3.535493836e-002, Volts DC, 0.000000
-4.749810696e-002, Volts DC, 5.730966000e-002
-8.893087506e-002, Volts DC, 7.722769500e-002
4.164193198e-002, Volts DC, 1.246876800e-001
-6.900507957e-002, Volts DC, 1.815213600e-001