Keithley 2601B Reference Manual page 294

2600b series system sourcemeter instrument
Hide thumbs Also See for 2601B:
Table of Contents

Advertisement

Series 2600B System SourceMeter® Instrument Reference Manual
The following steps use TSB Embedded. You can also use the loadscript and endscript
commands to create the script over the remote interface. See
over the remote interface
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. Click Save Script.
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.
4. 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
5. Run the new function with a value.
MyFunction("world")
The response message is:
Hello world
Group commands using the function keyword
The following script contains instrument commands that display the name of the person that is using
the script on the front panel of the instrument. It takes one parameter to represent this name. When
this script is run, the function is loaded in memory. Once loaded into memory, you can call the
function outside of the script to execute it.
When calling the function, you must specify a string for the name argument of the function. For
example, to set the name to John, call the function as follows:
myDisplay("John")
Example: User script
User script created in Test Script Builder or
TSB Embedded
function myDisplay(name)
display.clear()
display.settext(
name .. "$N is here!")
end
Operators
You can compare and manipulate Lua variables and constants using operators.
2600BS-901-01 Rev. B / May 2013
(on page 6-4).
Variable types
User script created in user's own program
loadscript
function myDisplay(name)
display.clear()
display.settext(
end
endscript
Section 6: Instrument programming
Load a script by sending commands
(on page 6-14)).
name .. " $N is here!")
6-17

Advertisement

Table of Contents
loading

This manual is also suitable for:

2604b2614b2634b2635b2636b2602b ... Show all

Table of Contents