Series 2600 System SourceMeters Reference Manual TSP Programming Fundamentals 2-53
Return to Section 2 topics 2600S-901-01 Rev. A / May 2006
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
© 1994-2004 Tecgraf, PUC-Rio. See http://
www.lua.org, the official web site 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 function return
elseif nil until
for repeat else
local true false
then do in
break if or
end not while
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 is nil.
var = 1.0 -- var is now a number.
var = 0.3E-12 -- var is still a number.
var = 7 -- var is still a number.
var = "Hello world!" -- var is now a string.
var = "I said, Hello world!" -- var is still a string.
var = function(a, b) return(a+b) end -- var is now a function
that adds two numbers.
var = {1, 2., 3.00e0} -- var is now a table (i.e.,
array) with three
initialized members.