Use of Subprogram – M98and M99
This type of program
used to make program length short. A subprogram is widely used in mass
production manufacturing industries.
Example:
Normal Program:
POINT |
X COORDINATE |
Z COORDINATE |
1 |
62.0 |
2.0 |
2 |
18.0 |
2.0 |
3 |
18.0 |
0.0 |
4 |
20.0 |
-1.0 |
5 |
20.0 |
-20.0 |
6 |
40.0 |
-30.0 |
7 |
40.0 |
-60.0 |
8 |
50.0 |
-65.0 |
9 |
60.0 |
-65.0 |
10 |
62.0 |
-65.0 |
O0001;
N1;
T0000;
G28 X0.0 Z0.0;
T0505;
G92 S1200 M03;
G96 S95;
G00 X62.0 Z2.0;
M07;
G42;
G71 U1.0 R1.0;
G71 P10 Q20 U0.0 W0.0 F0.1;
N10 G00 X18.0;
G01 Z0.0 F0.1;
G01 X20.0 Z-1.0 F0.1;
G01 Z-20.0 F0.1;
G01 X40.0 Z-30.0 F0.1;
G01 Z-60.0 F0.1;
G02 X50.0 Z-65.0 R5.0
F0.1;
G01 X60.0 F0.1;
N20 G01 X62.0 F0.3;
G00 Z10.0;
G40;
M05;
M09;
G97;
T0000;
G28 X0.0 Z0.0;
M30;
First create subprogram:
O0002;
G00 x18.0;
G01 X20.0 Z-1.0 F0.1;
G01 Z-20.0 F0.1;
G01 X40.0 Z-30.0 F0.1;
G01 Z-60.0 F0.1;
G02 X50.0 Z-65.0 R5.0
F0.1;
G01 X60.0 F0.1;
M99;
Program by using Subprogram:
O0001;
N1;
T0000;
G28 X0.0 Z0.0;
T0505;
G92 S1200 M03;
G96 S90;
G00 X62.0 Z2.0;
M07;
G42;
M98 P0002; ------------------ [M98- subprogram call, P0002- subprogram
number]
G00 X62.0;
G00 Z10.0;
G40;
M05;
M09;
G97;
T0000;
G28 X0.0 Z0.0;
M30;

No comments:
If you have any doubts please comment in box.