The question behind this search is procedural: a job needs mid-program access, a chip check, an inspection point, a part flip, and the operator wants the machine in a genuinely safe configuration before the door moves. The answer is a programmed sequence rather than an improvised one, three commitments in code, because the alternative people actually improvise, feed hold and a tug on the handle, parks nothing: the tool is mid-cut, the spindle is live, and the program is one button from resuming.

Pause versus park

The distinction the whole topic turns on: a pause keeps the machine’s intent alive, and a park retires it. Feed hold is a pause, motion stops, but the spindle turns, the modes stand, and cycle start resumes the interrupted move from its interrupted middle. A park is a different physical situation built deliberately in code: the tool clear of the work by a route that was calculated, the spindle commanded dead rather than merely waiting, and execution stopped at a block chosen in advance, where resuming is a decision instead of a reflex. Doors should open onto parks. Everything below is just the three lines that build one.

The sequence and its order

StepThe codeWhat it commits
1. Retract Z by a calculated routeG91 G28 Z0 G90, or G53 G00 Z0Tool clear of the work, by a path you chose
2. Stop the spindleM05Rotation dead before hands approach
3. Stop the programM00 (always) or M01 (optional stop)The cycle cannot continue without deliberate restart

Order is half the safety. Retract happens first, while the program’s state is intact; spindle stop before the door because rotation is the hazard hands meet first; program stop last, parking execution at a block you chose, so the restart story is a known re-entry rather than a reconstruction.

The two retract idioms, and the one mistake

Both standard idioms are documented across dialect references, and they differ in route logic. G91 G28 Z0 G90 goes to the reference position through a waypoint made harmless: incremental mode turns the Z0 into a zero-distance hop, so the machine rises straight from wherever it is, immune to the offset arithmetic that makes naked G28 lines overtravel or worse. G53 G00 Z0 skips the waypoint concept entirely: machine coordinates for one block, top of travel, said plainly, on controls that support it.

The mistake the idioms exist to prevent is the improvised retract: a bare G28 Z with a number that becomes a waypoint in work coordinates, or a G90 move to a Z that is comfortable in one offset and inside the part in another. Retract lines are safety code, and safety code earns the fixed idiom, the same one, every program, reviewed once and trusted thereafter.

M00 versus M01: structural versus situational stops

The program-stop family gives the door stop its handle. M00 halts every cycle unconditionally, the right tool for stops that are part of the process: the mandatory inspection, the flip, the chip clear that the job cannot run without. M01 halts only when the operator has optional stop armed, which makes it the production pattern: the same program runs hands-off when the switch is off and pauses for intervention when somebody needs the access. Shops that mark the stop’s purpose in a comment beside it, the parenthetical documentation habit, hand the next operator the why along with the where.

Interlocks, and what the sequence is for

Modern enclosures interlock the door against live cycles, machine-guarding requirements exist in regulation for the same reason they exist in steel, and the programmed sequence is not a substitute for that layer; it is the procedure the layer guards. The interlock decides whether the door opens; the sequence decides what the door opens onto: a tool parked clear, a dead spindle, a program at a deliberate stop with its state intact for the restart. On older or modified machines where the interlock layer has aged, the programmed discipline becomes the only layer left, which is less an endorsement than a warning about those machines.

The sequence is three lines, learned once, and the fluency that lets an operator verify it at a glance, knowing what each word commits without consulting anything, is the same recall the free 60-second drills on the G-code practice page build. Safety procedures work when they are boring, and these three lines are exactly as boring as they should be.

Sources

Frequently asked questions

What is the safe Z retract code on a Fanuc before opening the door?

The programmed sequence: G91 G28 Z0 G90 (or G53 G00 Z0) to retract Z, M05 to stop the spindle, then M00 program stop so the cycle halts until a deliberate restart. The order matters, and the door interlock does its job on top.

Why is feed hold not enough before opening the door?

Feed hold pauses motion wherever it happens to be: tool in the cut, spindle running, program ready to resume mid-move. It is a pause button, not a parking procedure.

Should I use M00 or M01 for the planned door stop?

M00 for stops that must always happen; M01 for stops an operator sometimes needs, armed by the optional stop switch. Choose by whether the stop is structural or situational.

Do door interlocks make the programmed sequence unnecessary?

No, they make it enforceable: the interlock decides whether the door opens, and the sequence decides what it opens onto, tool clear, spindle dead, program parked at a known block.