NC Program Format - Fanuc

NC Program Format - Fanuc

Overview

The following is how a Fanuc program is formatted. This provides no guidance on G and M code, only format.

Program Naming

  1. O number, e.g. O1234
    1. This is the most common
    2. Numeric only
    3. Can be called by M98
    4. Leading zeros are not necessary, e.g. O0001 can be O1)
  2. Colon, e.g. :1234
    1. This is common on very old controls
    2. Leading zeros are not necessary, e.g. :0001 can be :1)
  3. O number with 8 digits, e.g. O12345678
    1. This is not too common
    2. Numeric only
    3. Usually controlled by a parameter
    4. Typically, not supported by M98 calls
    5. Leading zeros are not necessary, e.g. O00000001 can be O1)
  4. Alphanumeric, e.g. <PART1234>
    1. This is common on modern controls, especially when used with USB drives
    2. Supports alphanumeric characters
    3. Modern controls can support older O number naming and newer alphanumeric naming at the same time
    4. Cannot be called by M98
    5. Name is exact, e.g. <PART0001> cannot be <PART1>

Program Structure

  1. % at top and bottom
  2. O, :, or <> at the beginning of the program
  3. All comments start with "(" and end with ")"
  4. All capital letters

Sample Program

%
O1001 (FANUC MILL EXAMPLE - FACE AND POCKET)
G20 (INCH MODE)
G17 G40 G49 G80 G90
G54
(T1 - 1.0 FACE MILL)
T1 M06
S2500 M03
G00 G43 H01 Z1.0
M08
(FACE TOP OF PART)
G00 X-0.5 Y-0.5
Z0.1
G01 Z0.0 F20.0
G01 X4.5 F40.0
Y0.5
X-0.5
Y1.5
X4.5
Y2.5
X-0.5
Y3.5
X4.5
G00 Z1.0
M09
(T2 - 0.5 END MILL)
T2 M06
S3000 M03
G00 G43 H02 Z1.0
M08
(POCKET 3.0 X 2.0, CENTERED AT X2.0 Y1.5, DEPTH -0.500)
G00 X0.75 Y0.75
Z0.1
G01 Z-0.25 F10.0
G01 X3.25 F20.0
Y2.25
X0.75
Y0.75
X1.00 Y1.00
X3.00
Y2.00
X1.00
Y1.00
G00 Z0.1
G01 Z-0.50 F10.0
G01 X3.25 F20.0
Y2.25
X0.75
Y0.75
X1.00 Y1.00
X3.00
Y2.00
X1.00
Y1.00
G00 Z1.0
M09
G28 G91 Z0.
G28 G91 X0. Y0.
G90
M30
%