Subroutines, Macros
2.2 Subroutines with SAVE mechanism
Programming
In the subroutine
PROC subroutine name SAVE
The SAVE attribute sets modal G functions to the same value at the end of subroutines that
they had at the beginning. If this action results in a change to the
G function group 8 (settable zero offset)
or
G function group 52 (frame rotations of a rotational workpiece)
or
G function group 53 (frame rotation in direction of tool),
then the relevant frames are restored.
• The active basic frame is not changed when the subroutine returns
• The programmable zero offset is restored
Parameters
The behavior of the settable zero shift and the basic frame can be changed using the
machine data MD 10617: FRAME_SAVE_MASK.
For more information on this, see
/FB1/ Function Manual Basic Functions; Axes, Coordinate Systems, Frames (K2), "Sub-
routine return with SAVE".
Example
Subroutine definition
PROC CONTOUR (REAL VALUE1) SAVE
N10 G91 ...
N100 M17
Main program
%123
N10 G0 X... Y... G90
N20...
N50 CONTOUR (12.4)
N60 X... Y...
In the CONTOUR subroutine G91 incremental dimension applies. After returning to the main
program, absolute dimension applies again because the modal functions of the main
program were stored with SAVE.
2-4
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Job planning