Machine control · Fanuc
Fanuc CNC control: work offsets, tool offsets, program format and a surprise-free post
Fanuc series (0i-F Plus, 30i-B Plus), program format, G54–G59 and additional work offsets, G10, tool offsets and what to check before running a program written for another machine.
Fanuc controls a large share of industrial CNC mills and lathes. The Fanuc dialect is the reference many other controls follow (Haas, LinuxCNC and several Asian controls share most of it), but every machine builder enables its own options and parameters. This guide gives the method; your machine’s manual always has the final word.
Common series
| Series | Positioning (per FANUC America) |
|---|---|
| 0i-F Plus | “General applications” control, customizable functions, everyday milling and turning |
| 30i / 31i / 32i-B Plus | Advanced machining: high speed, multi-axis and multi-path, 5-axis machines |
Program format
| Element | Role |
|---|---|
% | Tape start and end (transfer) |
O1234 | Program number |
(COMMENT) | Comments in parentheses |
N10 | Block number (optional) |
M30 | Program end and rewind |
A careful header puts the control in a known state: plane, units, compensation and canned cycle cancelled, absolute mode.
%
O1001 (BRACKET - OP10)
G17 G21 G40 G49 G80 G90
T1 M06
G54 G00 X0. Y0. S2500 M03
G43 H01 Z50. M08
...
M30
%
Work offsets
- G54 to G59: six standard offsets, set on the offset page or by program.
- Additional offsets:
G54.1 P1… with FANUC’s “48 additional work offsets” option you getG54.1 P1toP48on top of G54–G59; a separate option raises the total to 300 sets (P1–P300) on some series. Check which options your machine actually has (parameter screen or the machine builder’s spec sheet). - Writing by program:
G10 L2 P1writes G54;G10 L20 P1writes additional offset P1. InG90the value replaces; inG91it adds. - Check: display the absolute position on a known point of the part before the first cycle.
Tool offsets
- Length:
G43 H..applies the length;G49cancels it. Shop habit:H= tool number. - Radius:
G41/G42 D..; theDregister holds the radius (or wear only if the post outputs the compensated path — pick one convention and stick to it). - Wear: adjust wear, not geometry, to correct a size in production.
Macros
Custom macros (often called Macro B) add variables (#1…, #100…, #500…), math and conditional jumps. They are used for probing, part families and counters. Variables #500 and up are usually retained at power-off: document the ones you use.
Error codes and alarms
Codes taken only from public manuals and official documents, with the source under each table. Exact numbers and meanings can vary with software version and machine builder: when in doubt, your machine’s manual wins.
FANUC — FANUC Alpha i amplifiers (7-segment display) 9
These codes show on the amplifier’s display inside the cabinet, not on the control screen. Control alarms (PS, SV, OT, SR…) are in your model’s maintenance manual (e.g. 0i-F: B-64605EN); FANUC does not publish it openly, so we do not reproduce them.
| Code | Meaning | What to check |
|---|---|---|
1 (servo) | Alarme 1 — amplificateur servoServo amplifier internal cooling fan failure. | Fan diagnostics, inspection, replacement. |
2 (alimentation) | Alarme 2 — module d’alimentationPower supply internal cooling fan failure. | Inspect and replace the fan. |
5 | Alarme 5 — amplificateur servoLow DC link voltage. | Check the power supply, measure voltages, isolate the fault (qualified staff). |
8. / 9. / A. | Alarme 8., 9. ou A. — amplificateur servoIPM power module overheating. | Check cooling and axis load. |
F | Alarme F — amplificateur servoExternal cooling fan failure. | Inspect and replace the external fan. |
U / L | Alarme U ou L — amplificateur servoCommunication error on the FSSB fibre-optic network. | Check fibre cables, connectors and amplifier communication. |
56 (broche) | Alarme 56 — amplificateur de brocheSpindle amplifier internal cooling fan failure. | Inspect and replace the fan. |
88 (broche) | Alarme 88 — amplificateur de brocheSpindle amplifier external cooling fan failure. | Inspect and replace the fan. |
BAT | BAT (commande)Memory backup battery low: risk of losing SRAM data (parameters, programs, offsets). | Back up data, then replace the battery per FANUC’s procedure. |
Source: FANUC America — CNC Tech Tips (alarmes d’amplificateurs Alpha i, batterie) · consulted November 26, 2026
Common mistakes
- Assuming a program from another Fanuc machine will run as is: builder M-codes and cycles differ.
- Dropping the decimal point: depending on a parameter,
X10may be read as 10 mm or 0.010 mm. A Fanuc post should always writeX10.. - Leaving
G41/G42active at the end of a contour. - Editing tool geometry instead of wear, then losing the reference.
Checklist before running an outside program
- Control series and options known (additional offsets, macros, cycles)
- Post configured for this machine (tool change, coolant M-codes, drilling cycles)
G20/G21units consistent with the offsets that were set- Offset called = offset set; tool lengths current
- First run in single block, reduced feed, safe Z checked
FAQ
Will my Haas program run on a Fanuc?
The basics (G0/G1/G2/G3, G54, G43, G81–G83 cycles) are close, but M-codes, special cycles and extended offsets differ (Haas G154, Fanuc G54.1). Re-post with the right post instead of hand-editing.
Where do I get the manual?
From the machine builder or dealer: the original Fanuc manual plus the builder’s own documents (M-codes, cycles, options).
Should I use G10 in production?
Yes for part families or multiple fixtures, as long as it is controlled: absolute mode, a clear comment and simulation.
Sources
- FANUC America — 0i-F Plus series, consulted November 26, 2026.
- FANUC America — 30i-B Plus, consulted November 26, 2026.
- FANUC America — CNC Options: “48 additional work offsets” option (G54.1 P1–P48), consulted November 26, 2026.
- FANUC America — CNC Function Catalog (PDF): “Addition of workpiece coordinate system” 48 and 300 pairs, consulted November 26, 2026.
- LinuxCNC — G-codes (G10 L2/L20, G43, G54–G59): public reference for the Fanuc-style dialect.
- LinuxCNC — Coordinate systems.
- Haas — Mill Programming Workbook (PDF): a Fanuc-style control, useful for comparison.
One guide a week, French-first
New guides, used equipment in Quebec and price moves. No third-party ads.