Standard Libraries - Keithley 708B Reference Manual

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

Advertisement

Section 6: Instrument programming

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 more. TSP
instruments also include instrument control extension libraries, which provide programming interfaces
to the instrumentation that can be accessed by the TSP. These libraries are automatically loaded
when the TSP starts and do not need to be managed by the programmer.
The following sections 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 TSP uses Lua 5.0.2.
Base library functions
Base library functions
Function
collectgarbage()
collectgarbage(limit)
gcinfo()
print(e1, e2, ...)
tonumber(x)
tonumber(x ,base)
tostring(x)
type(v)
6-30
Lua website
http://www.lua.org.
Description
Sets the garbage-collection threshold to the given limit (in Kbytes)
and checks it against the byte counter. If the new threshold is
smaller than the byte counter, then Lua immediately runs the
garbage collector. If there is no limit parameter, it defaults to 0
(which forces a garbage-collection cycle). See
management
Returns the number of kilobytes of dynamic memory that TSP is
using and the current garbage collector threshold (also in Kbytes).
See
Lua memory management
Receives any number of arguments, and generates a response
message, using the tostring function to convert them to strings.
The output is not formatted. For formatted output, you can use the
string.format command (see
31)).
Returns x converted to a number. If x is already a number, or a
convertible string, then the number is returned; otherwise, it returns
nil.
An optional argument specifies the base to interpret the numeral.
The base may be any integer between 2 and 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.
The possible results of this function are "nil" (a string, not the
value nil), number, string, Boolean, table, function,
thread, and userdata.
Models 707B and 708B Switching Matrix Reference Manual
NOTE
(on page 6-31) for more information.
(on page 6-31) for more information.
String library functions
Lua memory
(on page 6-
707B-901-01 Rev. A / August 2010

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents