NC block structure
An NC block consists of a
- block number (optional)
- a number of words (NC commands)
- block end identifier
An NC block has a maximum length of 4000 characters.
The use of # commands (see Special functions) excludes the programming of other words in the NC block (except for the block number).
As a rule, each block begins with a block number consisting of an N character followed by a mathematical expression. This expression is mapped in the display data and rounded off as an integer.
The use of block sequences (SEQUENCE) and program jumps ($GOTO) requires the unambiguous and ascending programming of block numbers.
Otherwise, the block number is of no significance for program flow. In this case the block number does not even need to be programmed in ascending order.
Example of a block structure:
NC commands conforming to DIN 66025 need not be compulsorily separated by spaces or tabs. When programming text commands deviating from DIN (control block statements, special functions, etc.), the syntax requires separating characters which are also useful to structure an NC program.
Examples of an NC program structure:
without numbering % 100 "Block 1" "Block 1" "Block 1" . . . M30 | Partial numbering % 100 N10 "Block 1" "Block 2" N20 "Block 3" "Block 4" . . M30 | Complete numbering % 100 N10 "Block 1" N20 "Block 2" N30 "Block 3" N40 "Block 4" . . N700 M30 |
Words must be distinguished according to their significance into:
- Geometrical information (e.g. positions),
- Technological information (e.g. spindle speed, feedrate, clockwise spindle rotation),
- Information on program flow control (called control blocks such as counting loops),
- Arithmetic information (e.g. calculation of a variable, parameter calculation).
Several words may be in a block (exception: special commands from Section Special commands) whereby the processing sequence of control data within the block is defined by the controller. The programmer can then enter the individual words of an NC block in any order without this having any effect on processing. This programming manual contains special notes to point out exceptions.
The block end identifier normally consists of a combination of the control characters "CR” and "LF”.