Heidenhain G-code practice
What carries over from any control
Whether a program is in Klartext or in DIN/ISO, it does the same things in the same order as any G-code program: pick a tool, start the spindle, move to a safe position, cut with compensation, retract. If you know what G00, G01, G02, G41 and G81 do, the Klartext words for them are a short list to learn. The common G-codes page covers the ideas.
Klartext words and what they correspond to
A few of the words you see in every Klartext program, next to the G-code idea they match. Check the Heidenhain manual for your TNC model.
| Code or word | What it does |
|---|---|
L X+50 Y+20 F200 | Straight line at feed: the job of G01. |
FMAX | Rapid traverse, written as the feed of a line: the job of G00. |
CC X+0 Y+0 | Sets the circle centre, used by the next C line. |
C X+10 Y+0 DR+ | Arc around CC; DR+ is counterclockwise, DR- clockwise (G03 / G02). |
CR X… Y… R… DR- | Arc by radius, like G02 or G03 with R. |
RL / RR / R0 | Radius compensation left, right, off: the job of G41, G42, G40. |
TOOL CALL 1 Z S3000 | Calls tool 1 along the Z axis with spindle speed 3000: tool change plus length offset in one line. |
CYCL DEF 200 DRILLING | Defines a drilling cycle with named Q parameters; CYCL CALL or M99 runs it. |
LBL 1 … LBL 0 / CALL LBL 1 | Label-based subprograms and repeats. |
Q1 = 25 | Q parameters: variables for calculations and cycle inputs. |
Things that surprise G-code users
- No automatic conversion. A Klartext program and a DIN/ISO program are two separate files. The control does not translate one into the other.
- Signs are written out. Coordinates are written X+50 and X-20. Leaving out the sign is not how Klartext programs are written.
- Arc direction lives in DR. There is no G02/G03; the direction is DR+ or DR- on the arc line.
Habits that help
- Learn the shop's main language first. Most Heidenhain shops write Klartext at the machine and post DIN/ISO from CAM, or the other way round. Learn the one you will edit.
- Use the test run graphics. The control's test run draws the toolpath and catches a wrong datum or radius compensation before cutting.
- Know your datum table. Work offsets come from the preset or datum table; a wrong preset moves the whole part.
Quiz: the G-code ideas behind every Klartext line
Mill and lathe: what does this code do?
G01
Codes and options vary by control version and machine builder. Check the manual for your machine before running a program.
Frequently asked questions
- What is the difference between Heidenhain Klartext and G-code?
- Klartext is Heidenhain's own programming language with readable words (L for a line, CC and C for arcs, RL/RR for compensation, TOOL CALL for tools). DIN/ISO mode on the same control runs standard G-code. They do the same jobs; there is no automatic conversion between them.
- Can a Heidenhain control run normal G-code?
- Yes, in DIN/ISO mode, which TNC controls offer alongside Klartext. Core codes behave as expected; cycles and some machine functions follow Heidenhain's own definitions.
- Is Klartext easier than G-code?
- It is easier to read without a code list, because it uses words. The machining ideas are identical, so someone who knows G-code learns Klartext quickly, and the other way round.
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.