Fanuc: Running a Program at the Control
Most of this section is about writing programs. This one is about getting a program that already exists to run on the machine — on a control where half the switches you need are not FANUC’s at all. The mode selector, the cycle start button, the single block switch, the program restart switch and the optional stop switch all live on the machine tool builder’s operator panel, and FANUC’s own manual says so on nearly every procedure page: “For actual operation, refer to the manual supplied by the machine tool builder.” What FANUC does define is what the CNC will and will not accept, and that is where the trouble is.
The Short Version
Five steps, in this order. Each has its own failure message if you skip it, and those are collected at the bottom of this page.
• Establish the machine. Manual reference position return on every axis unless the machine has absolute pulse coders. FANUC’s own handling warning is blunt about why: “Stroke check is not possible before manual reference position return is performed.”
• Select the mode. The MEMORY mode selection switch on the machine operator’s panel — not EDIT, not MDI.
• Select the program. PROG, address O, the number, then the [O SRH] soft key. Having a program open on the EDIT screen is not the same as having it selected.
• Get to the head. Press RESET. The cursor returns to the top of the program. This is the step people skip.
• Press cycle start. Automatic operation begins and the cycle start LED goes on; it goes off when the program ends.
Which Mode Actually Runs a Program
FANUC splits the world into manual operation (the tool moves because you moved it) and automatic operation (the tool moves because a program said so). Automatic operation has exactly three flavors — memory, MDI and DNC — and everything else is setup, editing or jogging.
| Mode | What it is for | Runs a program? |
|---|---|---|
| Automatic operation | ||
| MEM / MEMORY / AUTO | Executes a program already registered in CNC memory. This is the production mode. | Yes |
| MDI (manual data input) | A short program typed at the control — up to 511 characters, auto-numbered O0000. FANUC calls it “simple test operations”: a tool change, a spindle start, restoring an M code after a restart. | Blocks you type, not a stored program |
| DNC / RMT (remote) | Machining while the program streams in from outside memory — RS-232C, memory card, Embedded Ethernet, Data Server. For programs too large to register. | Yes, drip-fed |
| Everything else | ||
| EDIT | Create, edit, delete and input/output programs. A program can be searched for in EDIT or MEM, but cycle start does nothing here. | No |
| JOG | Continuous manual feed — the axis moves while the button is held. | No |
| INC (incremental) | A fixed step per button press. | No |
| HANDLE / HNDL / MPG | Manual pulse generator. The scale factor is the thing that bites — FANUC warns that turning the handle at ×100 “causes the tool and table to move rapidly.” | No |
| REF / ZRN (reference position return) | Manual reference position return. The reference return switch is itself one of the mode selection switches. | No |
Where the mode selector lives is not FANUC’s decision. On most machines it is a rotary switch or a row of illuminated buttons on the builder’s panel, and the labels are the builder’s too — AUTO instead of MEM, ZERO RETURN instead of REF, TAPE or REMOTE instead of DNC. FANUC’s procedures say “press the MEMORY mode selection switch” and then immediately defer: refer to the manual supplied by the machine tool builder. There is also a software operator’s panel, which can move mode selection, jog, override, and the optional block skip / single block / machine lock / dry run switches onto the CNC screen instead; which groups live where is a parameter setting. If your machine has no physical single block switch, look there before concluding the option is missing.
Whatever the panel calls it, the CNC status line tells you the truth. The first field is the current mode — MEM (memory operation), MDI, RMT (DNC operation), EDIT, HND, JOG, INC, REF, plus TJOG and THND for teach-in. The second field is the automatic operation status, and it answers “why isn’t it running” without any guessing: **** is the reset state, STRT means it is running, HOLD is feed hold, STOP is a single-block or program stop. Reading those two fields before pressing anything is a cheap habit. On an iHMI control the screen goes further: the whole base screen changes per mode, so the MEM base screen, the MDI base screen and the EDIT base screen look like different applications.
Selecting the Program Is Not the Same as Looking at It
With memory holding many programs, one of them is the selected program — the one cycle start will run. The classic way to select it: in EDIT or MEMORY mode press the PROG function key, key the address O and the program number, then press the [PROGRM SEARCH] (or [O SRH]) soft key. When the search completes, the program number is displayed in the upper-right corner of the screen. That corner display is your confirmation that the right program is loaded, and it is worth reading out loud before the first run of the day.
Three other ways exist. [PREV PROGRM] and [NEXT PROGRM] walk the folder. A signal from the machine side can select program numbers 0001 to 0031 automatically — the pallet and part-select path, and the reason a machine can occasionally run a program nobody chose; if that program is not registered, alarm DS0059 is raised. And with bit 4 (PGS) of parameter No. 11308 set to 1, bare digits search for the O-number without pressing O first.
Two failures cluster here. If the program is not found, the search raises PS0071, DATA NOT FOUND. If the program you are trying to select is currently open in background editing, you get PS0075, PROTECT — the alarm list spells the case out: “An attempt was made to select a program being edited in the background as the main program.” The same alarm fires if a running program tries to call a background-edited program as a subprogram. Close the background edit and the alarm goes away.
On an iHMI control the vocabulary is explicit: you select a program and press the [Main Program] soft key, either from the Program Manager slide or from the editor. If the base screen is in any mode other than MEM or EDIT the control refuses with Change to MEM mode or EDIT mode. — which is the same rule as the classic screen (search works in EDIT or MEMORY), just said out loud.
Getting Back to the Top: What RESET Actually Does
There is no GOTO 0 on a FANUC. The key that puts the cursor at the head of the program is RESET, and FANUC’s own program restart procedure uses exactly that phrasing: “Find the program head. Press function RESET key.”
RESET is doing more than moving a cursor, and that is the part worth understanding. Pressing it during automatic operation terminates the program and enters the reset state; if the machine was moving, motion decelerates and stops. Modal state is affected too: when bit 6 (CLR) of parameter No. 3402 is 0, a reset during block execution returns modal information to the state it held before that block. The control can warn you about this — the message is MODAL DATA IS CHANGED BY BLOCK STOP, raised when a reset occurs during program operation and any of G, F, H, D, T, S, M or B had changed. It is a wrong-operation-prevention function, switched with bit 1 (WMD) of parameter No. 10334, so on a machine where it has never been enabled you will simply never see it.
⚠ RESET is not an emergency stop. FANUC’s handling warning: pressing the RESET key stops the currently running program and the servo axes stop — “However, the RESET key may fail to function for reasons such as an MDI unit problem. So, when the motors must be stopped, use the emergency stop button instead of the RESET key to ensure security.”
Two related behaviors people trip on. In MDI mode, M30 does not return control to the beginning — only M99 does — and the typed program is erased outright when M02, M30 or % executes. In MEM, M02 and M30 end the program, reset the CNC and return control to the start of the program, unless bits 5 (M02) or 4 (M30) of parameter No. 3404 disable that return — in which case the cursor sits at the end after a part and you must reset before the next one.
Starting From the Middle Is Not Restarting
This is the section that matters. There are two entirely different ways to begin execution somewhere other than the top, and one of them quietly discards everything the program did before that point.
Sequence number search (N + the number + the [N SRH] soft key, in MEMORY mode) simply finds the block. FANUC states the consequence plainly: “Those blocks that are skipped do not affect the CNC. This means that the data in the skipped blocks such as coordinates and M, S, and T codes does not alter the CNC coordinates and modal values.” The tool call never happened. The spindle was never started. The work offset, the plane, the compensation, the feed — none of it is in effect. FANUC’s instruction is to fix that by hand: in the block where execution restarts, “be sure to enter required M, S, and T codes and coordinates,” and for a block in the middle of a process, specify the M, S, T and G codes and coordinates from the MDI “after closely checking the machine tool and NC states at that point.” That is a real procedure, not a warning to be read past.
Two limits on the search itself: it only looks inside the currently selected program, and M98 is not executed during the search, so trying to find a sequence number that lives in a subprogram raises PS0060, SEQUENCE NUMBER NOT FOUND. Optional block skip is applied during a sequence number search, which means a block hidden behind an active / cannot be found either.
The control can also stop you from doing this by accident. Confirmation of the start from a middle block, one of the wrong operation prevention functions, displays START FROM MIDDLE OF PROG (START/RESET) when you press cycle start in memory operation with the cursor parked somewhere other than the top. Press cycle start again and it runs anyway; press reset and it abandons. It is enabled with the “START FROM MIDDLE OF PROGRAM” checkbox on the operation confirmation function setting screen, reached with the [GUARD] soft key. If your machine never asks, that box is unchecked.
Program Restart: P Type and Q Type
Program Restart is the function actually built for re-entry. Instead of teleporting the cursor, the control searches forward through the program accumulating what happened, then shows you what it found and moves the tool back to the restart position at the dry run feedrate. It exists in two flavors, chosen by soft key after you enter the target block.
| Type | Use it when | What you must do first |
|---|---|---|
| P type | Machining was interrupted and the machine has not lost its coordinate system — the classic case is a broken tool. | Retract the tool, replace it, change the offset if needed. That is all. |
| Q type | The machine state is gone: power was cycled, emergency stop was released, or the coordinate system changed after the stop. | Do the reference position return, move the machine manually to the program starting point, and restore the modal data and coordinate system to the same conditions as at the machining start. Then modify offsets if needed. |
P type is the convenient one, and the control refuses it in exactly the situations where it would be wrong — each with its own alarm. If no automatic operation has been performed since power-on, since emergency stop was released, or since the coordinate system was changed or shifted, P type cannot be specified: PS0094 P TYPE NOT ALLOWED (COORD CHG), PS0095 P TYPE NOT ALLOWED (EXT OFS CHG), PS0096 P TYPE NOT ALLOWED (WRK OFS CHG), and PS0097 P TYPE NOT ALLOWED (AUTO EXEC). Those four alarms are the control telling you to use Q type.
The classic-screen procedure, once the tool situation is sorted:
program restart switch ON (machine operator's panel)
PROG display the program
RESET find the program head
N<seq> or B<block> the restart target
[P TYPE] or [Q TYPE] search runs; restart screen appears
program restart switch OFF DISTANCE TO GO digits start blinking
-- now read the M / T / S / B list --
MDI mode, cycle start execute the M, S, T, B codes yourself
back to MEM, cycle start tool moves to the restart position
at the DRY RUN feedrate, then machines
The restart screen shows DESTINATION (where machining will resume) and DISTANCE TO GO (how far the tool is from it), with a number beside each axis name giving the order in which the axes will move — that order comes from parameter No. 7310 and can be edited on the screen. It also lists the codes the search collected: up to 30 M codes, the two most recent T codes, the most recent S, the most recent B.
⚠ Restoring M, S, T and B is your job, not the control’s. The manual’s step 7 is explicit: check the screen for the M, S, T and B codes to be executed; if they are found, enter the MDI mode and execute them, then restore the previous mode. Step 8 is the other half — check that DISTANCE TO GO is correct, and check whether the tool might hit the workpiece on its way to the restart position. If it might, move the tool manually somewhere it can approach cleanly. Parameters can automate the code output (bit 7 MOU / bit 6 MOA of parameter No. 7300) but that is a machine-by-machine setting.
A handful of restrictions decide whether restart is even available. Blocks containing a macro statement, a macro call, or a subprogram call are not searched for even if they carry a sequence number — pick an earlier block. Restart cannot be performed for blocks inside threading (G32/G33/G92/G76), rigid tapping, polar coordinate interpolation (G12.1), polygon turning (G50.2), balance cutting or spindle positioning, nor if a workpiece coordinate system preset (G92.1/G50.3) appears anywhere between the start of the program and the restart block. Do not reset or feed-hold during the search — either forces the whole procedure to start over. And while the program restart switch is on, cycle start does nothing at all, worth remembering before you conclude the machine is dead. Macro common variables are not preset on a restart either: previous values are inherited, so initialize counters and measurement variables by hand first. Finally, when restarting by block number, the BC field on the program screen shows the block most recently executed — FANUC’s instruction is to specify that number plus one, and macro statements are not counted as blocks.
On iHMI the same function is a three-step wizard — Block Search, Restore Aux. Function, Move to Restart Position — with [Sequence No.] / [Block Counter] for the target, [P Type] / [Q Type] for the method, and a [Save Restart Info] button on the MEM base screen that stashes the block counter for [Restore Restart Info] to fill in later. One caution carries over: when the Restore Aux. Function screen appears the search may not actually be finished if the restart block is in the last half of the program — wait for it.
Quick Program Restart is a separate option, and the one place FANUC offers something dangerous by design. It keeps a “program restart memory” of recently executed blocks so you can pick a restart point off a list, with two methods. The search method performs a simulated execution up to the target block, updating modal G, F, D and H information and the absolute coordinate system without moving any axis — that is the one you want. The direct jump method “moves only the program cursor to the specified block at high speed without restoring modal information or coordinate values.” FANUC is clear about the price: the operator must specify the required auxiliary functions, position the machine at the restart position manually, and set the modal G codes by MDI operation before restarting. Use it only at a process boundary you have already decided to restore by hand — never in the middle of a pocket.
The Proving-Out Toolkit
Six switches, and it pays to know exactly what each one suppresses, because the gaps between them are where crashes live.
| Switch | What it does | What it does NOT do |
|---|---|---|
| Single block | One block per cycle start. The proving-out default for part one. | Does not stop in a block containing M98 P_, M99 or G65 — unless that block also contains an address other than O, N, P or L. Inside a canned cycle it stops only at three points, not at every internal move. |
| Machine lock | Position display updates as if the tool were moving; the axes do not move. Some machines have a lock switch per axis. | Does not suppress M, S, T and B — the spindle really starts and the changer really swings. Modal G codes and coordinate system setting still update. G27/G28/G30 are accepted but the tool does not go and the reference-return LED does not light. |
| Auxiliary function lock | Disables M, S, T and B. This is the switch that makes machine lock safe to use alone. | Does not block M00, M01, M02, M30, M98, M99, M198, or the M codes configured to call subprograms and custom macros — those still execute. |
| Dry run | Feeds at a parameter-set rate (No. 1410) instead of the programmed F, modified by the jog override dial and the rapid traverse switch. Intended for checking tool motion with the workpiece removed from the table. | Does not make the moves safe — the path is unchanged and the spindle still runs. Dry run alone with a part in the vise is not a program check. |
| Optional stop (M01) | Stops automatic operation after a block containing M01 — but only while the Optional Stop switch on the operator’s panel is pressed. Cycle start continues. | Has no effect on M00, which stops unconditionally with all modal information unchanged. |
| Optional block skip (block delete) | A leading / or /n (n = 1 to 9) makes the control ignore the rest of that block while the matching BDT signal is on. | The slash must be at the beginning of the block — put it elsewhere and everything from the slash to the end of block is ignored instead. Not all of the nine skip signals are wired on every machine. Skip state is also applied during a sequence number search. |
Two more worth knowing. Feedrate override covers 0 to 254% depending on what the builder implemented, but it is ignored during threading — always treated as 100%. And the high speed program check function, where available, runs the whole program at the CNC’s maximum speed with no axis movement, checking syntax and stroke limits, with PRG-CHK blinking at the lower-left of the screen. It only means anything if you position the machine at the program start point and set the workpiece coordinate system and tool compensation to the same state as the real cut first.
Errors While Trying to Start a Program
The curated set — the ones that stop you before the first chip, rather than the full alarm list.
| Number | Message | What it means and what to do |
|---|---|---|
| Machine not ready | ||
PS0224 | ZERO RETURN NOT FINISHED | A reference return has not been performed before the start of automatic operation. Do a manual reference position return. Only raised when bit 0 (ZRNx) of parameter No. 1005 is 0 — on a machine with that bit set to 1 you get no alarm and no stroke check either. |
| Wrong program, or no program | ||
PS0071 | DATA NOT FOUND | The address searched for was not found; the program number searched for is not in memory; or, in a program restart by block number, the specified block number could not be found. Check the number and the folder. |
PS0074 | ILLEGAL PROGRAM NUMBER | The program number is outside 1 to 9999. |
PS0075 | PROTECT | Among other causes: an attempt to select a program being edited in the background as the main program, or to call one as a subprogram. Close the background edit. |
PS0076 | PROGRAM NOT FOUND | A subprogram call, macro call or graphic copy referenced a program that does not exist. The main program was found; something it calls was not. |
DS0059 | — | The program corresponding to a program-number-selection signal from the machine side is not registered. This is the pallet/part-select path, not something you typed. |
| Starting or restarting at the wrong place | ||
PS0060 | SEQUENCE NUMBER NOT FOUND | The sequence number was not found for a program number or sequence number search, or, in a program restart by sequence number, the specified sequence number could not be found. Also raised when the number you are hunting lives in a subprogram — M98 is not executed during the search. |
PS0078 | SEQUENCE NUMBER NOT FOUND | Same text, different cause: the sequence number specified as the jump destination in GOTO or M99 P was not found. This one fires while running, not while searching. |
PS0094 | P TYPE NOT ALLOWED (COORD CHG) | The coordinate system was changed since the interruption. Use Q type. |
PS0095 | P TYPE NOT ALLOWED (EXT OFS CHG) | The external workpiece origin offset was changed. Use Q type. |
PS0096 | P TYPE NOT ALLOWED (WRK OFS CHG) | A workpiece origin offset was changed. Use Q type. |
PS0097 | P TYPE NOT ALLOWED (AUTO EXEC) | No automatic operation has been performed since power-on, emergency stop release, or the reset of alarms 0094 to 0097. Perform automatic operation, or use Q type. |
| Confirmations and warnings, not alarms | ||
| — | START FROM MIDDLE OF PROG (START/RESET) | Cycle start was pressed with the cursor mid-program. Cycle start again to proceed, RESET to abandon. A wrong-operation-prevention function, so it only appears if enabled. |
| — | MODAL DATA IS CHANGED BY BLOCK STOP | A reset occurred during program operation and modal G/F/H/D/T/S/M/B state was rolled back to the pre-block values. Re-establish the modal state before you continue. |
| — | Change to MEM mode or EDIT mode. | iHMI: you tried to set the main program from a base screen that is neither MEM nor EDIT. |
Alarm prefixes (PS, DS, SV, OT, SW…) and the full lookup method are covered in Fanuc Alarms & Diagnostics. Anything above that involves a switch on the operator’s panel, a mode name, or a program-selection signal is a machine-builder question first and a FANUC question second.
Habits That Prevent Most of This
Read the corner of the screen, not the paper traveler. The selected program number sits in the upper-right after a search and the mode sits on the status line. Two glances confirm you are about to run the program you think you are, in the mode you think you are.
Reset before every first cycle start. It costs nothing, it puts the cursor at the head, and it clears the modal ambiguity left by whatever the last person did.
Treat an interruption as a decision. Either you are restarting from the top — reset and go — or you are re-entering, in which case use Program Restart, not a sequence number search. Drifting between the two (searching to a block, glancing at the tool list, then pressing cycle start) is precisely the case where nothing alarms and the tool arrives at the part with no spindle, no offset and no coolant.
Machine lock and auxiliary function lock go together, and part one runs in single block. Machine lock alone still runs the spindle and swings the changer, so “check it without the machine doing anything” means both switches. On the first real part, a block per cycle start plus the feed override turned down buys you the second it takes to reach feed hold.
Learn your machine’s panel, not FANUC’s. The builder chose the switch labels, decided which block-skip signals exist, decided whether the wrong-operation-prevention confirmations are enabled, and set bit 0 of parameter No. 1005 — which determines whether the control will even tell you the axes are unreferenced. When the CNC manual and the machine disagree, the machine manual wins.
See Also
Fanuc Alarms & Diagnostics for decoding any alarm prefix and number, Fanuc Series & Generation Guide to work out which control and which manual apply to your machine, Fanuc Parameters for the parameter numbers referenced throughout this page, and Coordinate Systems & Offsets for the work offsets a mid-program start silently omits. For the same operator workflow on other controls, see Heidenhain: Running a Program at the Control — Block Scan is the direct counterpart of Program Restart, and GOTO the counterpart of a bare sequence number search.
References
- FANUC, Series 30i/31i/32i-MODEL B Plus, Common to Lathe System / Machining Center System — OPERATOR’S MANUAL, B-64724EN/01 — III-3.1 Manual Reference Position Return (p.1130); III-4.1 Memory Operation (p.1178); III-4.2 MDI Operation (p.1180); III-4.3 DNC Operation (p.1183); III-4.9 Program Restart (p.1206) and 4.9.1 Auxiliary Function Output in Program Restart (p.1221); III-4.10 Quick Program Restart (p.1226); III-5.1 Machine Lock and Auxiliary Function Lock (p.1298); III-5.5 Dry Run (p.1303); III-5.6 Single Block (p.1304); III-5.7 High Speed Program Check Function (p.1305); III-6.7 Wrong Operation Prevention Functions (p.1344); III-10.5 Program Search (p.1492); III-10.6 Sequence Number Search (p.1493); II-11.1 Auxiliary Function, M Function (M00/M01/M02/M30, p.286); II-13.2 Program Section Configuration — optional block skip (p.316); Safety Precautions, Warnings and Cautions Related to Handling; Appendix G, Alarm List.
- FANUC, iHMI CNC Operation Screen — OPERATOR’S MANUAL, B-64644EN-1/09 — 4.9.5 Setting the Main Program (p.236); 8.7 Restarting Programs (p.472) including 8.7.3 Operation Flow of Program Restart and 8.7.5 Restoring the Auxiliary Function; 8.8 Restarting Programs — Quick Program Restart Function (p.484).
- FANUC, Series 30i/300i/300is-MODEL A, Series 31i/32i-MODEL A, Common to Lathe System / Machining Center System — USER’S MANUAL, B-63944EN/03 — III-1.1 Manual Operation (p.982); III-1.2 Tool Movement by Programming, Automatic Operation (p.984); III-1.3 Automatic Operation (p.986); III-1.4 Testing a Program (p.988). Used as a cross-check on the mode taxonomy.
- FANUC, Series 16i/160i/160is-MB, Series 18i/180i/180is-MB5/MB — OPERATOR’S MANUAL, B-63534EN/02 — III-11.4.10 Displaying and Setting the Software Operator’s Panel (switch groups and parameter No. 7200, p.1049); III-4.5 Program Restart (p.802), which states “Find the program head. Press function RESET key.”; III-11.6.1 Displaying the Program Number, Sequence Number, and Status (the
MEM/MDI/RMT/EDIT/HND/JOG/INC/REFand****/STOP/HOLD/STRTstatus fields). Used as the older-generation cross-check. - Not covered here: 0i-D and 0i-F specifics. No 0i-series operator’s manual was consulted, and 0i controls differ in available options and screen layout — treat every switch, soft key and parameter above as something to confirm against your own machine’s documentation.
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch