Keithley 708B Reference Manual page 211

Switching matrix
Hide thumbs Also See for 708B:
Table of Contents

Advertisement

Section 6: Instrument programming
Example 2
Code
add_three = function(parameter1,
parameter2, parameter3)
return parameter1 + parameter2 +
end
print(add_three(3, 4, 5))
Example 3
Code
function sum_diff_ratio(parameter1,
parameter2)
psum = parameter1 + parameter2
pdif = parameter1 - parameter2
prat = parameter1 / parameter2
return psum, pdif, prat
end
sum, diff, ratio = sum_diff_ratio(2, 3)
print(sum)
print(diff)
print(ratio)
Create functions using scripts
You can use scripts to define functions. Scripts that define a function are like any other script: They
do not cause any action to be performed on the instrument until they are executed. The global
variable of the function does not exist until the script that created the function is executed.
A script can consist of one or more functions. Once a script has been run, the computer can call
functions that are in the script directly.
The following steps use TSB Embedded. You can also use the loadscript and endscript
commands to create the script. See
(on page 6-5).
6-20
parameter3
Create a script by sending commands over the remote interface
Models 707B and 708B Switching Matrix Reference Manual
Notes and output
Creates a variable named add_three that has
a variable type of function.
1.200000000e+01
Notes and output
Returns multiple parameters (sum, difference,
and ratio of the two numbers passed to it).
5.000000000e+00
-1.000000000e+00
6.666666667e-01
NOTE
707B-901-01 Rev. A / August 2010

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents