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
- Macro name and macro content must be enclosed in inverted commas “...”.
- The macro name makes a distinction between uppercase and lowercase letters.
- The redefinition of predefined macros is configurable [6]-6.39.
- Macro definition remain valid after program end (M30) or CNC reset. They are usable until the next controller start-up or #INIT MACRO TAB.
- Macro definitions that were configured in the channel parameter list cannot be deleted by #INIT MACRO TAB.
- The maximum number of macro definitions [6]-6.25 and their length [6]-6.37/-6.38 as fixed. The values are settable as of Builds V3.1.3079.17 and V3.1.3107.10:
- Maximum number of macros P-CHAN-00509
- Maximum number of predefined macros P-CHAN-00510
- Maximum number of characters in macro name P-CHAN-00511
- Maximum number of characters in macro content P-CHAN-00512
- Macro definitions and other NC commands can be combined in the same NC block.
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

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

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.