G-code reference

G10: Programmable data input

G10 is programmable data input. Writes offsets (work offsets, tool offsets) from inside the program. It is non-modal, so it acts only on the line it is written on.

What G10 does

G10 lets a program set values that are normally typed into the offset pages, such as work offsets or tool length and radius offsets. The L word picks which table is written. Because it overwrites stored offsets, a wrong G10 line can move every later cut, so it is used carefully and mostly by experienced programmers.

TypeG-code
MachineMill and lathe
GroupNon-modal
ModalNo: acts only on its own line

G10 example

G10 L2 P1 X-300. Y-200. Z-400.

Set work offset G54 (P1) to these machine positions.

WordWhat it means here
G10Programmable data input
L2repeat count, or which data table G10 writes
P1a parameter: dwell time, program number, sequence number or cycle setting, depending on the code
X-300.X axis target (on a lathe, the diameter)
Y-200.Y axis target
Z-400.Z axis target or depth

Codes people confuse with G10

CodeWhat it does instead
G92 Set coordinate system (shift). Tells the control that the current position has the given coordinates.
G54 Work offset 1. Selects the first work coordinate system, where program zero is on the part.

Other codes in the non-modal group

These also act only on their own line.

  • G04 Dwell
  • G09 Exact stop (one block)
  • G28 Return to reference position
  • G30 Return to second reference position
  • G50 Maximum spindle speed (lathe)
  • G52 Local coordinate system
  • G53 Machine coordinate move
  • G65 Macro call
  • G92 Set coordinate system (shift)

Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.

Quick check: G10

  1. What does G10 do? (Mill and lathe)

  2. Which code: Writes offsets (work offsets, tool offsets) from inside the program.(Mill and lathe)

  3. What does G92 do? (Mill)

Show the answers
  1. Writes offsets (work offsets, tool offsets) from inside the program.
  2. G10
  3. Tells the control that the current position has the given coordinates.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does G10 mean in CNC programming?
Programmable data input. Writes offsets (work offsets, tool offsets) from inside the program.
Is G10 modal?
No. G10 acts only on the line where it is written; the next line goes back to whatever modal codes were already active.
What is the difference between G10 and G92?
G10 (programmable data input): writes offsets (work offsets, tool offsets) from inside the program. G92 (set coordinate system (shift)): tells the control that the current position has the given coordinates.
What is the difference between G10 and G54?
G10 (programmable data input): writes offsets (work offsets, tool offsets) from inside the program. G54 (work offset 1): selects the first work coordinate system, where program zero is on the part.

G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.

Free preview · no card Try G-Code Sprint