The G codes are instructions for motion or location relative to the work, which are commonly employed in CNC turning for generating cylinder surfaces or CNC milling for fabricating rectangular plate profiles. While on the other hand, M codes control machine functions such as pace, cooling, and so on.