TOMATECH AUTOMATION
CHAPTER 2 MSTF COMMAND
2.1 M (Miscellaneous Function)
M command consists of command address M and its following 1~2 or 4 bit digits, used
for
controlling the flow of executed program or outputting M commands to PLC.
M98, M99, M9000~M9999 is executed by NC separately and NC does not output M
commands to PLC.
M02, M03 are for ending of programs defined by NC, and NC outputs M commands to
PLC which can control spindle OFF, cooling OFF and so on.
M98, M99, M9000~M9999 are for calling programs, M02, M30 are for ending of program
which are not changed by PLC. Other M commands output to PLC and their function are
defined by PLC.
Please refer to User Manual from machine manufacturer.
There is only one M command in one block, otherwise the system alarms.
Table 2-1 M commands to control program execution
Commands Functions
End of program M02
Command format: M02 or M2
Command function: In Auto mode, after other commands of current block are executed,
the
automatic run stops, and the cursor stops a block in M02 and does not
return to the start of program. The cursor must return to the start of program
when the program is executed again.
Besides the above-mentioned function executed by NC, M02 function is also defined by
PLC ladder diagram as follows: current output of CNC is reserved after M02 is executed.
End of program run M30
Command format: M30
Command function: In Auto mode, after other commands of current block are executed in
M30,
the automatic run stops, the amount of workpiece is added 1, the tool nose
radius compensation is cancelled and the cursor returns to the start of