Standard Libraries - Keithley 2651A Reference Manual

High power system sourcemeter instrument
Hide thumbs Also See for 2651A:
Table of Contents

Advertisement

Section 6: Instrument programming
Example: Loop array
atable = {1, 2, 3, 4}
i = 1
while atable[i] do
print(atable[i])
i = i + 1
end

Standard libraries

In addition to the standard programming constructs described in this document, Lua includes
standard libraries that contain useful functions for string manipulation, mathematics, and related
functions. Test Script Processor (TSP
extension libraries, which provide programming interfaces to the instrumentation that can be
accessed by the TSP scripting engine. These libraries are automatically loaded when the TSP
scripting engine starts and do not need to be managed by the programmer.
The following topics provide information on some of the basic Lua standard libraries. For additional
information, see the
When referring to the Lua website, please be aware that the TSP scripting engine uses Lua 5.0.2.
6-30
Model 2651A High Power System SourceMeter® Instrument Reference Manual
®
) scripting engine instruments also include instrument control
Lua website
http://www.lua.org.
Defines a table with four numeric
elements.
Loops through the array and prints
each element.
The Boolean value of
atable[index] evaluates to true if
there is an element at that index. If
there is no element at that index, nil
is returned (nil is considered to be
false).
Output:
1.00000e+00
2.00000e+00
3.00000e+00
4.00000e+00
NOTE
2651A-901-01 Rev. A / March 2011

Advertisement

Table of Contents
loading

Table of Contents