Keithley 2601B Reference Manual page 296

2600b series system sourcemeter instrument
Hide thumbs Also See for 2601B:
Table of Contents

Advertisement

Series 2600B System SourceMeter® Instrument Reference Manual
Example: Concatenation
print(2 .. 3)
print("Hello " .. "World")
Operator precedence
Operator precedence in Lua follows the order below (from higher to lower priority):
^ (exponentiation)
not, - (unary)
*, /
+, −
.. (concatenation)
<, >, <=, >=, ~=, ==
and
or
You can use parentheses to change the precedences in an expression. The concatenation ("..") and
exponentiation ("^") operators are right associative. All other binary operators are left associative. The
examples below show equivalent expressions.
Equivalent expressions
reading + offset < testValue/2+0.5
3+reading^2*4
Rdg < maxRdg and lastRdg <=
expectedRdg
-reading^2
reading^testAdjustment^2
Conditional branching
Lua uses the if, else, elseif, then, and end keywords to do conditional branching.
Note that in Lua, nil and false are false and everything else is true. Zero (0) is true in Lua.
2600BS-901-01 Rev. B / May 2013
23
Hello World
=
(reading + offset) <
((testValue/2)+0.5)
=
3+((reading^2)*4)
=
(Rdg < maxRdg) and (lastRdg <=
expectedRdg)
=
-(reading^2)
=
reading^(testAdjustment^2)
Section 6: Instrument programming
6-19

Advertisement

Table of Contents
loading

This manual is also suitable for:

2604b2614b2634b2635b2636b2602b ... Show all

Table of Contents