Rockwell Automation 8520 9/Series CNC Lathe User Manual

Page 282

Advertising
background image

Introduction to Programming

Chapter 10

10-14

Example 10.7

Subprogram Calls and Returns

MAIN PROGRAM

SUBPROGRAM 1

SUBPROGRAM 2

(MAIN PROGRAM);

(SUBPROGRAM 1);

(SUBPROGRAM 2);

N00010...;

N00110;

N00210;

N00020...;

N00120...;

N00220...M99;

N00030M98P1;

N00130M99;

N00040...;

N00140...;

N00050...;

N00150M30;

N00060M98P2L2;

N00070M30;

This path of execution results when you select the main program in

Example 10.7 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;

Advertising