Fanuc Power Mate i-D/H Operator Manual

PROGRAMMING
(Common to Power Mate i–D and –H)
B–63174EN/03
11. PROGRAM CONFIGURATION
93
If P is used to specify a sequence number when a subprogram is
terminated, control does not return to the block after the calling block, but
returns to the block with the sequence number specified by P. Note,
however, that P is ignored if the main program is operating in a mode other
than memory operation mode.
This method consumes a much longer time than the normal return method
to return to the main program.
Subprogram
O1010 ;
N1020
;
N1030
;
N1040
;
N1050 ;
N1060 M99 P0060 ;
Main program
N0010 ;
N0020
;
N0030 M98 P1010 ;
N0040 ;
N0050
;
N0060
;
If M99 is executed in a main program, control returns to the start of the
main program. For example, M99 can be executed by placing /M99 ; at
an appropriate location of the main program and setting the optional block
skip function to off when executing the main program. When M99 is
executed, control returns to the start of the main program, then execution
is repeated starting at the head of the main program.
Execution is repeated while the optional block skip function is set to off.
If the optional block skip function is set to on, the /M99 ; block is skipped
; control is passed to the next block for continued execution.
If/M99Pn
; is specified, control returns not to the start of the main
program, but to sequence number n. In this case, a longer time is required
to return to sequence number n.
N0010 ;
N0020 ;
N0030
;
N0040
;
N0050
;
N0060 M99 P0030 ;
N0070 ;
N0080 M02 ;
/
Optional block skip
ON
Optional block skip
OFF
A subprogram can be executed just like a main program by searching for
the start of the subprogram with the MDI.
(See V–9.3 for information about search operation.)
In this case, if a block containing M99 is executed, control returns to the
start of the subprogram for repeated execution. If a block containing
M99Pn
is executed, control returns to the block with sequence number n
in the subprogram for repeated execution. To terminate this program, a
block containing /M02 ; or /M30 ; must be placed at an appropriate
location, and the optional block switch must be set to off ; this switch is
to be set to on first.
N1010 ;
N1020 ;
N1030
;
N1040 M02 ;
N1050 M99 P1020 ;
/
Optional block skip
ON
Special Usage
Specifying the sequence
number for the return
destination in the main
program
Using M99 in the main
program
Using a subprogram only

Leave a Reply

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