Fanuc Series 15i/150i-MA (Programming) Operators Manual

17.CUSTOM MACRO PROGRAMMING B-63324EN/03
- 624 -
- Relational operator
A relational operator consists of two alphabetic characters as shown in
the table below and is used to judge whether an operand is greater,
smaller, or equal. The equal (=), greater than (>), and less than (<)
signs cannot be used as relational operators.
Table17.5.2 Operators
Operator Meaning
EQ Equal to (=)
NE Not equal to ()
GT Greater than (>)
GE
Greater than or equal to ( )
LT Less than (<)
LE
Less than or equal to ( )
Sample program
The sample program below finds the total of numbers 1 to 10.
O9500;
#1=0;.................................Initial value of the variable to
hold the sum
#2=1;.................................Initial value of the variable as
an addend
N1 IF[#2 GT 10] GOTO 2; Branch to N2 when the
addend is greater than 10
#1=#1 {#2;.......................Calculation to find the sum
#2=#2 {1;.........................Next addend
GOTO 1;...........................Branch to N1
N2 M30;............................End of program

Leave a Reply

Your email address will not be published. Required fields are marked *