Programming manual.
CNC 8070
STATEMENTS AND INSTRUCTIONS
22.
Programming statements
·417·
(REF: 1709)
22.1.17 Definition of macros
Macros may be used to define a program block or part of it with their own names in the format
"MacroName" = "CNCblock". Once the macro has been defined, programming
"MacroName" will be the same as programming "CNCblock". When executing a macro from
the program (or MDI), the CNC will execute its associated program block.
The macros defined via program (or MDI) are stored in a CNC table; this way, they are
available for the rest of the programs without having to define them again. This table is
initialized on CNC power-up and it can also be initialized from the part-program using the
#INIT MACROTAB instruction, thus deleting the macros saved.
#DEF:
Macro definition
Up to 50 different macros may be defined at the CNC. The defined macros may be accessed
from any program. When trying to define too many macros, the CNC issues the relevant error
message. The macro table may be initialized (erasing all the macros) using the instruction
#INIT MACROTAB.
The definition of the macro must be programmed alone in the block.
The programming format is as follows:
#DEF "MacroName" = "BloqueCNC"
Several macros may be defined in a block as follows.
#DEF "Macro1"="Block1" "Macro2"="Block2" ...
Definition of arithmetic operations in the macros.
When including arithmetic operations in the definition of a macro, the whole arithmetic
operation must be included.
Concatenating of macros. Including macros in the definition of other macros.
The definition of a macro can include other macros. In this case, one of the macros included
in the definition must be delimited with the \" characters (\"macro\").
Parameter Meaning
MacroName Name used to identify the macro in the program. It
may have up to 30 characters and consist of letters
and numbers.
CNCBlock Program block. It may be up to 140 characters long.
(Definition of macros)
#DEF "READY"="G0 X0 Y0 Z10"
#DEF "START"="SP1 M3 M41" "STOP"="M05"
(Execution of macros)
"READY" (same as programming G0 X0 Y0 Z10)
P1=800 "START" F450 (same as programming S800 M3 M41)
G01 Z0
X40 Y40
"STOP" (same as programming M05)
Correct definition of a macro.
#DEF "MACRO1"="P1*3"
#DEF "MACRO2"="SIN [\"MACRO1\"]"
The following macros are defined wrong.
#DEF "MACRO1"="56+"
#DEF "MACRO2"="12"
#DEF "MACRO3="\"MACRO1\"\"MACRO2\""
#DEF "MACRO4"="SIN["
#DEF "MACRO5"="45]"
#DEF "MACRO6="\"MACRO4\"\"MACRO5\""