ProductFor the plantStoriesBlogAboutData & securityРусскийBook a demo

Heidenhain code in your shop's style

Machinists edit every program anyway, so generated code has to look like their own: one LBL per hole group, the shop's cycles and tool numbers, a STOP after every tool.

Machinist holding a printed sheet and typing at a modern CNC control panel in a bright, clean machine hall

Generated NC code has a trust problem. In a jobbing shop, the machinist reads every program before it runs, and edits most of them. If the code looks as if a stranger wrote it, with unfamiliar cycles, a different structure and tool numbers that don’t match the magazine, it gets rewritten or put aside. Neither saves any time.

So the test we set for Metallovy’s Heidenhain output is simple: when the machinist opens the file on the TNC, it should look like something a colleague wrote.

What “the shop’s style” means

Every shop that programs a TNC 530 by hand develops habits. Looking at real programs, these are the ones that matter:

  • Structure. Klartext in millimetres, BLK FORM for the graphics, a header line starting with * for each section, separator comments.
  • Tool calls. TOOL CALL with S and F, and the shop’s own shorthand in the comment: ;U-Dr.14, ;Sw.D10,2, ;Fr.16x45. Even the decimal comma in D10,2 is the shop’s.
  • Moves. The same retract, approach and spindle start every time, with the quill (W) in the same position.
  • Cycles. Which cycle for which job: 200 for simple drilling and chamfers, 203 for insert drills, 208 for helical milling, 252 for circular pockets, and tapping with the shop’s own cycle and parameters.
  • Cycle comments in the control’s dialogue language, here transliterated Russian such as GLUBINA (depth), because that is what the control writes when you define a cycle at the machine.
  • Stops. A STOP after every tool, and a move to the tool change position only before a real tool change.

An excerpt

Here is the M16 section of DM2041.H, the program for our demo base plate. The part, the tools and the shop are invented; the style follows real programs from a TNC 530 shop.

30 * M16 swerlenie
31 ;----------------------------------
32 TOOL CALL 111 Z S2200 F180 ;U-Dr.14
33 L  Z+0  W+0 R0 FMAX M91
34 L  X+275.806  Y+355.806 R0 FMAX
35 L  Z+100  W-200 R0 FMAX M3 M8
36 CYCL DEF 203 UNIVERS. SWERLENIE ~
    Q200=+5    ;RASSTO. BEZOPASNOSTI ~
    Q201=-43   ;GLUBINA ~
    Q206= AUTO ;PODACHA NA WREZANJE ~
    Q202=+43   ;GLUBINA WREZANJA ~
    Q210=+0    ;WYDER. WREMENI WWER. ~
    Q203=+0    ;SURFACE COORDINATE ~
    Q204=+55   ;2-JE BEZOP.RASSTOJ. ~
    Q211=+0    ;WYDER.WREMENI WNIZU
37 LBL "D14"
38 L  X+275.806  Y+355.806 R0 FMAX M99
39 L  Y+444.194 FMAX M99
40 L  X+364.194 FMAX M99
41 L  Y+355.806 FMAX M99
42 L  X+835.806 FMAX M99
43 L  Y+444.194 FMAX M99
44 L  X+924.194 FMAX M99
45 L  Y+355.806 FMAX M99
46 LBL 0
47 L  Z+100 FMAX M5 M9
48 L  Z+0  W+0 R0 FMAX M91
49 L  X+5200  Y+480 FMAX
50 STOP

Later, the chamfer and the tap reuse the same list:

88 TOOL CALL 301 Z S1500 F200 ;Fr.16x45
...
93 CALL LBL "D14"

What to notice:

  • One point list per group. LBL "D14" holds the eight M16 positions of both bolt circles, typed once. The drill runs them where they are defined; the chamfer mill and the tap call them with CALL LBL "D14". One list means one place to check and one place to correct.
  • Tool 111 is in the shop’s TOOL.T. Metallovy chooses tools only from the shop’s own library, imported from the control’s tool table. If there is no suitable tool, it says so instead of inventing a number.
  • S2200 F180 came from people. Speeds and feeds are copied from the shop’s own step for this tool, or taken from cutting data a person entered in the tool library for that material. Metallovy never makes them up. No cutting data, no step: the assistant tells you what to enter.
  • Q201=-43 is the drawing’s 40 mm plus the 3 mm the shop habitually adds, learned from one of its earlier programs.
  • The parking move X+5200 Y+480 and the STOP close the step, because the next one needs a different tool. The three chamfers that run one after another with tool 301 have no parking move between them, only the retract and the STOP, exactly as the shop writes it. TOOL CALL still repeats every time, because each step carries its own S and F.

Recipes, not templates

Metallovy doesn’t ship with a fixed idea of how to drill an M16. It learns that from your shop.

You give it one or more programs you have already run. It parses each one, matches every cycle pass to the holes of the part, and stores a recipe per hole type: which tools in which order, which cycle, every Q parameter, S and F, the comments, how far past the drawing depth you go, how far the drill exits a through hole. On the next part with an M16 group, it uses your M16 recipe.

Between groups, it reorders steps so the same tool runs back to back, as a careful programmer would: in the demo, all three chamfers with one mill. Within a group, your order stays: drill, chamfer, tap.

For a tool from your library that your programs have never used, it builds a new step on the pattern of one of your own (cycles 200/203, 208 or 252), with S and F only from cutting data people entered. Where there is no recipe and no data, the group is not written. It goes to a person as a question.

On a real order, the program Metallovy generated matched the shop’s own program in 22 of 22 steps, with all 68 points within 0.01 mm.

Checked before it leaves

Every generated .H is read back by Metallovy’s own Heidenhain parser and checked against the part: every cycle pass against a hole in the model, every depth against the bottom of the part, every tap against the thread on the drawing, every tool against the library. The same check works on a program typed at the control.

Then comes a setup sheet: tools in the order they are loaded, cycle and depth for each step, and an estimate of the cutting time.

Still on a USB stick

Metallovy doesn’t talk to the machine. The program goes to the control the way it does today, on a USB stick, and the machinist checks it there, runs the graphics and decides. The difference is that what they open looks like their own work.

Try it on one of your own drawings, together with one program your shop has already run.

HeidenhainProgramming

All articles

Pilot

Bring one drawing. Leave with a program.

Send us one real order and the program your shop wrote for it. We return the coordinates, a program in your style and a line-by-line comparison — then your machinist tries it on the next job.