3 subprogram nesting – Rockwell Automation 8520-GUM 9/Series CNC Grinder Operation and Programming Manual Documentation Set User Manual
Page 293
![background image](/manuals/580089/293/background.png)
Introduction to Programming
Chapter 10
10-15
Example 10.8
Subprogram Calls and Returns (continued)
The following path of execution results when the main program above is
selected as the active program.
(MAIN PROGRAM);
N00010...;
N00020...;
N00030M98P1;
(SUBPROGRAM 1);
N00110;
N00120...;
N00130M99;
N00040...;
N00050...;
N00060M98P2L2;
(SUBPROGRAM 2);
N00210;
N00220...M99;
(SUBPROGRAM 2);
NOO210;
N00220...M99;
N00070M30;
We use nesting as the term to describe one program calling another. The
program called is said to be a nested program. When you call a
subprogram from the main program, it is said to be on the first nesting
level or nesting level 1. If that subprogram in turn calls another
subprogram, the called subprogram is said to be in nesting level 2.
Subprograms can be nested up to a maximum of 4 levels.
10.3.3
Subprogram Nesting