Elements of an nc program, 1 smar t.t u rn and din (iso) pr ogr a mming – HEIDENHAIN SW 54843x-03 DIN Programming User Manual
Page 37

HEIDENHAIN MANUALplus 620, CNC PILOT 640
37
1
.1 smar
t.T
u
rn
and DIN (ISO) pr
ogr
a
mming
Elements of an NC program
An NC program consists of the following elements:
Program name
Program section codes
Units
NC blocks
Commands for program structuring
Comment blocks
The program name begins with "%" followed by up to 40 characters 
(numbers, uppercase letters or underscore; no diacritical marks) and 
the extension "nc" for main programs or "ncs" for subprograms. The 
first character must be a number or a letter.
Program section codes: When you create a new NC program, certain 
program section codes are already entered. You can add new codes 
or delete existing ones, depending on your program requirements. An 
NC program must contain at least the MACHINING and END section 
codes.
The unit begins with this keyword followed by the identification of 
the unit (ID"G..."). The following lines contain the G, M and T 
functions of this machining block. The unit ends with 
END_OF_UNIT followed by a check digit.
NC blocks begin with an N followed by a block number (with up to five 
digits). The block numbers do not affect the sequence in which the 
program blocks are executed. They are only intended for identifying 
the individual NC blocks.
The NC blocks of the HEADER and TURRET sections are not included 
in the block number organization of the editor.
You can use program jumps, repeats and subprograms to structure 
a program (example: machining the beginning/end of a bar, etc.).
Input and output: With "input" you can influence the flow of the NC 
program. Using "output," you can communicate with the machinist. 
Example: The machinist is required to check measuring points and 
update compensation values.
Comments are enclosed in brackets "[...]." They are located at the end 
of an NC block or in a separate NC block. Press the key combination 
CTRL+K to convert an existing block into a comment (and vice versa).
You can also enclose more than one program line in square brackets 
to mark them as a comment. To do this, enter a comment containing 
the character "[" and conclude the section by entering another 
comment containing the character "]".
