Subroutine call with D word (P-CHAN-00429)


Subroutine call with D word


This parameter defines the name of a global subroutine which is called implicitly if a D word is detected in the NC program. A separate subroutine can therefore be specified for each NC channel.

The global subroutine call is always executed as the last action at block end. This subroutine executes tool-specific settings.

If a D word is implicitly executed after a T selection (P-CHAN-00014: einrechnen_mit_t=1), the subroutine is also called by a T word.

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

If the parameter is not assigned or is not present in the channel parameter list, a D word is executed without subroutine call.

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



Data type


Data range

Maximum of 83 characters (application-specific)



Default value



This parameter is available as of CNC Build V3.1.3066.03 and higher.


Parameterisation example:



Programming example:


N10 D127                                    ;Call

N20 #FILE NAME [D=“]       ;Define new subroutine

N30 D128                                   ; Call


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