Keithley SourceMeter 2600 Series Reference Manual page 111

Table of Contents

Advertisement

Series 2600 System SourceMeters Reference Manual TSP Programming Fundamentals 2-59
Branching
TSL uses the "if" keyword to do conditional branching.
--
-------------------------------- IF blocks ------------------------
--
if 0 then
print("Zero is true!")
else
print("Zero is false.
end
x = 1
y = 2
if (x and y) then
end
if (x or y) then
end
if (not x) then
else
end
if x == 10 then
elseif y > 2 then
else
end
Output of code above:
Zero is true!
' if ' expression 2 was not false.
' if ' expression 3 was not false.
' if ' expression 4 was false.
x is not equal to 10, and y is not less than 2.
print("' if ' expression 2 was not false.")
print("' if ' expression 3 was not false.")
print("' if ' expression 4 was not false.")
print("' if ' expression 4 was false.")
print("x = 10")
print("y > 2")
print("x is not equal to 10, and y is not less than 2.")
Return to
-- Zero IS true! This is a contrast to C where
0 evaluates false. In TSL, "nil" is false
and everything else is true.
)
"
-- if expression 1.
-- if expression 2.
-- if expression 3.
-- if expression 4.
-- if expression 5.
Section 2 topics
2600S-901-01 Rev. A / May 2006

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents