- M98 should be used together with M99. When M98 is used alone, the subprogram can only be called once instead of L (L>1) times.
- When the program has M99 without M98, the program ends after executing M99.
- M98/M99 can be contained in the subprogram call, i.e. they can be nested; up to 18 levels of M98/M99 subprogram call can be nested.
- The subprogram is usually behind M02/M30 of the main program, and the last block of thisprogram must be M99 (subprogram return). If the subprogram is not behind the main program, M97 command should be used for program transfer. (see the following example)
【Example】
Fig. 3-1 M98 M99 subprogram call cutting example
Two programming methods as Fig.3-1:
N0010 G00
X100 Z50
|
N0010 G00
X100 Z50
|
||
N0020 M03
S01
|
N0020 M03
S01
|
||
N0030 G0
X50 Z15 F500
|
N0030 G0
X66 Z15 F500
|
||
N0040 M98 P0060
L5
|
Call subprogram
|
N0040 M98
P0060 L5
|
Call subprogram
|
N0050 M97
P0130
|
Transfer program
|
N0050 G0
X100 Z50
|
|
N0060 G0
U-4
|
Subprogram is inserted
in the main program
|
N0060 M05
|
|
N0070 G01
Z-10 F80
|
N0070 M02
|
End of main program
|
|
N0080 U20
Z-25
|
N0080 G0
U-4
|
Subprogram follows the
main program
|
|
N0090 Z-35
|
N0090 G01
Z-10 F80
|
||
N0100 G0 U2
Z1
|
N0100 U20
Z-25
|
||
N0110 U-22
|
N0110 Z-35
|
||
N0120 M99
|
N0120 G0 U2
Z1
|
||
N0130 G0 X
100 Z50
|
N0130 U-22
|
||
N0140 M05
|
N0140 M99
|
||
N0140 M02
|
End of main program
|
||
Transfer the program with M97. Otherwise, the
program
does not accord to the actual machining
requirement.
|
The subprogram must follow the main program
without M97
|
Method 1:
When the system executes N0040, it calls the subprogram and executes N0060-N0120
five
times. Then it executes N0050,and the
program skips to N0130 and executes the
following
blocks.
Method 2:
When the system executes N0040, it calls the subprogram and executes N0080-N0140
five
times, and then executes blocks from N0050 to N0070, and so theKET: ALFITRA NANDA
NANUNG DARMAWAN
OLGA YOGANTARA
Tidak ada komentar:
Posting Komentar