Table of Contents
IntroductionManual Operation & Start-up Procedures
Back to the Heidenhaim Pgrm and Op Instr home page
Converting to ISO Format:  Please look to your right ->
ISO Criteria
Address Words
Circular Interpolation
Canned Cycles
Subroutines (Macros) and Loops
Console Editing
Setting Tool Length Offsets (TLOs)
Running Programs
Data Transfer PC<---> CNC
Demonstration Program
Credits and Copyright Information

Bridgeport Heidenhain CNC Mill
Programming & Operating Instructions

Chapter 3
Programming in the ISO Format
(EIA-274-D or G-Codes)

Changing the Controller's Format to ISO

If the controller is in the conversational format mode, the Heidenhain controller must be reset to ISO format in order to receive external (offline) ISO (or G-code) programs.

It is recommended that you have your instructor perform this operation.

  1. Press the MOD h-mod.gif (1044 bytes)key.
  2. Cursor up to "USER PARAMETERS" and press h-ent.gif (1095 bytes).
  3. Cursor to "DIALOG=0 ISO-1" prompt.
  4. Press "1" for ISO format.
  5. Press the delete blockh-del-bk.gif (1061 bytes)key. This "shuts down" the control while the control converts every program in its memory to the ISO format.
  6. Re-power up the controller following the instructions in Chapter 2:  Powering up the Controller.

Back to the top of this page

ISO Criteria

RS-274-D or word address (G-code) programs must:

  • Begin with block containing only a percent sign, the program number, a G70 (or G71), and a carriage return (CR) (no sequence number).
  1. The program number can be any number between 01 and 499; numbers 500 and above are reserved for faculty.
  2. The program's floppy disk filename can be the same as the program number, but it could be any valid alphanumeric combination that follows the MS-DOS 8-3 filename.ext naming rules.
  • End with a block containing only N9999, a percent sign, the program number, and a G70 (or G71), and CR.
  • Utilize the ASCII (RS-358, even parity) tape code for paper tape input.
  • Utilize the block format:
    N4.0 G2.0 XYZIJK3.4 F3.1 S4.0 T3.0 M2.0
  1. EXCEPTION: Circular/arc path (see below).
  2. Parameters associated with certain G-codes use various address words such H, DR, P, and R.
  3. Spaces are ignored.
  4. Positive values are assumed.
  5. Leading and trailing zeros can be omitted (zero suppression) for XYZIJK data but not for other data.
  6. Sequence numbers should be incremented by 10s. They must not be duplicated and must be in numerical order.
  • Example program structure.
%250 G70 (or G71)
N10 G99 T1 L-2. R0.25
N20 G17 G00 (or G01 or G02 or G03) G90 (or G91)
N450 M30
N9999 %250 G70 (must match 1st line)

Back to the top of this page

Address words

D = Parameter definition (program variable parameter Q)

F = Feedrate
F = Dwell time with G04
F = Scaling factor with G72

G = Preparatory functions (G-codes)

H = Polar coordinate angle
H = angle of rotation with G73

I = X coordinate of circle/arc center or pole
J = Y coordinate of circle/arc center or pole
K = Z coordinate of circle/arc center or pole

L = Set (Define) label (subroutine/loop) number with G98 preface
L = Label (subroutine/loop) call number
L = Tool length with G99 preface

M = Miscellaneous (auxiliary) codes.

N = Sequence number

P = Machining canned cycle parameter
P = Parameter in parameter definitions

Q = Program parameter (variable) "Q"

R = Polar coordinate radius
R = Circle radius with G02/G03/G05
R = Rounding-off radius with G25/G26/G27
R = Chamfer length with G24
R = Tool radius with G24
R = Tangential approach radius with G26
R = Tangential departure radius with G27

S = Spindle speed
S = Angular position with G36

T = Tool definition with G99 preface (TLOs)
T = Tool call

X = X-axis
Y = Y-axis
Z = Z-axis

RETURN = End of block (EOB).

Back to the top of this page


Non-modal commands are prefaced with *; note that  the "*" is not part of the code.

