Programming and Operating Manual (Milling)
6FC5398-4DP10-0BA1, 01/2014
111
The structure of a subroutine is identical to that of a main program (see Section "Program structure (Page 50)"). Like main
programs, subroutines contain
in the last block of the program sequence. This means a return to the
program level where the subroutine was called from.
The end instruction
can also be used instead of the M2 program end in the subroutine.
RET must be programmed in a separate block.
The RET instruction is used when G64 continuous-path mode is not to be interrupted by a return. With M2, G64 is
interrupted and exact stop is initiated.
See the following illustration for example of sequence when calling a subroutine twice:
The program is given a unique name allowing it to be selected from several subroutines. When you create the program, the
program name may be freely selected, provided the following conventions are observed.
The same rules apply as for the names of main programs.
Example:
It is also possible to use the address word
in subroutines. The value can have 7 decimal places (integers only).
With address L, leading zeros are meaningful for differentiation.
Example:
is not
or
.
These are three different subroutines.
The subroutine name
is reserved for tool change.
Subroutines are called in a program (main or subroutine) with their names. To do this, a separate block is required.
; Call subroutine LRAHMEN7