Subroutines, Macros
2.5 Parameterized subroutine return (RET)
Job planning
2-14 Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
2.5 2.5 Parameterized subroutine return (RET)
Function
Usually, a RET or M17 end of subroutine returns to the calling program and execution of the
parts program continues with the lines following the subroutine call. However, some
applications may require program resumption at another position:
• Continuation of execution after call-up of the cutting cycles in ISO dialect mode, after the
contour definition.
• Return to main program from any subroutine level (even after ASUB) for error handling.
• Return over two or more program levels for special applications in compile cycles and in
ISO dialect mode.
Programming
RET (<blocknumber/label>, <block after block with
blocknumber/label>,
<number of return levels>), <return to program start>)
or
RET (<block_number/label>, < >, < >)
or subroutine return over several levels
(return to the specified number of subroutine levels).
RET (, , <number of return levels>, <return to program start>)
Parameters
The parameterizable command RET can fulfill these requirements of the continuation or the
return with 4 parameters:
1. <block_number/label>
2. <block after block with block number/label>
3. <number of return levels>
4. <return to beg. of program>