2-224
詳細説明
MACHINE OPERATIONS
9-22
M98/198
サブプログラム呼出し
M99
サブプログラム終了
M98/198 Sub-Program Call M99 Return from Sub-Program End
バーフィーダやローダによる加工のように、同一加
工を繰り返し実行する場合、繰り返し実行する部分
をサブプログラムとして登録します。メインプログ
ラムにはサブプログラムのプログラム番号と繰り返
し回数を指令します。
When carrying out machining on a machine equipped with the
bar feeder or the loader, for example, the same machining
cycle is repeated to machine the workpieces. When perform-
ing such operations, the portion of the program executed
repeatedly can be stored in the NC memory as a sub-program
and the sub-program program number and the number of
times the sub-program should be called can be specified in
the main program.
M98
は以下のフォーマットで指令します。
Specify M98 in the format below.
1.
下図のように、メインプログラムから呼
び出されたサブプログラムが、さらに別
のサブプログラムを呼び出すこともでき
ます。これをネスティングと言います。
ネスティングは
8
回まで行えますが、
9
回以上になると、画面にアラーム
(
P230
)が表示されます。
2.
メインプログラムがデータサーバにある
場合は、テープモードで
M98
を指令しま
す。また、メインプログラムが
NC
メモ
リにある場合は、メモリモードで
M98
ま
たは
M198
を指令します。
1.
It is possible to specify sub-program call from one
sub-program to the other as illustrated below.
This is called nesting and allowable nesting level
is eight. If sub-program call exceeds this limit,
alarm number (P230) is displayed.
2.
If the main program is stored in a data server,
specify the M98 command in the TAPE mode. If
the main program is stored in NC memory, spec-
ify the M98 or M198 command in the MEMORY
mode.
メイン
プログラム
Main
Program
サブ
プログラム
1
Sub-
Program 1
サブプログラム
2
~
6
Sub-Program 2 to 6
サブ
プログラム
7
Sub-
Program 7
サブ
プログラム
8
Sub-
Program 8
1
回
1st Call
2
回
2nd Call
7
回
7th Call
8
回
8th Call
繰り返し実行する部分をサブプログラムとし
て登録することにより、記憶容量が節約でき
ます。また、プログラムを簡単にすることが
でき、プログラムミスの可能性も低くなりま
す。
By storing the portion of the program to be executed
repeatedly as a sub-program, required memory
capacity can be reduced and programming errors can
be reduced accordingly.
M98 P_ H_ L_ ;
•
P . . . . . . . . . . .
サブプログラム番号
Specifies sub-program number.
•
H . . . . . . . . . . .
サブプログラムのシーケンス番号
Specifies the sequence number in the sub-
program.
•
L. . . . . . . . . . . .
サブプログラムの繰返し呼出し回数
Specifies the number of sub-program calls.
1.
アドレス
P
で指令したサブプログラム番
号が見つからないと、画面にアラーム
(
P232
)が表示されます。
2.
アドレス
H
で指令したシーケンス番号が
見つからないと、画面にアラーム
(
P231
)が表示されます。
3.
L0
を指令すると、そのブロックは実行さ
れず、次のブロックを実行します。
1.
If the sub-program number specified by address
P is not found, an alarm message (P232) is dis-
played on the screen.
2.
If the sequence number specified by address H is
not found, an alarm message (P231) is displayed
on the screen.
3.
If "L0" is specified, the M98 block containing such
L command is not executed and the execution of
program jumps to the next block.
Summary of Contents for MSX-850
Page 54: ...1 CHAPTER 1 BASIC OVERVIEW...
Page 170: ...2 CHAPTER 2 MACHINE OPERATIONS...