User manual

Series 3700 System Switch/Multimeter Reference Manual Section 2: TSP Programming Fundamentals
3700S-901-01 Rev. C / July 2008 2-19
Interactive script
An interactive script prompts the operator (on the Series 3700 display) to input
test parameters (using the Series 3700 front panel). The chunk fragment in the
following table uses display messages to prompt the operator to select a
measure function (DCV or 2-wire) and a range based on function, and to input
the measurement speed. When an input prompt is displayed, the script will wait
until the operator inputs the parameter and/or presses the ENTER key.
The display.prompt command in the following script prompts the user to
input a measurement speed. If a value is not entered, the default level (1) will be
set when ENTER is pressed. The operator will not be able to input values that
are not within the limits (minimum of 0.01 and maximum of 3).
Example of an interactive script chunk fragment (Test Script Builder or user‟s
program):
-- Prompt operator to select function:
myfunc = display.menu ('Select function', 'dcvolts
twowireohms')
-- Now prompt for range based on function selected
if (myfunc == 'dcvolts') then
myrange = display.menu('Select range', '10 100')
if (myrange == '10') then
range_value = 10
else
range_value = 100
end
else
myrange = display.menu('Select range', '1000 10000')
if (myrange == '1000') then
range_value = 1000
else
range_value = 10000
end
end
-- Prompt operator to set (input) measurement speed
speed = display.prompt('0.00', 'NPLC', 'Enter measure
speed', 1, 0.01, 3)
-- Wait for operator to set the measurement speed
dmm.reset('all')
dmm.func = myfunc
dmm.range = range_value
dmm.nplc = speed
print(dmm.measure())