EasyManuals Logo

Keithley SourceMeter 2611 Reference Manual

Keithley SourceMeter 2611
594 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #111 background image
Series 2600 System SourceMeters Reference Manual TSP Programming Fundamentals 2-59
Return to Section 2 topics 2600S-901-01 Rev. A / May 2006
Branching
TSL uses the “if” keyword to do conditional branching.
--
-------------------------------- IF blocks ------------------------
--
if 0 then -- Zero IS true! This is a contrast to C where
print("Zero is true!") 0 evaluates false. In TSL, “nil” is false
else and everything else is true.
print("Zero is false.")
end -- if expression 1.
x = 1
y = 2
if (x and y) then
print("' if ' expression 2 was not false.")
end -- if expression 2.
if (x or y) then
print("' if ' expression 3 was not false.")
end -- if expression 3.
if (not x) then
print("' if ' expression 4 was not false.")
else
print("' if ' expression 4 was false.")
end -- if expression 4.
if x == 10 then
print("x = 10")
elseif y > 2 then
print("y > 2")
else
print("x is not equal to 10, and y is not less than 2.")
end -- if expression 5.
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.

Table of Contents

Other manuals for Keithley SourceMeter 2611

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keithley SourceMeter 2611 and is the answer not in the manual?

Keithley SourceMeter 2611 Specifications

General IconGeneral
BrandKeithley
ModelSourceMeter 2611
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals