Contents of an NC program
Application
You use NC programs to define the movements and behavior of your machine. NC programs consist of NC blocks that contain the syntax elements of the NC functions. With the HEIDENHAIN Klartext programming language, the control supports you by showing a dialog with information about the required content for every syntax element.
Related topics
- Creating a new NC program
- NC programs using CAD files
- Structure of an NC program for contour machining
Description of function
You create NC programs in the Editor operating mode in the Program workspace.
The first and last NC blocks of the NC program contain the following information:
- Syntax BEGIN PGM or END PGM
- Name of the NC program
- Unit of measure of the NC program (mm or inches)
The control automatically inserts the BEGIN PGM and END PGM NC blocks when creating the NC program. You cannot delete these NC blocks.
The NC blocks created after BEGIN PGM contain the following information:
- Workpiece blank definition
- Tool calls
- Approaching a safe position
- Feed rates and spindle speeds
- Traverse movements, cycles and other NC functions
NC programs contained in this User's Manual are suggestions for solutions. The NC programs or individual NC blocks must be adapted before being used on a machine.
Change the following contents as needed:
- Tools
- Cutting parameters
- Feed rates
- Clearance height or safe position
- Machine-specific positions (e.g., with M91)
- Paths of program calls
Some NC programs depend on the machine kinematics. Adapt these NC programs to your machine kinematics before the first test run.
In addition, test the NC programs using the simulation before the actual program run.
With a program test you determine whether the NC program can be used with the available software options, the active machine kinematics and the current machine configuration.
0 BEGIN PGM EXAMPLE MM | ; Start of program |
1 BLK FORM 0.1 Z X-50 Y-50 Z-20 | |
2 BLK FORM 0.2 X+50 Y+50 Z+0 | ; NC function for workpiece blank definition, consisting of two NC blocks |
3 TOOL CALL 5 Z S3200 F300 | ; NC function for tool call |
4 L Z+100 R0 FMAX M3 | ; NC function for straight-line traverse |
* - ... | |
11 M30 | ; NC function for ending the NC program |
12 END PGM EXAMPLE MM | ; End of program |
Syntax component | Meaning |
---|---|
NC block | 4 TOOL CALL 5 Z S3200 F300 An NC block consists of the block number and the syntax of the NC function. An NC block can consist of multiple lines, such as with cycles. The control numbers the NC blocks in ascending sequence. |
NC function | TOOL CALL 5 Z S3200 F300 You use NC functions to define the behavior of the control. The block number is not a part of the NC functions. |
Syntax initiator | TOOL CALL The syntax initiator clearly designates each NC function. Syntax initiators are used in the Insert NC function window. |
Syntax element | TOOL CALL 5 Z S3200 F300 Syntax elements are all parts of the NC function, such as technology values S3200 or coordinate information. NC functions also contain optional syntax elements. The control shows certain syntax elements in color in the Program workspace. |
Value | 3200 for spindle speed S Not every syntax element must contain a numerical value, such as tool axis Z. |
If you create NC programs in a text editor or outside of the control, note the correct spelling and sequence of the syntax elements.
Notes
- NC functions can also consist of more than one NC block, such as BLK FORM.
- Using the machine parameter linebreak (no. 105404), you can define how the control will display multi-line NC functions.
- Miscellaneous functions M and comments can be both syntax elements within NC functions as well as their own NC functions.
- Always write an NC program as if the tool were moving. This makes it irrelevant whether a head axis or a table axis performs the motion.
- The file name extension *.h designates a Klartext program.