![background image](http://html2.mh-extra.com/html/keithley/2657a/2657a_reference-manual_4007750259.webp)
Section 6: Instrument programming
Model 2657A High Power System SourceMeter® Instrument Reference Manual
6-10
2657A-901-01 Rev. B/December 2012
-- 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
Fundamentals of programming for TSP
Introduction
To conduct a test, a computer (controller) is programmed to send sequences of commands to an
instrument. The controller orchestrates the actions of the instrumentation. The controller is typically
programmed to request measurement results from the instrumentation and make test sequence
decisions based on those measurements.
To take advantage of the advanced features of the instrument, you can add programming commands
to your scripts. Programming commands control script execution and provide tools such as variables,
functions, branching, and loop control.
The Test Script Processor (TSP
®
) scripting engine is a Lua interpreter. In TSP-enabled instruments,
the Lua programming language has been extended with Keithley-specific instrument control
commands.
Содержание 2657A
Страница 3: ......