
Chapter 10 Assignment Statements
10-1
10.1 Variables
LET (Statement) [Conforms to SLIM]
Function
Assigns a value to a variable.
Format
[LET] <Variable name> = <Arithmetic expression>
Explanation
You can ignore [LET].
As a rule the <variable name> type and the <arithmetic expression> type must
be the same.
If the variable name type and the arithmetic expression type are different, they
are converted as follows.
• <Variable name> is converted to the variable type.
• When a real variable is converted to an integer, the decimal places are
rounded down.
• When a double precision variable is converted to a single precision real
variable, the value is rounded to 7 significant digits.
• Calculations are performed based on the precision of the type with the
higher precision.
Example
6-/4-axis DEFINT li1, li2
LET li1 = li2 + 1 'Assigns the value of (li2 + 1) to li1.
li1 = li2 + 1 'Assigns the value of (li2 + 1) to li1 (same as the
above 'instruction statement).
6-axis DEFPOS lp1, lp2
DEFJNT lj1, lj2
lp1, = lp2 + (10, 10, 10, 0, 0, 0)
'Assigns the value of (lp2 + (10,10,10,0,0,0)) to
lp1
lj1, = lj2 + (10, 20, 30, 40, 0, 0)
'Assigns the value of (lj2 + (10,20,30,40,0,0)) to
lj1
4-axis DEFPOS lp1, lp2
DEFJNT lj1, lj2
lp1, = lp2 + (10, 10, 10, 20)
'Assigns the value of (lp2 + (10, 10, 10, 20) ) to
lp1
lj1, = lj2 + (10, 20, 30, 40)
'Assigns the value of (lj2 + (10, 20, 30, 40) ) to
lj1
Comentarios a estos manuales