K1: Mode group, channel, program operation, reset response
9.15 Replacing functions by subprograms
Basic Functions
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
645
Example 4
The functions T and M6 are replaced by the subprogram "MY_T_CYCLE".
The parameters are transferred to the subprogram when replacing M6.
If M6 is programmed together with D or DL in the block, the D or the DL number is also transferred as parameter
to the subprogram if no transfer of the D/DL number has been parameterized:
MD10719 $MN_T_NO_FCT_CYCLE_MODE = 1
Parameterization
Main program
9.15.2.5
Example: Replacement of a T and D function
The functions T and D are replaced by calling the subprogram "D_T_SUB_PROG". The following should also be
true for the example:
• The tool change is realized with address T.
• The subprogram is called at the start of the block.
• The tool management is not active.
• Axis B is an indexing axis with Hirth gearing.
Parameterization
Configuration
Meaning
MD22550 $MC_TOOL_CHANGE_MODE = 1
Tool change with M function
MD22560 $MC_TOOL_CHANGE_M_CODE = 6
M code for tool change
MD10715 $MC_M_NO_FCT_CYCLE[3] = 6
M function to be replaced
MD10716 $MC_M_NO_FCT_CYCLE_NAME[3] = "MY_T_CYCLE"
Replacement subprogram for
the M function
MD10717 $MN_T_NO_FCT_CYCLE_NAME = "MY_T_CYCLE"
Replacement subprogram for
the T function
MD10718 $MN_M_NO_FCT_CYCLE_PAR = 3
Parameter transfer to the
replacement subprogram for
M6
MD10719 $MN_T_NO_FCT_CYCLE_MODE = 1
No transfer of the D/DL number
Program code
Comment
N410 D1
N420 G90 G0 X100 Y100 Z50
; D1 is active.
N330 D2 X110 Z0 T5 M6
; D1 remains active, D2 and T5 are transferred to
the M6 replacement subprogram as variable.
Machine data
Meaning
MD11717 $MN_D_NO_FCT_CYCLE_NAME = "D_T_SUB_PROG"
Replacement
subprogram
for D function