Home

Code Analyzer

Paste a CNC program and see what each line does

16 lines
01O0001 (SIMPLE SHAFT)

Comment: SIMPLE SHAFT

  • O0001Program number.
02G21 G97 G99

Millimeters

  • G21Millimeters — Sets units to millimeters.
  • G97Constant RPM — S directly sets spindle speed in RPM. Required for threading.
  • G99Return to R plane — In canned cycles, returns only to the R plane.
03T0101

T0101

  • T0101Tool and offset (Txx yy: xx=slot, yy=offset).
04G50 S3000

Spindle speed limit (lathe)

  • G50Spindle speed limit (lathe) — Sets the maximum RPM while G96 (constant surface speed) is active.
  • S3000Speed — RPM in G97 or m/min in G96.
05G96 S200 M03

Constant surface speed (lathe)

  • G96Constant surface speed (lathe) — The machine adjusts RPM automatically with diameter to keep Vc (m/min) constant.
  • S200Speed — RPM in G97 or m/min in G96.
  • M03Spindle CW — Starts the spindle clockwise. Program Sxxx first.
06G00 X52. Z2. M08

Rapid positioning

  • G00Rapid positioning — Moves the tool at max speed to the coordinate. Positioning only — never use it to cut.
  • X52X coordinate (diameter on a lathe).
  • Z2Z coordinate (length).
  • M08Coolant on — Turns cutting fluid on (flood).
07G71 U2. R1.

Longitudinal roughing

  • G71Longitudinal roughing — Removes material parallel to Z in automatic passes. U depth per pass, R retract, U/W finishing stock.
  • U2Incremental X distance, or X stock in cycles.
  • R1Arc radius, cycle return plane or retract.
08G71 P100 Q200 U0.4 W0.1 F0.25

Longitudinal roughing

  • G71Longitudinal roughing — Removes material parallel to Z in automatic passes. U depth per pass, R retract, U/W finishing stock.
  • P100Subprogram number (M98) or start N in cycles.
  • Q200End N in cycles or peck depth.
  • U0.4Incremental X distance, or X stock in cycles.
  • W0.1Incremental Z distance, or Z stock in cycles.
  • F0.25Feed rate (mm/min in G94, mm/rev in G95, thread pitch).
09N100 G00 X20.

Rapid positioning

  • N100Block number (line label, used by P/Q in cycles and M98).
  • G00Rapid positioning — Moves the tool at max speed to the coordinate. Positioning only — never use it to cut.
  • X20X coordinate (diameter on a lathe).
10N110 G01 Z-30. F0.15

Linear interpolation

  • N110Block number (line label, used by P/Q in cycles and M98).
  • G01Linear interpolation — Straight-line move at feed rate F. The most common straight-cut mode.
  • Z-30Z coordinate (length).
  • F0.15Feed rate (mm/min in G94, mm/rev in G95, thread pitch).
11N120 X35.

N120 X35.

  • N120Block number (line label, used by P/Q in cycles and M98).
  • X35X coordinate (diameter on a lathe).
12N130 Z-50.

N130 Z-50.

  • N130Block number (line label, used by P/Q in cycles and M98).
  • Z-50Z coordinate (length).
13N200 X52.

N200 X52.

  • N200Block number (line label, used by P/Q in cycles and M98).
  • X52X coordinate (diameter on a lathe).
14G70 P100 Q200

Finishing cycle

  • G70Finishing cycle — Re-runs the profile defined between P (start line) and Q (end line) in a single fine pass.
  • P100Subprogram number (M98) or start N in cycles.
  • Q200End N in cycles or peck depth.
15G00 X200. Z200. M09

Rapid positioning

  • G00Rapid positioning — Moves the tool at max speed to the coordinate. Positioning only — never use it to cut.
  • X200X coordinate (diameter on a lathe).
  • Z200Z coordinate (length).
  • M09Coolant off — Turns cutting fluid off.
16M30

End of program + rewind

  • M30End of program + rewind — Ends the program and returns the cursor to the top. The modern M02.