Series 2600B System SourceMeter® Instrument Reference Manual
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.
Arithmetic operators
Operator
Description
+
addition
-
subtraction
*
multiplication
/
division
negation (for example, c = −a)
-
^
exponentiation
2600BS-901-01 Rev. E / January 2019
User script created in user's own program
loadscript
function myDisplay(name)
display.clear()
display.settext(
name .. " $N is here!")
end
endscript
Section 10: Instrument programming
10-23
Need help?
Do you have a question about the KEITHLEY System SourceMeter 2636B and is the answer not in the manual?