Model 2461 Interactive SourceMeter® Instrument Reference Manual
Appendix C: Status model
2461-901-01 A/November 2015
C-25
SRQ when a measurement completes
This example shows you how to generate a service request (SRQ) when a measurement completes.
This is most useful when you have a measurement that will take a long time to complete and you
wish to free up the controlling computer to do other things while it is waiting. This can happen if you
have configured the measurement with a long delay value, a large aperture, or have enabled filtering.
This code configures the source-measure unit (SMU) for a long reading, and then configures the
trigger model to generate notify events before and after the measurement. The status model is then
configured to generate an SRQ based on the "Measurement Done" notify event. The output is turned
on and the trigger model is used to take the measurement. When the measurement completes, the
instrument generates an SRQ and returns the data.
Using SCPI commands:
*RST
TRAC:CLE
SOUR:VOLT:RANG 1
SOUR:VOLT 1
SOUR:VOLT:ILIM 10e-3
SENS:CURR:RANG 10e-3
SENS:NPLC 10
TRIG:BLOC:LOG:EVEN 1, INFO1, "Measurement Started."
TRIG:BLOC:MEAS 2, "defbuffer1"
TRIG:BLOC:LOG:EVEN 3, INFO2, "Measurement Done."
STAT:CLE
STAT:OPER:MAP 0, 2735, 2734
STAT:OPER:ENAB 1
*SRE 128
OUTP ON
INIT
*WAI
OUTP OFF
TRAC:DATA? 1, 1, "defbuffer1", READ
Using TSP commands:
reset()
-- Clear the reading buffer
defbuffer1.clear()
-- Configure the source and take a measurement
smu.source.range = 1
smu.source.level = 1
smu.source.ilimit.level = 10e-3
smu.measure.range = 10e-3
-- Setup the NPLC for a really long measurement
smu.measure.nplc = 10
-- Use the trigger model to create events before and after
-- the measurement to generate SRQ when measurement is done.
trigger.model.setblock(1, trigger.BLOCK_LOG_EVENT, trigger.LOG_INFO1, "Measurement
Started.")
trigger.model.setblock(2, trigger.BLOCK_MEASURE, defbuffer1)
trigger.model.setblock(3, trigger.BLOCK_LOG_EVENT, trigger.LOG_INFO2, "Measurement
Done.")