beautypg.com

Program and block structure, 1 din pr ogr a mming – HEIDENHAIN MANUALplus 4110 User Manual

Page 279

background image

HEIDENHAIN MANUALplus 4110

279

6.1 DIN Pr

ogr

a

mming

Program and block structure

Program structure

„

Program number, starting with the character "%" followed by up to
eight characters and the extension "nc" for main programs or "ncs"
for subprograms.

„

Program designation (definition in the second program line).

„

NC blocks or comment blocks.

„

The term "END" with main programs or "RETURN" with macros and
subprograms.

The first and last lines of an NC program cannot be edited. The
program designation can be edited, but not deleted.

The program designation can be displayed in the "program list" and
edited with the "program selection" functions.

NC blocks begin with an "N" followed by a block number (with up to
four digits). The block numbers do not affect the sequence in which
the program blocks are executed. They are intended for identifying the
individual blocks.

An NC block comprises NC commands. These are traversing,
switching or organizational commands. Traversing and switching
commands start with a letter followed by a number (such as G1, G2,
G81, M3, M30) and the parameters. Organizational commands consist
of "key words" (WHILE, RETURN, etc.), or of a combination of letters/
numbers. The parameters are preceded by address letters (such as
X100, Z–2, etc.).

You can program several NC commands in one block unless they have
the same address letters or opposing functionalities.

Examples
Permissible combination:

N10 G1 X100 Z2 M8

Non-permissible combination:

N10 G1 X100 Z2 G2 X100 Z2 R30 (same address letters are used more
than once)

or

N10 M3 M4—opposing functionality

You can also program NC blocks containing only variable calculations.

Comments are enclosed in brackets "[...]." They are located at the end
of an NC block or in a separate NC block. An NC block consisting only
of a comment does not have a block number.

Example: Program and block structure

%12345678.nc

[Beispiel – Example]

N1 G21 X80 Z110 B10 J1

N2 G1 Z-15 B-1

N3 G1 X102 B2

N4 G1 Z-22

N5 G1 X90 Zi-12 B1

N6 G1 Zi-6

N7 G1 X100 A80 B-1

N8 G1 Z-47

N9 G1 X110

N10 G80

N11 G14 Q0

N12 T3 G95 F0.25 G96 S200 M3

N13 G0 X0 Z2

N.. . . .

END