Fanuc Power Mate i-D/H Operator Manual

PROGRAMMING
(Common to Power Mate i–D and –H)
13. CUSTOM MACRO
B–63174EN/03
124
When DO m is specified without specifying the WHILE statement, an
infinite loop ranging from DO to END is produced.
When a branch to the sequence number specified in a GOTO statement
occurs, the sequence number is searched for. For this reason, processing
in the reverse direction takes a longer time than processing in the forward
direction. Using the WHILE statement for repetition reduces processing
time.
In a conditional expression that uses EQ or NE, a null value and zero have
different effects. In other types of conditional expressions, a null value
is regarded as zero.
The sample program below finds the total of numbers 1 to 10.
O0001;
#1=0;
#2=1;
WHILE[#2 LE 10]DO 1;
#1=#1+#2;
#2=#2+1;
END 1;
M30;
Limitations
Infinite loops
Processing time
Undefined variable
Sample program

Leave a Reply

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