Keithley DMM7510 Reference Manual page 594

7 1/2 digit graphical sampling multimeter
Hide thumbs Also See for DMM7510:
Table of Contents

Advertisement

Model DMM7510 7½ Digit Graphical Sampling Multimeter Reference Manual
Example: Repeat until
list = {"One", "Two", "Three", "Four", "Five", "Six"}
print("Count elements in list using repeat:")
element = 1
repeat
print(element, list[element])
element = element + 1
until not list[element]
Output:
Count elements in list
using repeat:
1
One
2
Two
3
Three
4
Four
5
Five
6
Six
For loops
There are two variations of for statements supported in Lua: Numeric and generic.
In a for loop, the loop expressions are evaluated once, before the loop starts.
The output you get from these examples may vary depending on the data format settings of the
instrument.
Example: Numeric for
list = {"One", "Two", "Three", "Four", "Five", "Six"}
---------- For loop -----------
print("Counting from one to three:")
for element = 1, 3 do
print(element, list[element])
end
print("Counting from one to four, in steps of two:")
for element = 1, 4, 2 do
print(element, list[element])
end
The numeric for loop repeats a block of code while a control variable runs through an
arithmetic progression.
Output:
Counting from one to three:
1
One
2
Two
3
Three
Counting from one to four, in steps of two:
1
One
3
Three
DMM7510-901-01 Rev. B / May 2015
Section 7: Introduction to TSP commands
7-23

Advertisement

Table of Contents
loading

Table of Contents