Keithley 2651A Reference Manual page 267

High power system sourcemeter instrument
Hide thumbs Also See for 2651A:
Table of Contents

Advertisement

Model 2651A High Power System SourceMeter® Instrument Reference Manual
Operator precedence
Precedence
Highest
.
.
.
.
.
.
Lowest
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 is true in Lua.
The syntax of a conditional block is as follows:
if expression then
block
elseif expression then
block
else
block
end
Where:
expression is Lua code that evaluates to either true or false
block consists of one or more Lua statements
2651A-901-01 Rev. A / March 2011
Operator
^ (exponentiation)
not, - (unary)
*, /
+, -
.. (concatenation)
<, >, <=, >=, ~=, ==
and
or
=
(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-23

Advertisement

Table of Contents
loading

Table of Contents