Dual buffer example
The programming example below shows a script that stores current and voltage readings using
buffer 1 for current and buffer 2 for voltage readings. The 2600B stores 100 current and voltage
readings and then recalls all 100 sets of readings.
-- Restore 2600B defaults.
smua.reset()
-- Select measure I autorange.
smua.measure.autorangei = smua.AUTORANGE_ON
-- Select measure V autorange.
smua.measure.autorangev = smua.AUTORANGE_ON
-- Select ASCII data format.
format.data = format.ASCII
-- Clear buffer 1.
smua.nvbuffer1.clear()
-- Clear buffer 2.
smua.nvbuffer2.clear()
-- Set buffer count to 100.
smua.measure.count = 100
-- Set measure interval to 0.1 s.
smua.measure.interval = 0.1
-- Select source voltage function.
smua.source.func = smua.OUTPUT_DCVOLTS
-- Output 1 V.
smua.source.levelv = 1
-- Turn on output.
smua.source.output = smua.OUTPUT_ON
-- Store current readings in buffer 1, voltage readings in buffer 2.
smua.measure.overlappediv(smua.nvbuffer1, smua.nvbuffer2)
-- Wait for buffer to fill.
waitcomplete()
-- Turn off output.
smua.source.output = smua.OUTPUT_OFF
-- Output buffer 1 readings 1 to 100.
printbuffer(1, 100, smua.nvbuffer1)
-- Output buffer 2 readings 1 to 100.
printbuffer(1, 100, smua.nvbuffer2)
Remote reading buffer programming
You can get readings by making overlapped or sequential measurements. Overlapped commands do
not finish executing before the next command starts. Sequential commands complete execution
before the next command starts executing.
The measured value is not the only component of a reading. The measurement status (for example,
“In Compliance” or “Overranged”) is also an element of data associated with a particular reading.
All routines that return measurements can store the measurements in the reading buffers. Overlapped
measurements always return readings in a reading buffer. Nonoverlapped measurement functions
can return single-point measurement values or store multiple values in a reading buffer.