G-codes and M-codes List

G-codes List

Code Parameters Description Example
G00 X, Y, Z, A, B, C Rapid positioning G00 X10 Y20.52
G01 X, Y, Z, A, B, C, F Linear interpolation G01 X20 Y30 F1500
G02 X, Y, I, J, R, F Circular interpolation, clockwise G02 X30 Y40 I10 J10 F100
G03 X, Y, I, J, R, F Circular interpolation, counterclockwise G03 X50 Y60 I20 J20
G04 P, S Dwell / Delay Time
P – [ms], S – [s]
G04 P1000
G20 Inch Units G20
G21 Millimeter Units G21
G28 X, Y, Z, A, B, C, M, T, D Return to home position / Reference.
M – Manual, T – Trust, D – Distrust
G28 X0 Y0 Z0
G30 X, Y, Z, F Do a single Z probe at a specified XY position. By default probe in the current position. G30 X100 Y100 F1500 Z-10 F100
G31 X, Y, Z, P Probe. G31 Z-20 F500
G38.2 X, Y, Z, F Probe target. ( Material Detection ) G38.2 Z-15 F500
G53 Machine coordinate system G53 G0 X0 Y0 Z0
G54 Work coordinate system G54
G90 Absolute positioning G90
G91 Incremental positioning G91
G92 X, Y, Z, A, B, C Set the current position to the values specified. G92 X0 Y0 Z0

M-codes List

Code Parameters Description Example
M00 P, S Program stop / Waiting for input signal
P – timeout[ms], S – timeout[s]
M00 S3
M03 S, I Spindle on, clockwise, Plasma, Laser On
S – Power [%], I – inline mode
M03 S100
M04 S Spindle on, counterclockwise
S – Power [%]
M04 S50
M05 Spindle stop, Plasma, Laser Off M05
M205 J, T Advanced custom code
J – Junction deviation value [mm]
T – THC Disable [0 = disable, 1 = THC enable]
M205 J1.2
M205 T0
M410 E-STOP (injected code) M410
M411 STOP (injected code) M411