M98, M99 Subprogram Call, Subprogram End - Mitsubishi Electric Q172CPU Programming Manual

Melsecq series motion controller sv43
Hide thumbs Also See for Q172CPU:
Table of Contents

Advertisement

7 MOTION PROGRAMS FOR POSITIONING CONTROL

7.15.5 M98, M99 Subprogram call, subprogram end

Code
Subprogram call,
Function
subprogram end
M
9
Format
M
9
[Explanation]
Main program
M98, M99
P p
8
H h L l
; 9
(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.
Sequence No.
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.
Subprogram
O0110 ;
O0100 ;
M98 P110 ;
M98 P120 ;
M02 ;
M99 ;
%
%
(First level )
(3) When a subprogram ends by error, a main program also ends in the subroutine
call by M98/M99 for the axis designation program.
Subprogram call (M98) and subprogram end (M99) are executed.
;
: Main program
: First
Subprogram
O0120 ;
M98 P130 ;
M99 ;
%
(Second level)
May be nested to 8 levels
7 - 126
Subprogram repetition count (1 to 9999)
Subprogram call sequence No. (1 to 9999)
Subprogram call program No. (1 to 512)
Subprogram
O0130 ;
M98 P140 ;
M99 ;
%
(Third level)
Subprogram
O0180 ;
M99 ;
%
(Eighth level)

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Q173cpuQ172cpunQ173cpun

Table of Contents