The subprogram with the program name SUB_PROG can be started using the following
identifiers:
1. SUB_PROG
2. _N_SUB_PROG
3. SUB_PROG_SPF
4. _N_SUB_PROG_SPF
Main programs and subprograms with the same name
If a main program (.MPF) and a subprogram (.SPF) exist with the same program name, the
appropriate file extension for the unique identification must be specified when the program
name in the NC program is used. Otherwise the program found first in the search path with the
specified name is used.
3.2.1.3 Nesting of subprograms
A main program can call subprograms which in turn call more subprograms. As such, the
sequences of the programs are nested within each other. Each program runs on a dedicated
program level.
Nesting depth
The NC language currently provides 16 program levels. The main program always runs at the
uppermost program level, 0. A subprogram always runs at the next lowest program level
following the call. Program level 1 is, therefore, the first subprogram level.
Division of program levels:
● Program level 0: Main program level
● Program level 1 to 15: Subprogram level 1 to 15
...
...
0DLQ
SURJU
6XE
SURJU
6XE
SURJU
6XE
SURJU
3URJUDPOHYHOVPD[
Work preparation
3.2 Subprogram technique
NC programming
492 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0