Keithley SourceMeter 2600 Series Reference Manual page 105

Table of Contents

Advertisement

Series 2600 System SourceMeters Reference Manual TSP Programming Fundamentals 2-53
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
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
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}
function
nil
repeat
true
do
if
not
Hello world!
"
"
"
I said, Hello world!
Return to
©
1994-2004 Tecgraf, PUC-Rio. See http://
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 2 topics
2600S-901-01 Rev. A / May 2006

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents