All tools

Free tool

G-code quick reference

The G codes, M codes and address words the TNC-M34 milling controller and the TNC-L32 lathe controller interpret: what each does, which are modal, and where the two controllers differ.

Yes means that controller's manual documents the code as described. Differs means it is documented, and says how it differs. Not listed means that manual does not mention it, which is not proof the controller cannot run it.

Motion

CodeNameWhat it doesModalTNC-M34TNC-L32
G0RapidRapid move to the programmed point.MotionYesYes
G1Linear feedStraight move at the feed rate. Refused when no F has been set, rather than run at full axis speed.MotionYesYes
G2Arc, clockwiseCentre given by I/J/K offsets, or radius by R. An R too small to reach the end point refuses the program; an R arc whose start and end coincide is read as a full circle.MotionYesYes
G3Arc, counter-clockwiseAs G2, turning the other way.MotionYesYes
G4DwellWait for P seconds.YesYes
G28Go to referenceReturn to the reference position.YesYes
G28.1Set referenceSet the reference position, held in RAM.YesNot listed
G30Go to referenceReturn to reference; both manuals list it alongside G28.YesYes
G30.1Set referenceSet the reference position, held in RAM; listed with G28.1.YesNot listed
G32ThreadingListed with G33 as threading, K being the pitch.Not listedYes
G33Thread passZ follows the spindle's angle, one pitch per revolution. Pitch by K or F, refused without one. Each pass waits for the spindle index, and feed override does not apply.MotionNot listedYes

Plane, units, distance and path mode

CodeNameWhat it doesModalTNC-M34TNC-L32
G7Diameter modeX words are diameters. The default comes from the X PROGRAM setting, shipped as diameter.Radius/diameterNot listedYes
G8Radius modeX words are radii. How the DRO shows X is a separate setting.Radius/diameterNot listedYes
G17XY planeArcs in the XY plane. On TNC-M34, centre words that contradict the plane are corrected when unambiguous and refused when not.PlaneYesDiffers — refused at load
G18XZ planeArcs in the XZ plane. The only plane on TNC-L32, and fixed there.PlaneYesYes
G19YZ planeArcs in the YZ plane.PlaneYesDiffers — refused at load
G20InchProgram units are inches. A rotary 4th axis on TNC-M34 stays in degrees.UnitsYesYes
G21MillimetreProgram units are millimetres.UnitsYesYes
G61Exact stopThe axes stop fully at the end of every block. On TNC-M34, typed in MDI it also changes the machine's starting path mode.PathYesYes
G64Continuous pathCorners are blended within the junction deviation setting. The default on TNC-M34.PathYesYes
G90AbsoluteCoordinates are positions.DistanceYesYes
G90.1Arc centres absoluteI/J/K are read as absolute.YesNot listed
G91IncrementalCoordinates are distances from where the tool is.DistanceYesYes
G91.1Arc centres incrementalI/J/K are read as incremental.YesNot listed

Feed and spindle-speed modes

CodeNameWhat it doesModalTNC-M34TNC-L32
G50Spindle speed clampG50 S sets the highest rpm the spindle may reach, which constant surface speed needs as X approaches zero.OffsetsDiffers — scaling off; accepted and ignoredYes
G93Inverse-time feedEach move takes exactly 1/F minutes.YesNot listed
G94Feed per minuteF is units per minute.FeedYesYes
G95Feed per revolutionF is mm per spindle revolution. On TNC-L32 the measured spindle sets the rate, and a stalled spindle aborts the job.FeedDiffers — refused at loadYes
G96Constant surface speedS is a surface speed, so the rpm rises as X gets smaller. Set a ceiling with G50 S.SpindleNot listedYes
G97Fixed rpmS is spindle rpm.SpindleNot listedYes

Canned cycles: drilling, boring and tapping

On TNC-M34 a canned cycle is modal: X/Y lines after it are further holes, until G80. R is the retract plane, Q the peck, P a dwell in seconds, and G98 (the default) returns to the starting Z. TNC-L32 cycles are one-shot and are expanded into ordinary moves when the file loads.

CodeNameWhat it doesModalTNC-M34TNC-L32
G73Peck drill, chip breakPecks with a partial retract to break the chip.Modal cycleYesDiffers — pattern repeat, not built; refused
G74Left-hand rigid tapRigid tapping with the spindle in M4. Needs a STEP spindle; refused in the other spindle modes.Modal cycleYesDiffers — face grooving cycle (see lathe cycles)
G76Fine boringA mill boring cycle. TNC-M34 refuses the program rather than skip a modal cycle and every hole after it.Differs — refused at loadDiffers — threading cycle (see lathe cycles)
G80Cancel cycleEnds the active canned cycle.YesDiffers — accepted as a no-op; cycles are one-shot
G81DrillPlain drilling at each X/Y point.Modal cycleYesNot listed
G82Drill with dwellDrill, dwelling P seconds at depth.Modal cycleYesNot listed
G83Peck drill, full retractPecks with a full retract after each, so the flutes clear. The cycle for deep holes.M34 modal, L32 one-shotYesDiffers — centreline only, no X; Q in µm, P in ms
G84Rigid tappingZ and spindle move locked together, one pitch per revolution, with no M code emitted. The spindle must be running. Without a STEP spindle, TNC-M34 runs the motion only and TNC-L32 will not run it.M34 modal, L32 one-shotDiffers — M3 only (M4 is G74); pitch K, or F with SDiffers — centreline only; K or F is the pitch; M3 or M4
G85Bore, feed outFeed in and feed back out.Modal cycleYesNot listed
G86BoreMotion only: the spindle is not stopped at depth.Modal cycleYesNot listed
G87Back boringNeither controller runs it.Differs — refused at loadDiffers — side drilling, not built; blocks the run
G88BoreMotion only, as G86: the spindle is not stopped at depth.Modal cycleYesNot listed
G89Bore, dwell, feed outDwell at depth, then feed out.Modal cycleYesNot listed
G98Retract to initial ZCanned cycles return to the Z they started from. The default on TNC-M34.RetractYesYes
G99Retract to RCanned cycles return only to the R plane.RetractYesYes

Lathe cycles: roughing, grooving and threading

TNC-L32 expands these into ordinary moves when the file loads, so the toolpath plot shows every pass. G71 and G72 name their profile by sequence number, P the first N and Q the last, and G70 finishes the same lines.

CodeNameWhat it doesModalTNC-M34TNC-L32
G70Finish profileThe finish pass over the profile a G71 or G72 roughed.One-shotNot listedYes
G71Rough turningRoughs a profile by turning. A profile that reverses in the cut axis is refused.One-shotNot listedYes
G72Rough facingRoughs a profile by facing.One-shotNot listedYes
G73Pattern repeatListed in the TNC-L32 cycle table but not built yet; a program using it is refused by name.Differs — peck drilling (see drilling cycles)Differs — not built; refused by name
G74Face peck groovingGrooves a face in pecks. With X left out it peck drills with a chip-break back-off of R, faster than G83 for shallow holes.One-shotDiffers — left-hand rigid tappingYes
G75OD peck groovingGrooves the outside diameter in pecks.One-shotNot listedYes
G76Threading cycleA multi-pass thread with constant-area infeed. P carries spring passes. With no parameter block it uses its own defaults and says so on the panel.One-shotDiffers — fine boring, refused at loadYes

Tool offsets and compensation

CodeNameWhat it doesModalTNC-M34TNC-L32
G10 L1Write tool lengthG10 L1 P… Z… sets the length of tool P (0–6) in the tool table, and it survives power-off.YesNot listed
G40Compensation offCancels compensation. TNC-M34 never turns it on, so accepts G40 and does nothing.CompensationYesYes
G41Compensation, leftOffsets the path to the left of travel. On TNC-L32 it is nose-radius compensation, for boring and facing outward; put it on the approach move.CompensationDiffers — refused at loadYes
G42Compensation, rightOffsets the path to the right of travel. On TNC-L32 this is OD turning, whichever side the toolpost is on.CompensationDiffers — refused at loadYes
G43Tool length offset onG43 H… applies that tool's length to Z. It shifts what the program commands, not what the DRO shows.YesNot listed
G49Tool length offset offCancels G43. Probe a work datum with G49 in force.YesNot listed

