Back to GSM Code List

G80: cancelling the active canned cycle

G80 cancels whatever canned cycle is active and puts the control back into ordinary moves. You need it because the drilling, tapping and boring cycles (G73, G74, G76 and G81 to G89) are modal: while they are on, any block carrying an X or a Y runs the whole cycle again at that position, whether you wanted another hole or only meant to move across. G80 cuts that repetition and it is always written before the first move that is no longer a hole.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

Family
Cycles
Machine
Milling, Mill-turn
Risk
Medium
Example
G80

Syntax by control

Fanuc (milling)

G80 G00 Z50.

G80 belongs to the modal group of the canned cycles. It can be written on its own or next to the retract move; what it must not carry in the same block is X or Y coordinates, because depending on the control they are read as one more move.

Haas

G80

Same as Fanuc. Any code in the motion group (G00, G01, G02, G03) also cancels the canned cycle, but writing the explicit G80 is what keeps the program readable and what protects a start from a block in the middle.

Siemens 840D / 828D

MCALL

On Siemens the cycles are called modally with MCALL CYCLE81(...) and cancelled with an MCALL with nothing after it. If the cycle is called without MCALL, it runs once at the current position and there is nothing to cancel.

Heidenhain TNC (Klartext)

CYCL CALL

In Klartext the cycle is defined with CYCL DEF and run with CYCL CALL or M99 at each position, so normally there is nothing to cancel. If the modal call M89 is used, it is switched off with M99 or by defining a new cycle, depending on the TNC model.

Address letters used with it

LetterWhat it setsUnit
No argumentsG80 carries no letters. Writing it with an X or a Y in the same block can cause a move you did not expect, depending on how the control reads it.modal, no units
Z R Q P (the cycle values)They are lost when you cancel: the bottom, the reference plane, the peck and the dwell of the cycle stop being remembered. If you call the cycle again you have to write them once more.mm / ms
FThe feedrate is not cancelled: it stays modal after the G80, just like the G98/G99 return plane and the rest of the modals outside the cycle group.mm/min under G94

Worked example

A drilling operation followed by a milling operation on the same part: four holes with G81 and, afterwards, a slot in another area. The G80 block is the only thing separating the two, and without it the move to the start of the slot would turn into a fifth hole right on top of the clamp.

O0180 (TALADRADO Y DESPUES FRESADO)
( Program header. )
G21 G17 G40 G49 G80
( Safety header block. The G80 goes here too: if somebody starts the program from this point, it inherits no cycle from the previous run. )
G91 G28 Z0.
( Z to the reference point before the change. )
T4 M06
( 5 mm drill. )
G90 G54 G00 X20. Y20.
( Positioning over the first hole with Z up. )
G43 H04 Z25. M03 S2400
( T4 length offset and spindle on. )
M08
( Coolant on. )
G99 G81 Z-18. R2. F180
( Starts the drilling cycle at the current position: rapids down to Z2, drills to Z-18 and returns to the R plane. )
X60.
( Second hole: the new coordinate is enough, the whole cycle repeats. )
Y50.
( Third hole. )
X20.
( Fourth hole. )
G80 G00 Z50. M09
( Here is the key: G80 cancels the cycle before any rapid move. Without this block, the next X or Y in the program would drill another hole. )
(SIN EL G80, EL BLOQUE X140. Y5. DE ABAJO TALADRARIA EN ESA POSICION)
( And that position falls on a clamp, so the result would be a broken drill or a drilled clamp. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
T5 M06
( 6 mm cutter for the slot. )
G90 G54 G00 X140. Y5.
( Move to the start of the slot. With the cycle already cancelled, this is only a positioning move. )
G43 H05 Z50. M03 S3600
( T5 length offset and spindle on. )
G00 Z1. M08
( Approach and coolant on. )
G01 Z-3. F150
( Enters the material. )
G01 X180. F500
( Slotting pass. )
G00 Z50. M09
( Retract and coolant off. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
G90 M30
( Back to absolute and end. )
Open the simulator to check the example

Practical keys to using G80 in the workshop

Why a canned cycle stays alive until you cancel it

Because it is modal, and that is exactly where its usefulness lies: you write the cycle once and after that only the hole positions, which saves lines and avoids typos. The price is that the control cannot tell another hole from a simple move: every block carrying an X or a Y is one more hole. The same goes if the block only changes the return plane or adds repeats. That is why the G80 belongs to the close of the drilling operation with as much right as the M09 or the G40, and is not a matter of style.

Exactly where it goes

Right after the last hole and before any rapid move, any tool change and any G28 or G53. The usual form is a block like G80 G00 Z50. M09, which cancels and retracts on the same line. It is also worth including it in the safety header block of every tool, next to G17, G40 and G49: that way, if the operator starts the program from a tool in the middle, it inherits no cycle from the previous run. The two habits go together and both are worth having.

What it cancels and what it does not

G80 cancels the canned cycle group only, that is G73, G74, G76 and G81 to G89, and with them the remembered values are lost: the Z bottom, the R plane, the Q peck and the P dwell. It does not cancel cutter compensation, which is what G40 is for, nor the length offset, which is G49, nor the G98/G99 return plane, nor the feedrate, nor the work offset. It is also worth knowing that a code from the motion group cancels the cycle by itself on Fanuc and Haas: the written G80 is not redundant, it is what makes the program readable and safe.

Mistakes that cost you a part (or a tool)

  • Forgetting the G80 and moving to the next position: the control drills where you only meant to pass through, and if the move crosses over a clamp or the vise, the drill breaks.
  • Writing G80 with X or Y coordinates in the same block: depending on the control, that block can run a move you had not planned.
  • Cancelling the cycle by relying only on the G00 of the traverse block: it works, but if somebody starts the program from a block in the middle the cycle can still be active.
  • Believing G80 also cancels cutter compensation or the length offset: they are different modal groups and you have to write G40 and G49.
  • Calling the cycle again after a G80 without repeating Z, R and F: those values were lost when it was cancelled and the control either drills with whatever it inherited or alarms.
  • Making the tool change or the G28 with the cycle still active, without the G80 in front.
  • Leaving the G80 out of the safety header block and starting the program halfway, inheriting the cycle from the previous operation.

Frequently Asked Questions (FAQ)

Where do you put G80?

Immediately after the last hole in the series and before any move that is not another hole. The normal thing is to write it next to the retract, in a G80 G00 Z50. M09 block, and to repeat it in the safety header block of every tool as well.

What happens if I forget the G80?

The cycle stays active and the next block with an X or a Y drills another hole at that position. If that block was a traverse over a clamp, the vise or the fixture, the result is a broken drill, a drilled fixture or both.

Does G80 cancel cutter compensation?

No. G80 only affects the canned cycle group. Cutter compensation is cancelled with G40 and the length offset with G49. That is why the safety block carries all three together: G40 G49 G80.

Do I need G80 if the next block has a G00?

Technically no, because on Fanuc and Haas a code from the motion group cancels the cycle. But the explicit G80 makes clear where the operation ends and protects the case where somebody starts the program from a block in the middle, which is when accidents happen.

Does G80 clear the depth and the R plane of the cycle?

Yes: cancelling loses the remembered cycle values, Z, R, Q and P included. If you need the same cycle later on, it has to be written out in full again. The F feedrate, on the other hand, stays modal and is kept.

Related codes

Other codes in Cycles

See the full list of G and M codes

Related tools