Programming instructions
 ADT-CNC4620 Programming Manual 
- 8 - 
1.9. Main program and subroutine 
To simplify the programming, if same or similar processing track and control process need to be 
used for several times, the program instructions of this part can be edited to independent program 
for calling. The program that calls other programs is called as main program, and the program being 
called (ended with M99) is called as subroutine. Both subroutine and main program occupy system 
capacity and storage space. Subroutine also must have independent program name, and can be 
called by any other main proram or run independently. When subroutine ends, it returns to the main 
program and continues the execution. The system supports nine layers nesting, i.e. a subroutine can 
call other subroutines, as shown in Fig. 1-9 below. 
 Call   Return 
 Main program  Subroutine 
Fig. 1-9 










