Mitsubishi Electronics Q173HCPU/Q172HCPU Work Light User Manual


 
6 - 126
6 MOTION PROGRAMS FOR POSITIONING CONTROL
6.15.5 M98, M99 Subprogram call, subprogram end
Code M98, M99
Function
Subprogram call,
subprogram end
Subprogram call (M98) and subprogram end (M99) are executed.
Format
Subprogram call program No. (1 to 512)
Subprogram call sequence No. (1 to 9999)
9
Subprogram repetition count (1 to 9999)
MP
p
;8HhLl
9M;9
[Explanation]
(1) The program of the same pattern can be registered as a single subprogram and
called as required from the main program.
<Subprogram call> (M98)
Argument program No., sequence No. and repetition count may be omitted.
When omitted, these numbers are as follows.
Program No. : Main program
Sequence No. : First
Repetition count : Once
[Example]
:
:
M98 ; Executes once from the beginning of the main program.
<Subprogram end> (M99)
Returns to the block next to the call block.
(2) A subprogram can be called from another subprogram. This is called subprogram
nesting. Subprograms may be called (nested) to the depth of eight levels.
O0100 ;
Main program
Subprogram
(Eighth level)
Subprogram
(Third level)
Subprogram
(Second level)
Subprogram
(First level )
May be nested to 8 levels
%
M98 P110 ;
M02 ;
O0110 ;
%
M98 P120 ;
M99 ;
O0120 ;
%
M98 P130 ;
O0130 ;
%
M98 P140 ;
O0180 ;
%
M99 ; M99 ; M99 ;
(3) When a subprogram ends by error, a main program also ends in the subroutine
call by M98/M99 for the axis designation program.