![Keithley 2651A Скачать руководство пользователя страница 187](http://html1.mh-extra.com/html/keithley/2651a/2651a_reference-manual_661729187.webp)
Section 3: Functions and features
Model 2651A High Power System SourceMeter® Instrument Reference Manual
3-80
2651A-901-01 Rev. A / March 2011
Adding USER TESTS menu entries
The following function can be used in two ways to add an entry into the USER TESTS submenu:
display.loadmenu.add(
displayname, chunk
)
display.loadmenu.add(
displayname, chunk, memory
)
Where:
displayname
Name string to add to the menu
chunk
The code to be executed
memory
Specifies whether the
chunk
and
displayname
parameters are saved in
nonvolatile memory; set to one of the following values:
0
or
display.DONT_SAVE
1
or
display.SAVE(
default is
display.SAVE)
The
chunk
parameter can be made up of any valid Lua code. With the
memory
parameter set to
display.SAVE
, the entry is saved in nonvolatile memory. Scripts, functions, and variables used in
the chunk are not saved when
display.SAVE
is used. Functions and variables need to be saved
with the script (see
(on page 6-3)). If the script is not saved in nonvolatile memory, it
will be lost when the Model 2651A is turned off. See Example 1 below.
Example 1:
Assume a script with a function named “DUT1” has already been loaded into the Model 2651A, and
the script has NOT been saved in nonvolatile memory.
Now assume you want to add a test named “Test” to the USER TESTS menu. You want the test to
run the function named “DUT1” and sound the beeper. The following programming example illustrates
how to add “Test” to the menu, define the chunk, and then save
displayname
and
chunk
in
nonvolatile memory:
display.loadmenu.add("Test", "DUT1() beeper.beep(2, 500)", display.SAVE)
When “Test” is run from the front-panel USER TESTS menu, the function named “DUT1” will execute
and the beeper will beep for two seconds.
Now assume you turn the Model 2651A power off and then on again. Because the script was not
saved in nonvolatile memory, the function named “DUT1” is lost. When “Test” is again run from the
front panel, the beeper will beep, but “DUT1” will not execute because it no longer exists in the
runtime environment.
Example 2:
The following command adds an entry called “Part1” to the front-panel USER TESTS submenu for the
chunk “testpart([[Part1]], 5.0)”, and saves it in nonvolatile memory:
display.loadmenu.add("Part1", "testpart([[Part1]], 5.0)", display.SAVE)