G codes are standard motion control code (servo motion), but there is a slight variation according to the type of machine, e.g. Machining centre, Punch, Plasma,EDM etc.
The M codes are decided and written by the MTB, again there is some standardization, but this all depends on the personal writing the code.
M,S,T codes are passed over to what is generally known as the Machine controller/PLC/PMC as part of the MTB/OEM design.
The reason for two processes is so that the motion controller is not bogged down servicing the relatively slow machine codes and functions.
For example when you buy a Mitsubishi or Fanuc system, all the control for the G code is built in for that particular package, Lathe, Mill etc, but the PLC is blank, and the MTB is required to write the M.S.T. routines for these.
Some text books such as Computer Numerical Control Programming by Michael Save and Joseph Pusztai have a typical listing of G and M code for various types of machines
Al .
CNC, Mechatronics Integration and Custom Machine Design
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.