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
- O number, e.g. O1234
- This is the most common
- Numeric only
- Can be called by M98
- Leading zeros are not necessary, e.g. O0001 can be O1)
- Colon, e.g. :1234
- This is common on very old controls
- Leading zeros are not necessary, e.g. :0001 can be :1)
- O number with 8 digits, e.g. O12345678
- This is not too common
- Numeric only
- Usually controlled by a parameter
- Typically, not supported by M98 calls
- Leading zeros are not necessary, e.g. O00000001 can be O1)
- Alphanumeric, e.g. <PART1234>
- This is common on modern controls, especially when used with USB drives
- Supports alphanumeric characters
- Modern controls can support older O number naming and newer alphanumeric naming at the same time
- Cannot be called by M98
- Name is exact, e.g. <PART0001> cannot be <PART1>
Program Structure
- % at top and bottom
- O, :, or <> at the beginning of the program
- All comments start with "(" and end with ")"
- 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
%
Related Articles
How to Switch Between Doosan EZ Guide and Fanuc NC
Overview Doosan machines have EZ Guide. Unfortunately, EZ Guide does not allow for serial RS232 program transfers. Luckily, it is easy to switch back and forth. Switch to NC (Classic Fanuc Interface) Press CUSTOM1 button Press NC-P Press PROG button ...
How to Change Fanuc ":" to "O" in Program Number
Overview When outputting/punching a program from a Fanuc control, it may use a ":" instead of a "O". Change Parameter 3201 - Bit #3 Bit #3 is 5th from left, 4th from right - XXXXXXXX Set bit 3 to "0" to punch ":" before program number - XXXX0XXX Set ...
Operator Guide - Fanuc 0
Overview This will explain how to output a program (punch) from the CNC control and input a program (read) into the CNC control. Controls Supported Fanuc 0-M Fanuc 0-T How to Punch Put control in EDIT mode Press PROG button Type in program number, ...
What are the Fanuc Alarms?
Overview This is a list of common Fanuc alarms and some solutions. Alarms 070 - No Program space in memory - The memory area is insufficient Delete any unnecessary programs and try again 071 - Edit Lock Key Turn off program protect and try again 072 ...
Operator Guide - Fanuc 16i, 18i, & 21i
Overview This will explain how to output a program (punch) from the CNC control and input a program (read) into the CNC control. Controls Supported Fanuc 16i Fanuc 18i Fanuc 21i How to Punch Put control in EDIT mode Press PROG button Press DIR ...