EasyManua.ls Logo

Tektronix Keithley SourceMeter 2470 - Page 608

Tektronix Keithley SourceMeter 2470
995 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
Loading...
Section
13: Introduction to TSP commands 2470 High Voltage SourceMeter Instrument
Reference Manual
13-22 2470-901-01 Rev. A / May 2019
E
xample: Else and elseif
x = 1
y = 2
if x and y then
print("'if' expression 2 was not false.")
end
if x or y then
print("'if' expression 3 was not false.")
end
if not x then
print("'if' expression 4 was not false.")
else
print("'if' expression 4 was false.")
end
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 greater than 2.")
end
Output:
'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 greater than 2.
Loop control
If you need to repeat code execution, you can use the Lua while, repeat, and for control
structures. To exit a loop, you can use the break keyword.
While loops
To use conditional expressions to determine whether to execute or end a loop, you use while loops.
These loops are similar to Conditional branching (on page 13-21
) statements.
while expression do
block
end
Where:
expression is Lua code that evaluates to either true or false
block consists of one or more Lua statements

Table of Contents

Other manuals for Tektronix Keithley SourceMeter 2470

Related product manuals