Real CNC programs, parsed line by line and cut into a virtual block of aluminium. Drag to orbit, scroll to zoom, click any line to jump to it.
(STOCK X100 Y100 Z20) to size the block.
A G-code line is a list of words: one letter, one number. The letter says what the number means.
N120block numberG01straight line at feed rateX60.go to X = 60 mmY38.and Y = 38 mmZ-1.1 mm below zeroF12001200 mm per minuteMost codes are modal: G01 and F1200 stay active, so the next line can be just X80..
What the simulator puts in the spindle on T# M06. The current tool is highlighted.
No server, no plugins: one JavaScript file and three.js. The code below is the real code running this page, read from the script as it runs.
| mm/s - Milimeter per seconds | |
|---|---|
| mm/M - Milimeter per minutes | |
| r/min - Revolutions per minutes (r / M) | |
| Vc - Cutting Speed (m / min) | |
| Vf - Feed Rate (mm / min) | |
| Fz - Feed per tooth (mm / tooth) | |
| d, ⌀ - Diameter (mm) | |
| n - Spindle Speed (r / min) | |
| Zn - Number of flutes | |
| π - Variable pi: (3.1415926535898, 3.1416) | |
| RPM - Revolutions Per Minutes |
| Code | Function |
|---|---|
| N | Line number |
| G | Motion |
| X | Horizontal position |
| Y | Vertical position |
| Z | Depth |
| F | Feed rate |
| S | Spindel speed |
| T | Tool select |
| M | Miscellaneous function |
| I | Arc-Incremental center |
| J | Arc-Incremental center |
| R | Arc-radius |
| Variable | Description |
|---|---|
| A | Absolute or incremental position of A axis (rotational axis around X axis). |
| B | Absolute or incremental position of B axis (rotational axis around Y axis). |
| C | Absolute or incremental position of C axis (rotational axis around Z axis). |
| D | Defines diameter or radial offset used for cutter compensation. D is used for depth of cut on lathes. It is used for aperture selection and commands on photoplotters. |
| E | Precision feedrate for threading on lathes. |
| F | Defines feed rate. |
| G | Address for preparatory commands. |
| H | Defines tool length offset, incremental axis corresponding to C axis (e.g., on a turn-mill). |
| I | Defines arc center in X axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles. |
| J | Defines arc center in Y axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles. |
| K | Defines arc center in Z axis for G02 or G03 arc commands. Also used as a parameter within some fixed cycles, equal to L address. |
| L | Fixed cycle loop count, Specification of what register to edit using G10. |
| M | Miscellaneous function. |
| N | Line (block) number in program, System parameter number to be changed using G10. |
| O | Program name. |
| P | Serves as parameter address for various G codes and M codes. |
| Q | Peck increment in canned cycles. |
| R | Defines size of arc radius, or defines retract height in milling canned cycles. |
| S | Defines speed, either spindle speed or surface speed depending on mode. |
| T | Tool selection. |
| U | Incremental axis corresponding to X axis (typically only lathe group A controls). Also defines dwell time on some machines (instead of "P" or "X"). |
| V | Incremental axis corresponding to Y axis. |
| W | Incremental axis corresponding to Z axis (typically only lathe group A controls). |
| X | Absolute or incremental position of X axis. Also defines dwell time on some machines (instead of "P" or "U"). |
| Y | Absolute or incremental position of Y axis. |
| Z | Absolute or incremental position of Z axis. |
| Code | Function |
|---|---|
| G00 | Rapid position. |
| G01 | Linear interpolation. |
| G02 | Circular interpolation, clockwise. |
| G03 | Circular interpolation, counterclockwise. |
| G04 | Dwell: Stop for a specified time. |
| G05 | FADAL Non-Modal Rapids. |
| G05 P10000 | High-precision contour control (HPCC). |
| G05.1 Q1 | AI Advanced Preview Control. |
| G06 | Curved move. |
| G06.1 | Non-uniform rational B-spline (NURBS) Machining. |
| G07 | Imaginary axis designation. |
| G08 | . |
| G09 | Exact stop check, non-modal. |
| G10 | Programmable data input. |
| G11 | Data write cancel. |
| G12 | Full-circle interpolation, clockwise. |
| G13 | Full-circle interpolation, counterclockwise. |
| G14 | . |
| G15 | . |
| G16 | . |
| G17 | XY plane selection. |
| G18 | ZX plane selection. |
| G19 | YZ plane selection. |
| G20 | Programming in inches. |
| G21 | Programming in millimeters (mm). |
| G22 | . |
| G23 | . |
| G24 | . |
| G25 | . |
| G26 | . |
| G27 | . |
| G28 | Return to home position (machine zero, aka machine reference point). |
| G29 | . |
| G30 | Return to secondary home position (machine zero, aka machine reference point). |
| G31 | Skip function (used for probes and tool length measurement systems). |
| G32 | Single-point threading, longhand style (if not using a cycle, e.g., G76). |
| G33 | Single-point threading, longhand style (if not using a cycle, e.g., G76). |
| G34 | Variable-pitch threading. |
| G35 | . |
| G36 | . |
| G37 | . |
| G38 | . |
| G39 | . |
| G40 | Tool radius compensation off. |
| G41 | Tool radius compensation left. |
| G42 | Tool radius compensation right. |
| G43 | Tool height offset compensation negative. |
| G44 | Tool height offset compensation positive. |
| G45 | Axis offset single increase. |
| G46 | Axis offset single decrease. |
| G47 | Axis offset double increase. |
| G48 | Axis offset double decrease. |
| G49 | Tool length offset compensation cancel. |
| G50 | Position register (programming of vector from part zero to tool tip). |
| G51 | . |
| G52 | Local coordinate system (LCS). |
| G53 | Machine coordinate system. |
| G54 | Work coordinate systems (WCSs). |
| G54.1 P1 to P48 | . |
| G55 | Work coordinate systems (WCSs). |
| G56 | Work coordinate systems (WCSs). |
| G57 | Work coordinate systems (WCSs). |
| G58 | Work coordinate systems (WCSs). |
| G59 | Work coordinate systems (WCSs). |
| G60 | . |
| G61 | . |
| G62 | . |
| G63 | . |
| G64 | . |
| G65 | . |
| G66 | . |
| G67 | . |
| G68 | . |
| G69 | . |
| G70 | . |
| G71 | . |
| G72 | . |
| G73 | . |
| G74 | . |
| G75 | . |
| G76 | . |
| G77 | . |
| G78 | . |
| G79 | . |
| G80 | . |
| G81 | . |
| G82 | . |
| G83 | . |
| G84 | . |
| G85 | . |
| G86 | . |
| G87 | . |
| G88 | . |
| G89 | . |
| G90 | . |
| G91 | . |
| G92 | . |
| G93 | . |
| G94 | . |
| G95 | . |
| G96 | . |
| G97 | . |
| G98 | . |
| G99 | . |
To be filled by OEM.
G01 X200 Y200 Z200 F9000
.
Preview a CNC FANUC File.
50,50