Work coordinates and offsets

CodeNameWhat it doesModalTNC-M34TNC-L32
G10 L2Set work offsetG10 L2 P… X/Y/Z sets work system P, where 1–6 are G54–G59.YesNot listed
G52Local offsetAdds a local offset on top of the work system. The DRO does not include it.YesNot listed
G53Machine coordinatesMoves in machine coordinates, for this block only.One-shotYesYes
G54Work system 1Selects work coordinate system 1 (P1 for G10 L2).WCSYesYes
G55Work system 2Selects work coordinate system 2 (P2).WCSYesYes
G56Work system 3Selects work coordinate system 3 (P3).WCSYesYes
G57Work system 4Selects work coordinate system 4 (P4).WCSYesYes
G58Work system 5Selects work coordinate system 5 (P5).WCSYesYes
G59Work system 6Selects work coordinate system 6 (P6).WCSYesYes
G92Set positionSets an offset on top of the work system. On TNC-M34 the DRO keeps reading against the work system alone.OffsetsYesYes
G92.1Clear G92Clears the G92 offset.YesNot listed

Probing

On TNC-M34, probing runs from MDI or the macro PROBE verb; inside a program a G38 line is skipped and reported. One axis per block, and the number is a distance, not a coordinate: G38.2 Z-30. F is ignored: the TOOL ZERO settings give a fast pass, a back-off and a slow pass, and the slow pass gives the result. On TNC-L32 a G38 line in a program is refused, and the probe cycle is reached through its macro PROBE verb.

CodeNameWhat it doesModalTNC-M34TNC-L32
G38.2Probe toward, with errorMoves toward the work until the probe trips. No contact is an error, with a retract.YesDiffers — refused in a program; use macro PROBE
G38.3Probe toward, no errorAs G38.2, but no contact is not an error; check #probe_hit.YesDiffers — refused in a program; use macro PROBE
G38.4Probe away, with errorMoves away until contact is lost. Never losing it is an error, with a retract.YesDiffers — refused in a program; use macro PROBE
G38.5Probe away, no errorAs G38.4, without the error.YesDiffers — refused in a program; use macro PROBE

Polar, scaling and rotation

TNC-M34 refuses these modal codes at load, naming the code and the line, because each changes how every later line is read. Their cancel forms are accepted and ignored, since nothing was turned on.

CodeNameWhat it doesModalTNC-M34TNC-L32
G15Polar offCancels polar coordinates.Differs — accepted and ignoredNot listed
G16Polar coordinatesX and Y become radius and angle on every later line.ModalDiffers — refused at loadNot listed
G50Scaling offCancels scaling.Differs — accepted and ignoredDiffers — spindle speed clamp (see feed modes)
G51ScalingScales every later coordinate.ModalDiffers — refused at loadNot listed
G68RotationTurns the whole coordinate frame.ModalDiffers — refused at loadNot listed
G69Rotation offCancels rotation.Differs — accepted and ignoredNot listed

M codes: program, spindle, coolant and I/O

An M code a controller does not have is skipped with a message rather than treated as an error. On TNC-M34 any motion on the same line still runs.