G00 = One- or two-axis rapid travel move.
G01 = Two-axis linear motion (can also be three-axis)
G02 = Circular motion, CW
G03 = Circular motion, CCW
* G04 = Dwell with F seconds (e.g. G04 F2.5)
G06 = Circular motion, tangential from previous move
* G07 = Single axis move
G11 = Linear polar motion
G12 = Circular polar motion, CW
G13 = Circular polar motion, CCW
G16 = Circular polar motion, tangential from previous move
G17 = Plane selection XY, spindle axis Z
G18 = Plane selection ZX, spindle axis Y
G19 = Plane selection YZ, spindle axis X
* G24 = Chamfer with R
* G25 = Corner rounding with R
* G26 = Tangential approach with R
* G27 = Tangential departure with R
G28 = Mirror image w/ mirror axis (e.g., G28 X)
* G29 = Designate current position as pole location
* G38 = Stop (untimed dwell)
G40 = Tool radius compensation off
G41 = Tool radius compensation, left
G42 = Tool radius compensation, right
G54 = Origin shift
G70 = Inch (usable only at start of program)
G71 = metric (usable only at start of program)
G72 = Scaling with F factor (e.g, G72 F0.5)
G73 = Coordinate system rotation
G74 = Slot milling canned cycle
G75 = Rectangular pocket cycle, CW
G76 = Rectangular pocket cycle, CCW

G77 = Circular pocket cycle, CW
G78 = Circular pocket cycle, CCW

* G79 = Cycle call
G83 = Drilling, both peck & non-peck
G90 = Absolute positioning
G91 = Incremental positioning
* G98 = Set (define) label (subroutine/loop) number preface
* G99 = Tool definition preface

Back to the top of this page


M-codes are acted on first/last as appropriate

M03 = Spindle on CW (first)
M25 = Retract quill, spindle & coolant off (first)
M30 = Rewind memory = program end (last)
M89 = Cycle call, modal (canceled by M99)
M99 = Cycle call, nonmodal

Circular Interpolation

Absolute/Incremental Format Problem

The Heidenhain rearranges the elements in circular/arc blocks such that the I and J elements occur before the G02/G03 and G90/G91 commands


Nnnn G02 G91 Xnnn Ynnn Innn Jnnn
Nnnn Innn Jnnn G02 G90 Xnnn Ynnn

This causes no problem if the program is written entirely in the absolute (G90) mode or entirely in the incremental (G91) mode. But when linear moves are written in the G90 mode and arc moves in the G91 mode (or vise-versa), problems arise.

In the rearranged format, the G02/G03 and G90/G91 commands follow the I & J elements and are then in turn followed by the X & Y elements. If the previous block was absolute (G90), it will evaluate the I & J elements as being absolute, then read the G91 command and then evaluate the following X & Y elements as being incremental. An error message results.

For example, consider the following EIA-274-D program statements.

All comments ('$' and subsequent characters) must be removed
prior to uploading program into the Heidenhain controller.
Click here to download a zipped copy of 274UTILS

%501 G70 			$ Program # & inch units
N5 G99 T1 L-2.0 R+0.0		$ Define TLO
N10 G00 G40 G90 X0 Y0 M25	$ RPD to origin
N20 T1 G17 S1800.		$ Load tool 1; X-Y, RPMs
N30 G01 X+2.1737 F300		$ ABS X-axis to arc start
N40 G02 G91 X+0.2457 Y-0.4721 I+0 J-0.3 $ Incr arc
N50 M25				$ Retract quill
N60 M02				$ Rewind memory
N70 %501 G70			$ End of program

The controller rearranges line N40 so that the program appears thus:

N40 I+0 J-0.3 G02 G91 X+0.2457 Y-0.4721 $ Incr arc 

Note that the controller will still be in the absolute (G90) mode (from the prior block) as it reads sequence N40's I & J elements, not changing its positioning mode to incremental until it reads the G91, which now occurs after the I & J elements. Then it will interpret the X & Y elements (occurring after the G91) as being incremental. Hence, to the controller, the statement comes out as a mix of absolute and incremental data, which is both confusing and illegal.

The Solution

Insert a G91 command in a block all by itself, just ahead of each incremental arc command thus:

N35 G91 $ Set positioning mode to incremental
N40 I+0 J-0.3 G02 G91 X+0.2457 Y-0.4721 $ Incremental arc 

In this manner, the positioning mode will have already been set to incremental when sequence N40's I & J elements are read. (The G91 in sequence N40 is now redundant, but harmless.)

Back to the top of this page

Last updated on Jan. 17, 2005, by Bill Hemphill