Macroprogramming (# INIT MACRO TAB)

Macros permit the assignment of an alias name (macro name) to an executable NC code (macro content). The macro content may consist of arithmetic expressions and NC commands. The related NC code is executed whenever the corresponding macro name (macro call) is specified.

Macros support the generation of low-maintenance and clear NC programs. Changes need only be made once in the macro content.

Macros may only be configured in the channel parameter list [1]-1 and also defined in the NC program.

Syntax of a macro definition

"<macro name>" = "<macro content>"

<macro name>   name of the macro (alias)

<macro content>   executable NC code

A macro call is initiated by the macro name and can be combined in the same NC block with other NC commands.

Syntax of a macro call:

"<macro name>"

Programing Example

prg_example

macros

N10 "POSITION_1" = "X200 Y200 Z300"            (macro definition)

N20 "POSITION_2" = "X300 Y100 Z50"             (macro definition)

:

N200 "POSITION_1"    (macro call, X200 Y200 Z300 is executed)

:

N500 "POSITION_2"    (macro call, X300 Y100 Z50 is executed)

Release Note

release_note

As of Build V2.11.2010.02 replaces the command #INIT MACRO TAB the command #INIT MAKRO TAB. For compatibility reasons, this command is still available but it recommended not to use it in new NC programs.

The following command must be used

#INIT MACRO TAB

as an alternative. This command clears all macros previously defined in the macro table. The macros pre-assigned by the channel parameters [1]-1 are retained.