Keithley 708B Reference Manual page 208

Switching matrix
Hide thumbs Also See for 708B:
Table of Contents

Advertisement

Models 707B and 708B Switching Matrix Reference Manual
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.
Do not create variable names that are the same as the base names of Model 707B or 708B
Instrument Control Library (ICL) commands. Doing so will result in the loss of use of those
commands. For example, if you send the command digio = 5, you cannot access the digio.*
commands until the power to the instrument is turned off and then back on.
Variables can be one of the following types.
Variable types and values
Variable type
nil
boolean
number
string
function
table
To determine the type of a variable, you can call the type() function, as shown in the examples
below.
Example: Nil
Code
x = nil
print(x, type(x))
707B-901-01 Rev. A / August 2010
Value
not declared
true or false
number
sequence of words or characters
a block of code
an array
NOTE
Notes
Nil is the type of the value nil, whose main property is to
be different from any other value; usually it represents the
absence of a useful value.
Boolean is the type of the values false and true. In
Lua, both nil and false make a condition false; any
other value makes it true.
All numbers are real numbers; there is no distinction
between integers and floating-point numbers.
Functions can carry out a task or compute and return
values.
New tables are created with {} braces. For example,
{1, 2, 3.00e0}.
Output
nil
nil
Section 6: Instrument programming
6-17

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents