Single pulse example code
Even though no measurements are made in this example, a measure range is set. When sourcing
voltage, it is good practice to set the current measure range equal to the triggered source limit range.
This is especially important when the triggered limit is greater than 100 mA. If the measure range is
not set, it may affect the shape of the pulse. This step is not necessary when sourcing current.
-- Reset SourceMeter instrument to default conditions.
reset()
-- Generate a single pulse with the following characteristics:
-- * Bias (idle) level = 0 V
-- * Pulse level = 5 V
-- * Pulse width = 500 us
-- Configure the source function.
smua.source.func = smua.OUTPUT_DCVOLTS
-- Set the voltage source range and the idle or bias source level and limit.
smua.source.rangev = 5
smua.source.levelv = 0
smua.source.limiti = 0.1
-- Configure the trigger-timer parameters to output a single 500 us pulse.
trigger.timer[1].delay = 0.0005
trigger.timer[1].count = 1
trigger.timer[1].passthrough = false
-- Start the timer when the SMU moves from the ARM layer to the TRIGGER layer.
trigger.timer[1].stimulus = smua.trigger.ARMED_EVENT_ID
-- Configure the trigger model to execute a single-point voltage pulse list sweep.
-- No measurements are made.
smua.trigger.source.listv({5})
smua.trigger.source.action = smua.ENABLE
smua.trigger.measure.action = smua.DISABLE
-- Set the trigger source limit to the same value as the bias limit.
smua.trigger.source.limiti = smua.LIMIT_AUTO
smua.measure.rangei = 0.1
-- Configure the source action to start immediately.
smua.trigger.source.stimulus = 0
-- Configure the endpulse action to achieve a pulse.
smua.trigger.endpulse.action = smua.SOURCE_IDLE
smua.trigger.endpulse.stimulus = trigger.timer[1].EVENT_ID
-- Set the appropriate counts for the trigger model.
smua.trigger.arm.count = 1
smua.trigger.count = 1
-- Turn on the SMU output and initiate the trigger model to output a single pulse.
smua.source.output = smua.OUTPUT_ON
smua.trigger.initiate()
-- Wait for the sweep to complete.
waitcomplete()
-- Turn off SMU output.
smua.source.output = smua.OUTPUT_OFF