Subroutine call with M6 (P-CHAN-00118)


Subroutine call with M6


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] occurs.

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



Data type


Data range

Maximum 83 characters (application-specific)



Default value



Parameterisation example:

m6_prog_file tool_change1

* Note: The default value of variable is a blank string.