Test Script Language (Tsl) Reference - Keithley 2601 Reference Manual

System sourcemeter 2600 series (smu)
Hide thumbs Also See for 2601:
Table of Contents

Advertisement

Series 2600 System SourceMeter® Instruments Reference Manual

Test Script Language (TSL) reference

Introduction
A script is a program that the Test Script Processor (TSP) executes. A script is written using the
Test Script Language (TSL). TSL is an efficient language, with simple syntax and extensible
semantics. TSL is derived from the Lua programming language, Copyright
PUC-Rio. See http://www.lua.org, the official website for the Lua Programming Language, for more
information. Also, http://lua-users.org internet site is created for and by users of Lua programming
language and is another source of useful information.
Reserved words
and
elseif
for
local
then
break
end
Variables and types
TSL has six basic types; nil, Boolean, number, string, function, and table. TSL is a dynamically
typed language, which means variables do not need to be declared as a specific type. Instead,
variables assume a type when a value is assigned to them. Therefore, each value carries its own
type. If a variable has not been assigned a value, the variable defaults to the type nil. All numbers
are real numbers. There is no distinction between integers and floating-point numbers in TSL.
var = nil
var = 1.0
var = 0.3E-12
var = 7
var =
var =
var = function(a, b) return(a+b) end
var = {1, 2., 3.00e0}
Nil is a type with a single value, nil , whose main property is to be different from any other value.
Global variables have a nil value by default—before a first assignment—and you can assign nil
to a global variable to delete it. TSL uses nil as a kind of non-value to represent the absence of
a useful value.
2600S-901-01 Rev. C / January 2008
function
nil
repeat
true
do
if
not
"
Hello world!
"
"
I said, Hello world!
Return to
return
until
else
false
in
or
while
-- var is nil.
-- var is now a number .
-- var is still a number.
-- var is still a number.
-- var is now a string.
-- var is still a string.
"
-- var is now a function
that adds two numbers.
-- var is now a table (i.e.,
array) with three
initialized members.
Section Topics
Section 2: TSP Programming
©
1994-2004 Tecgraf,
2-45

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

26362602261126122635

Table of Contents