EasyManuals Logo

Tektronix KEITHLEY 2600B Series User Manual

Tektronix KEITHLEY 2600B Series
834 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #240 background imageLoading...
Page #240 background image
Series 2600B System SourceMeter® instrument Reference Manual Section 8: Instrument programming
2600BS-901-01 Rev. F/August 2021 8-19
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 over the remote interface. See Load a script by sending commands
over the remote interface (on page 8-4).
Steps to create a function using a script:
1. In TSB Embedded, enter a name into the TSP Script box. For example, type MakeMyFunction.
2. Enter the function as the body of the script. This example concatenates two strings:
MyFunction = function (who)
print ("Hello".. who)
end
3. Select Save Script.
4. MakeMyFunction is now on the instrument in a global variable with the same name as the script
(MakeMyFunction). However, the function defined in the script does not yet exist because the
script has not been executed.
5. Run the script as a function. For this example, send:
MakeMyFunction()
This instructs the instrument to run the script, which creates the MyFunction global variable.
This variable is of the type "function" (see Variable types (on page 8-16)).
6. Run the new function with a value.
MyFunction("world")
The response message is:
Hello world.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tektronix KEITHLEY 2600B Series and is the answer not in the manual?

Tektronix KEITHLEY 2600B Series Specifications

General IconGeneral
BrandTektronix
ModelKEITHLEY 2600B Series
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals