Skip to main content Scroll Top
What Should Every CNC Safe Start Block Include?
Ask any experienced machinist 'what's in your safe start?' and you'll get a line like G17 G40 G49 G80 G90 — the block that forces the control into a known state so your program doesn't inherit leftover modal settings from whatever ran before.

"What's in your safe start for every program?" — and why the answer matters

It’s one of the most-asked questions on any machining forum: what’s in your safe start for every CNC program? Almost every experienced machinist has a “safety line” they put at the top of every program — a short block that forces the control into a known, safe modal state before the real work begins. The reason is simple and a little unnerving: a CNC control is modal. It remembers. Cutter compensation, a canned cycle, incremental mode, a coordinate rotation, the wrong plane, even the wrong units — any of these left active by the program that ran before yours is still active when yours starts, unless you cancel it. The safe start block is how you refuse to inherit someone else’s leftover state.

What a safe start block typically includes

The exact set varies by control and by shop, but a common mill safe start looks like G17 G40 G49 G80 G90 — often with a few more. Here’s what each is doing and why it’s there:

  • G17 — select the XY working plane, so arcs and canned cycles use the plane you expect (not a G18/G19 left active).
  • G40 — cancel cutter (radius) compensation, so no leftover comp offsets your first moves.
  • G49 — cancel tool-length compensation, so a stale length offset doesn’t drop the tool into the part.
  • G80 — cancel any canned cycle, so a drilling/tapping cycle from the last program doesn’t fire on your first positioning move.
  • G90 — absolute positioning, so your coordinates mean what you intend (not incremental from a G91 left active).

Depending on the control and the shop, a safe start also often includes: G94/G95 (feed-per-minute vs feed-per-rev), G20/G21 (inch vs metric units), G69 (cancel coordinate rotation), G15 (cancel polar), a work offset such as G54, and M5 / M9 (spindle and coolant off). The point isn’t a fixed magic line — it’s to explicitly cancel or set every modal state your program depends on, rather than assume it.

Why it prevents startup crashes

Leftover modal state is one of the classic ways a program crashes on its very first moves — before it’s really doing anything:

  • A canned cycle left active (no G80) turns your first rapid positioning into a drilling move — the tool plunges where you only meant to move.
  • Cutter comp left on (no G40) offsets your approach, so the tool goes somewhere you didn’t program.
  • A stale tool-length offset (no G49) drives Z to the wrong height.
  • Incremental mode left active (no G90) turns absolute coordinates into moves relative to wherever the machine happens to be.
  • The wrong units or plane (no G21/G20, no G17) scales or orients everything wrong.
  • A coordinate rotation left active (no G69) sends the whole program into a rotated frame.

None of these are errors in your program’s geometry. They’re the state your program started in — which is exactly what the safe start block controls.

Verify the startup sequence — not just assume it

A safe start block is a discipline, not a guarantee. It can be incomplete (missing the one cancel that mattered), wrong for the control (a code that doesn’t do there what you think), or defeated by an unusual leftover state. And whether your startup came from a post-processor, a template, or your own habit, the only way to know it leaves the machine in the state you intend is to run it the way the control will.

That’s the case for verifying the startup sequence, not just eyeballing it — because the safe start is precisely about modal state, which a static read of the line can’t confirm.

Where Eureka G-Code fits

Eureka G-Code executes the real NC program — safe start block and all — on a digital twin of your machine, reproducing the control’s modal state exactly as it will behave. So the startup sequence is verified for real:

  • If the safe start fails to cancel something — a canned cycle, comp, a rotation — the twin runs the resulting motion, so the plunge, the offset approach, or the rotated move shows up as a collision, near-miss, or wrong motion before the machine does it.
  • If a startup code is wrong for the control, the twin executes it the way the real control does, so the mismatch surfaces at a desk.
  • Because it runs the whole program from its real starting state, the errors that only appear because of the startup state — not in the geometry — are exactly the ones it catches.

Whether the program is posted from CAM, generated by Eureka NC Coder, or hand-written, its startup is verified as your control will actually behave — the state the first moves really run in, not the state you assumed.

> Take a program’s opening block — your safe start plus the first few moves — and run it on a twin of your machine in Eureka G-Code. Watching the control land in the state you intended, before the first positioning move happens for real, is how a leftover canned cycle or comp gets caught at a desk.

FAQ

What is a CNC safe start block?

A short block at the top of a program that forces the control into a known, safe modal state — commonly G17 G40 G49 G80 G90, often with units, feed mode, work offset, and rotation/polar cancels. It exists because the control is modal and remembers settings from the previous program, which your program would otherwise inherit.

What does G17 G40 G49 G80 G90 mean?

 G17 selects the XY plane; G40 cancels cutter (radius) compensation; G49 cancels tool-length compensation; G80 cancels any active canned cycle; G90 sets absolute positioning. Together they cancel or set the modal states most likely to be left active by a previous program.

What else should a safe start include?

 Depending on the control and shop: units (G20/G21), feed mode (G94/G95), a work offset (e.g. G54), coordinate-rotation cancel (G69), polar cancel (G15), and spindle/coolant off (M5/M9). The goal is to explicitly set every modal state your program relies on rather than assume it.

How does a missing safe start cause a crash?

Because a leftover modal state governs your first moves. A canned cycle left active turns a positioning move into a plunge; cutter comp left on offsets the approach; incremental mode turns absolute coordinates into relative moves. The geometry is fine — the state it starts in isn’t.

How do I verify my startup sequence?

 Run the real program, including the safe start, on a digital twin that reproduces the control’s modal behavior. Eureka G-Code executes it as the control will, so a safe start that fails to cancel something — or a code that’s wrong for the control — shows up as wrong motion or a collision before the machine runs.

Next step

Verify your startup sequence with Eureka G-Code before running the program.

A safe start block sets the state your program assumes. Verifying it — on a twin, as the control behaves — confirms the machine is actually in that state before the first move.

Related Articles