2
Subprograms, Macros 12.98
2.13 Macros
2
840D
NCU 571
840D
NCU 572
NCU 573
810D 840Di
ï›™
Siemens AG 2000. All rights reserved
2-120
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
Programming example
Example of macro definitions.
DEFINE M6 AS L6
On gear change, a subroutine is called to handle care of data
transfer. The actual tool change M function is output in the
subprogram (e.g. M106).
DEFINE G81 AS DRILL(81)
Emulation of the DIN G function
DEFINE G33 AS M333 G333
During thread cutting synchronization is requested with the PLC.
The original G function G33 was renamed to G333 by machine
data so that the programming is identical for the user.
Example of a global macro file:
After reading the macro file into the control, activate
the macros (see above). The macros can now be
used in the part program.
%_N_UMAC_DEF
;$PATH=/_N_DEF_DIR; customer-specific macros
DEFINE PI AS 3.14
DEFINE TC1 AS M3 S1000
DEFINE M13 AS M3 M7
;Spindle right, coolant on
DEFINE M14 AS M4 M7
;Spindle left, coolant on
DEFINE M15 AS M5 M9
;Spindle stop, coolant off
DEFINE M6 AS L6
;Call tool change program
DEFINE G80 AS MCALL
;Deselect drilling cycle
M30
;
•
Vocabulary words 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.
•
Macros can also be declared in the NC program.
Only identifiers are permissible as macro names.
G function macros can only be defined in the
macro block globally for the entire control.
•
With macros you can define any identifiers, G, M,
H functions and L program names.
•
Macro identifiers with 1 letter and
1 digit are permissible (FM-NC only).