Fundamentals
Programming Manual, 10.2004 Edition, 6FC5 298-7AB00-0BP1
11-1
Subprograms and Repetition of Program Sections
11
11.1 Use of subprograms
Function
In principle, a subprogram has the same structure as a parts program. It consists of NC
blocks with traversing and switching commands. Basically, there is no difference between a
main program and a subprogram. The subprogram contains either machining operations or
sequences of operations that are to be performed several times.
0DLQSURJUDP
6XEURXWLQH
Parameters
M17 End of subprogram, return to the calling program.
RET
Subprogram end if continuous-path mode should not be
interrupted by retraction. RET must be programmed in a
separate block.
M30 The program end M30 set in the main program is evaluated
like M17 in the subprogram. This, therefore, enables a main
program to be called as a subprogram.