Macro Technique (Define - Siemens SINUMERIK 840D sl Programming Manual

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

2.19
Macro technique (DEFINE...AS)
2.19
Function
A macro is a sequence of individual statements, which have together been assigned a name
of their own. G, M and H functions or L subroutine names can also be used as macros.
When a macro is called during a program run, the statements programmed under the
program name are executed one after the other.
Use of macros
Sequences of statements that recur are only programmed once as a macro in a separate
macro module and once at the beginning of the program. The macro can then be called in
any main program or subroutine and executed.
Programming
Macros are identified with the keyword DEFINE...AS.
The macro definition is as follows:
DEFINE NAME AS <statement>
Example:
Macro definition:
DEFINE LINE AS G1 G94 F300
Call in the NC program:
N20 LINE X10 Y20
Activate macro
The macro is active when it is loaded into the NC ("Load" soft key).
Parameters
Caution
Keywords and reserved names must not be redefined with macros.
Use of macros can significantly alter the control's programming language! Therefore,
exercise caution when using macros.
DEFINE
NAME
AS
Statement
With macros you can define any identifiers, G, M, H functions and L program names.
Two-digit H and L functions can be programmed.
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Define macro
This is the name of the macro
STRING macro definition
Programming statements, e.g., G, M, H and L functions
Subroutines, Macros
2.19 Macro technique (DEFINE...AS)
2-41

Advertisement

Table of Contents
loading

Table of Contents