Model 2651A High Power System SourceMeter® Instrument Reference Manual
Section 6: Instrument programming
2651A-901-01 Rev. A / March 2011
6-13
-- Clear the display.
display.clear()
-- Prompt user for digital I/O line on which to output trigger.
myDigioLine = display.menu(
"Select digio line", "1 2 3 4 5 6 7 8 9")
-- Convert user input to a number.
intMyDigioLine = tonumber(myDigioLine)
-- Prompt user for digital output trigger mode.
myDigioEdge = display.menu(
"Select digio mode", "Rising Falling")
if myDigioEdge == "Rising" then
edgeMode = digio.TRIG_RISING
else
edgeMode = digio.TRIG_FALLING
end
-- Prompt user for output trigger pulsewidth.
myPulseWidth = display.prompt(
"000.0", "us", "Enter trigger pulsewidth", 10, 10, 100)
-- Scale the entered pulsewidth
myPulseWidth = myPulseWidth * 1e-6
-- Generate the pulse.
digio.trigger[intMyDigioLine].mode = edgeMode
digio.trigger[intMyDigioLine].pulsewidth = myPulseWidth
digio.trigger[intMyDigioLine].assert()
-- Alert the user through the display that the
-- output trigger has occurred.
display.setcursor(1, 1)
display.settext(
"Trigger asserted $Non digital I/O line " .. intMyDigioLine)
-- Wait five seconds and then return to main screen.
delay(5)
display.screen = display.SMUA