Section 6: Instrument programming
Model 2651A High Power System SourceMeter® Instrument Reference Manual
6-16
2651A-901-01 Rev. A / March 2011
Lua reserved words
You cannot use the following words for function or variable names.
Lua reserved words
and for or
break function
repeat
do if return
else in
then
elseif local true
end nil until
false not
while
In addition to the Lua reserved words, you also cannot use command group names as variable
names. Doing so will result in the loss of use of the command group. For example, if you send the
command digio = 5, you cannot access the digio.* commands until you cycle the power to the
instrument. These groups include:
Command group names
beeper lan
bit localnode
dataqueue opc
delay reset
digio smua
display status
eventlog timer
errorqueue trigger
exit tsplink
format tspnet
fs userstring
gpib waitcomplete
io
Values and variable types
In Lua, you use variables to store values in the runtime environment for later use.
Lua is a dynamically typed language; the type of the variable is determined by the value that is
assigned to the variable.
Variables in Lua are assumed to be global unless they are explicitly declared to be local. A global
variable is accessible by all commands. Global variables do not exist until they have been used.