6: Instrument programming Series 2600B System SourceMeter® Instrument
6-12 2600BS-901-01 Rev. C / August 2016
Function and variable name restrictions
You cannot use factory script names, functions created by factory scripts, Lua reserved words and
top level command names for function or variable names.
For information on factory script names, see Factory scripts (on page 5-20
).
You cannot use the following Lua reserved words for function or variable names.
Lua reserved words
Do not use top-level command names as variable names. If you do, you will lose access to all
commands that start with that name until the global variables are restored. For example, if you send
the command digio = 5, you lose access to the digio.* commands. To restore the commands listed
in the table (except node) and access to the digio.* commands, send the restoreglobals
command or restart the instrument. The top-level command names are listed in the following table.
Top level command names
Values and variable types
In Lua, you use variables to store values in the run-time 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 assigned a
value.