Nesting macros

The use of macros on the right-hand side of the instruction (so-called Nesting) is permitted in combination with NC code. The maximum nesting depth is fixed [6]-6.40.

Nesting is displayed by a '\' character that precedes the delimiting quotation marks. A macro should always represent complete expressions of an NC block (NC command, mathematical expression, term). This excludes the possibility of a macro only represented by the address letter of an NC command without the related mathematical expression. This connection will be discussed in the next sections.

"<Macro_name>" = "<NC_Code> \"< Macro_name_i> \" <NC_Code>



A macro may not be called by its own nested macro name. Only nesting of other macro names is permitted.

Programing Example


Nesting macros

Example 1:

N10 "POS_1" = "X500 Y200"            (Macro definition)

N20 "MOVE1" = "G01 \"POS_1\" F1000"  (Macro definition with nesting)

N30 "MOVE1"                          (Macro call)


Example 2:

N10 " STRING_1 " = " 5*12 "          (Macro definitions)

N20 " STRING_2 " = " G \"STRING_1\" + 5 "

N30 " STRING_3 " = " M \" STRING_1\ " \" STRING_2 \" "


N200 " STRING_3 "                    (Call the nested macro)

:                                    (Corresponds to: N200 M60 G65        )