CodeNameWhat it doesModalTNC-M34TNC-L32
M0Program stopStops the program.YesYes
M1Optional stopStops only when optional stop is on (the opt_stop setting on TNC-M34).YesYes
M2Program endEnds the program.YesYes
M3Spindle clockwiseStarts the spindle clockwise at S. A step-driven spindle ramps to speed instead of jumping.SpindleYesYes
M4Spindle counter-clockwiseStarts the spindle counter-clockwise. On a step-driven spindle a change of direction ramps down through zero and back up.SpindleYesYes
M5Spindle stopStops the spindle.SpindleYesYes
M6Tool changeWhat happens is set in the controller's configuration.Differs — ignore, pause, or run toolchange.mac, per tool_changeDiffers — stops only in MANUAL change mode
M7Mist onTurns mist coolant on.CoolantYesYes
M8Flood onTurns flood coolant on.CoolantYesYes
M9Coolant offTurns mist and flood off.CoolantYesYes
M13Spindle and coolant, clockwiseSpindle clockwise and flood on together: M3 plus M8.YesYes
M14Spindle and coolant, counter-clockwiseSpindle counter-clockwise and flood on together: M4 plus M8.YesYes
M30Program endEnds the program; both manuals list it with M2.YesYes
M48Overrides enabledLets the operator's feed and speed overrides act.YesDiffers — manual names feed override only
M49Overrides disabledLocks out the feed and speed overrides.YesDiffers — manual names feed override only
M62Output on, with motionSets output P (0–15 on TNC-M34), synchronised with motion.YesDiffers — P is pin 0–7
M63Output off, with motionClears output P, synchronised with motion.YesDiffers — P is pin 0–7
M64Output on, nowSets output P immediately.YesDiffers — P is pin 0–7
M65Output off, nowClears output P immediately.YesDiffers — P is pin 0–7
M66Wait for inputWaits on input P.YesDiffers — P is pin 0–7

Address words

CodeNameWhat it doesModalTNC-M34TNC-L32
A B C4th axisThe 4th axis answers to whichever letter is configured; a rotary axis is in degrees. With a STEP spindle it is C, and is the spindle. Another rotary letter loads with a warning and will not start.YesDiffers — refused at load
FFeedFeed rate, in the units of the feed mode. A feed move with no F in effect is refused. For a thread or tap, see G33 and G84.ModalYesYes
HTool length numberThe tool whose length G43 applies, 0–6.YesNot listed
IArc centre, XArc centre along X.YesYes
JArc centre, YArc centre along Y.YesNot listed
KArc centre Z, or pitchArc centre along Z. Also the pitch, mm per revolution, for G84 and on TNC-L32 for G33.YesYes
LG10 targetWhat G10 writes: L1 the tool table, L2 a work offset.YesNot listed
MMachine functionAn M code; see the table above.YesYes
NSequence numberLabels a block. G71 and G72 name their profile by it.Not listedYes
PDwell, or a numberDwell in seconds for G4 and the cycles; the tool or work system G10 writes; the pin for M62–M66.YesDiffers — ms in G83; first N in G71/G72; spring passes in G76
QPeckPeck increment in drilling cycles; ignored when tapping.YesDiffers — µm in G83 (Q3000 is 3 mm); last N in G71/G72
RRadius, or retractArc radius; on TNC-M34 a negative R takes the long way round. In a canned cycle, the retract plane.YesDiffers — G83 re-entry clearance (1 mm default); G74 back-off
SSpindle speedSpindle rpm. On TNC-M34 a lone S retargets a running spindle.YesDiffers — surface speed under G96; rpm limit with G50
TToolSelects a tool. T0102 is geometry 1 with wear register 2. The control retracts before the offset changes.Not listedYes
UIncremental XAn incremental X move.Differs — not an axis; loads with a warning, will not startYes
WIncremental ZAn incremental Z move; in G83 and G84, an incremental hole bottom.Differs — not an axis; loads with a warning, will not startYes
XX axisX position.YesDiffers — a diameter by default (G7/G8)
YY axisY position.YesDiffers — refused at load
ZZ axisZ position; the hole bottom in drilling and tapping cycles.YesYes

Differences between TNC-M34 and TNC-L32

The TNC-M34 is a four-axis milling control and the TNC-L32 a two-axis lathe control, so many codes exist on only one. These are the places where both manuals use the same number, or the same job, differently.

