Standard Libraries - Keithley 3700A Series Reference Manual

System switch/multimeter
Hide thumbs Also See for 3700A Series:
Table of Contents

Advertisement

Series 3700A System Switch/Multimeter Reference Manual

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.
Base library functions
Base library functions
Function
collectgarbage()
collectgarbage(limit)
gcinfo()
tonumber(x)
tonumber(x, base)
tostring(x)
type(v)
3700AS-901-01 Rev. D/June 2018
®
) scripting engine instruments also include instrument control
Lua website
(http://www.lua.org).
Description
Sets the garbage-collection threshold to the given limit (in
kilobytes) and checks it against the byte counter. If the new
threshold is smaller than the byte counter, Lua immediately
runs the garbage collector. If there is no limit parameter, it
defaults to zero (0), which forces a garbage-collection cycle.
See
Lua memory management
information.
Returns the number of kilobytes of dynamic memory that the
Test Script Processor (TSP
returns the present garbage collector threshold (also in
kilobytes). See
Lua memory management
more information.
Returns x converted to a number. If x is already a number, or a
convertible string, the number is returned; otherwise, it returns
nil.
An optional argument specifies the base to use when
interpreting the numeral. The base may be any integer from 2 to
36, inclusive. In bases above 10, the letter A (in either upper or
lower case) represents 10, B represents 11, and so forth, with Z
representing 35. In base 10, the default, the number may have
a decimal part, as well as an optional exponent. In other bases,
only unsigned integers are accepted.
Receives an argument of any type and converts it to a string in
a reasonable format.
Returns (as a string) the type of its only argument. The possible
results of this function are "nil" (a string, not the value nil),
"number", "string", "boolean", "table", "function",
"thread", and "userdata".
Section 10: Instrument programming
(on page 10-30) for more
®
) scripting engine is using, and
(on page 10-30) for
10-29

Advertisement

Table of Contents
loading

Table of Contents