G Code Quick Reference 

G Code Screen

G Codes
G0 X3.5 Y5.0 Z1.0 A2.0 (Rapid move)

G1 X3.5 Y5.0 Z1.0 A2.0(linear move)

G2 X0.0 Y0.5 I0 J0.25 (CW Arc move)

G3 X0.0 Y0.5 I0 J0.25 (CCW Arc move)

G4 P0.25

(Dwell seconds)


G10L2Pn G10L2P1X0Y0Z0

(Set Fixture Offset #n)


G17 Arcs in XY plane

G18 Arcs in XZ plane

G19 Arcs in YZ plane

G20 Inch units

G21 mm units


G28 Move to Reference Position #1

G30 Move to Reference Position #2


G40 Tool Comp Off

G41 Tool Comp On

Left of Contour)

G42 Tool Comp On (Right of Contour)


G43 Hn (Tool #n length comp On)
G43.4 Hn (Tool #n length On with RTCP On)



(Tool length and RTCP comp off)

G53 Absolute Coord

G54 Fixture Offset 1

G55 Fixture Offset 2

G56 Fixture Offset 3

G57 Fixture Offset 4

G58 Fixture Offset 5

G59 Fixture Offset 6

G59.1 Fixture Offset 7

G59.2 Fixture Offset 8

G59.3 Fixture Offset 9


G90 Absolute Coordinates

G91 Relative Coordinates


G92/G52 Set Global Offset

G92 X0Y0Z0

G92.1 Clear Global Offset

G92.2 Clear Leave Vars

G92.3 Load Vars


G94 Feed per minute

G95 Feed per Rev


G96 Dmax CSS mode

G97 Spindle RPM mode


M Codes:
M0 (Program Stop)

M2 (Program End)

M3 Spindle CW

M4 Spindle CCW

M5 Spindle Stop

M6 Tool Change

M7 Mist On

M8 Flood On

M9 Mist/Flood Off

M98 Pxxx Call Subroutine

M99 Return from Subroutine



Other Codes:
F (Set Feed rate in/min or mm/min)

S (Spindle Speed)

D (Tool)

O Subroutine Label



(Simple Comment)

(MSG,OK toContinue?)

Show screen feature descriptions


See Also G Code Viewer Screen and Tool Setup Screen


The G Code Screen allows the user to edit G Code Programs and execute them.


GCode is a historical language for defining Linear/Circular/Helical Interpolated Motions often used to program numerically controlled machines (CNC Machines).


See the Quick Reference to the left for commonly used G Code commands.

KMotion's G Code interpreter was derived from the Open Source EMC G Code Interpreter. Click here for the EMC User Manual (Only the G Code portions of the manual, Chapters 10-14 pertain to KMotion G Code)

Specially coded comments embedded within a GCode program may be used to issue KMotion Console Script commands directly to KMotion

A comment in the form: (CMD,xxxxxx) will issue the command xxxxxx immediately to KMotion as soon as it is encountered by the Interpreter.  Any KMotion command that does not generate a response may be used in this manner.

A comment in the form: (BUF,xxxxxx) will place the command xxxxxx into KMotion's coordinated motion buffer.  Coordinated motion sequences are download to a motion buffer within KMotion before they are executed.  This guarantees smooth uninterrupted motion. The BUF command form allows a command to be inserted within the buffer so they are executed at an exact time within the motion sequence.  Only the following KMotion Script commands  may be used in this manner. 

SetBitBuf, ClearBitBuf, SetStateBitBuf.

Additionally, a comment in the form: (MSG,xxxxxx) will pause GCode Execution and display a pop-up message window  displaying the message xxxxxxx.