G-code and M-code

G代码与M代码

Illustration of G-code and M-code
AI-generated sketch: it shows the idea, not exact engineering detail.

In plain words

The machine follows a list of short instructions, one per line: “go here fast”, “cut in a straight line to there”, “change tool”. That list is G-code. It is exactly what the machine is told to do, line by line.

What it is

The program a CNC machine runs (ISO 6983 family). G00 rapid move, G01 straight cut, G02/G03 arcs, G54 work offset, G43 tool length compensation; M03 spindle on, M06 tool change, M08 coolant on, M30 end. Dialects differ between controllers.

Why it matters for products

G-code is the exact record of what a machine was told to do, so it can be parsed for cycle-time estimates, verification and optimization; the real time also depends on feed overrides and stops at the machine.

Learn first

Opens the way to