TopicTNC-M34TNC-L32
Plane and X wordsArcs in G17, G18 or G19. X is a position.G18 only; G17 and G19 are refused. X is a diameter by default (G7/G8). U and W are incremental X and Z. Y, A, B and C are refused.
Feed per revolution and surface speedG95 is refused at load. No G96. G50 means scaling off and is ignored.G95 feeds per revolution of the measured spindle. G96 holds surface speed, G50 S caps the rpm, G97 returns to fixed rpm.
Canned cyclesModal: X/Y lines after a cycle are further holes until G80.One-shot, expanded when the file loads, so the plot shows every pass. G80 is accepted and does nothing.
Same number, different cycleG73 peck drill. G74 left-hand tap. G76 fine boring and G87 back boring, both refused.G73 pattern repeat, not built. G74 face grooving. G76 threading. G87 side drilling, not built.
Peck drilling, G83At each X/Y hole. Q is the peck, P a dwell in seconds, R the retract plane.On the centreline, with no X. Q is in microns, P in thousandths of a second, R the clearance on re-entry; it retracts to where the cycle started.
Rigid tapping, G84Needs a STEP spindle. X/Y hole, R plane, pitch K or F with S. G84 with M3, G74 with M4. A feed hold stops Z and spindle together; HOLD then REVERSE backs the tap out. Other spindle modes run the motion only, with a warning.Needs DRIVE = STEP. Centreline, pitch K or F, M3 or M4. A feed hold waits for the pass to end. The hole ends deeper than Z by pitch × rpm² ÷ (120 × SPIN ACCEL). On an analog spindle it loads but will not run.
Compensation and tool offsetsG41 and G42 are refused; G40 is accepted. Tool length by G43 H and G49, written with G10 L1.G41 and G42 give nose-radius compensation. Tool geometry and wear come with the T word, such as T0102.
Tool changeM6 ignores, pauses, or runs toolchange.mac, as the tool_change setting says.A T word selects the offset and retracts first. M6 stops only in MANUAL change mode.
ThreadingNot listed.G33 and G32 passes locked to the spindle index, and the G76 cycle.
ProbingG38.2 to G38.5 from MDI or macro PROBE. In a program the line is skipped and reported.G38 in a program is refused, not built yet. The probe cycle is reached from a macro.
Codes it does not knowAn unknown G with coordinates: that line is skipped and the program continues. Alone on its line: silently ignored. An unknown M: the action is skipped, motion on the line runs.An unknown G with coordinates blocks the run. Without coordinates it is ignored with a NOTE on the panel. An unknown M is skipped with a NOTE.
Outputs and inputsM62–M66 with P 0–15.M62–M66 with P as pin 0–7.

Macros and subprograms

Neither manual documents G-code subprogram calls. Both controllers run macros instead: plain-text .mac files of short commands such as PROMPT, PROBE and IF … GOTO, with ; comments, started from the panel. On TNC-M34 an M6 can run toolchange.mac; on TNC-L32 a macro line that is not a verb is passed to the G-code parser.

Example blocks

Neither manual prints a complete program. These blocks are quoted from them.

TNC-M34 Operator Manual

Rigid-tap a hole on a STEP spindle (Appendix B), an incremental MDI move that a following X5 repeats (section 9), a probe touch-off, and a tool length written by hand (Appendix B):

M3 S500
G84 X… Y… Z-15 R2 K1.5

G91 G1 X5 F200
X5

G38.2 Z-30
G10 L1 P<tool> Z<value>

TNC-L32 operator manual

Start the spindle to skim a diameter (section 3b), select the master tool (section 4), and the MDI and G76 lines drawn on the panel (section 1):

M3 S600
T0101
G0 X50 Z2
N142 G76 X17.4 Z-25 P1227

Sources: TNC-M34 Operator Manual, firmware V1.3 (build 22); TNC-L32 operator manual, firmware 0.1, revised 2026-09-09. Controllers: TNC-M34 four-axis milling controller and TNC-L32 two-axis lathe controller.