# Subroutine call with M6 (P-CHAN-00118)

P-CHAN-00118 | Subroutine call with M6
Description | This parameter defines the name of a global subroutine which is called implicitly when M6 is detected in the NC program. In this case, M6 is not treated as a normal M function but becomes a global subroutine call analogous to 'L ...' This prevents a technological process from being triggered. M6 is always executed as the last action at block end.

If the parameter is not assigned or is not present in the channel parameter list, an M6 is processed as a normal M function.

In the NC program, the subroutine name can also be set by the command #FILE NAME [M6=“<prog_name>“]. The new subroutine name is then valid until program end M30 or until a further #FILENAME [M6=”<prog_name>”] [PROG].

Then after RESET or program start, the entry of the parameter in the channel parameters list is valid again.

Parameter | m6_prog_file
Data type | STRING
Data range | Maximum of 83 characters (application-specific)
Dimension | ----
Default value | *
Remarks | Parameterisation example: m6_prog_file tool_change1 * Note: The default value of variables is a blank string.