2-160 MACHINE OPERATIONS OPERACIONES DE MECANIZADO
<Program calling a macro program>
<Llamada de un programa a un programa de macro>
O0002;
G00 T0101;
G97 S1000 M03;
G00 X100.0 Z200.0 M08;
G65 P9100 Z50.0 K20.0 F0.3; . . . . . . . . . . . . . . Macro program call Llamada a programa de macro
G00 X100.0 Z200.0 M05;
M30;
<Macro program (program to be called)>
<Programa de macro (programa que se llamará)>
O9100;
#1=0; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Clears the data for the depth of
the current hole.
Borra los datos para la profundidad
del orificio actual.
#2=0; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Clears the data for the depth of
the preceding hole.
Borra los datos para la profundidad
del orificio anterior.
IF [#23 NE #0] GOTO 1; . . . . . . . . . . . . . . . . . . . In case of incremental
programming, jumps to N1.
En caso de programación
incremental, salta a N1.
IF [#26 EQ #0] GOTO 8; . . . . . . . . . . . . . . . . . . . If neither Z nor W is specified,
an error occurs.
Si no se especifica ni Z ni W, se
producirá un error.
#23=#5002−#26; . . . . . . . . . . . . . . . . . . . . . . . . . Calculates the depth of the
hole.
Calcula la profundidad del orificio.
N1 #1=#1+#6; . . . . . . . . . . . . . . . . . . . . . . . . . . . Calculates the depth of the
current hole.
Calcula la profundidad del orificio
actual.
IF [#1 LE #23] GOTO 2; . . . . . . . . . . . . . . . . . . . If overcut occurs, jumps to N2. Si se produce un corte excesivo,
salta a N2.
#1=#23; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Clamps at the depth of the
current hole.
Se mantiene a la profundidad del
orificio actual.
N2 G00 W−#2;. . . . . . . . . . . . . . . . . . . . . . . . . . . Moves the tool to the previous
depth at a rapid traverse rate.
Desplaza la herramienta a la
profundidad anterior a una
velocidad de avance rápido.
G01 W−[#1−#2] F#9; . . . . . . . . . . . . . . . . . . . . . . Drills the hole. Realiza la perforación del orificio.
G00 W#1; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Returns the tool to the drilling
start point.
Devuelve la herramienta al punto
de inicio de la perforación.
IF [#1 GE #23] GOTO 9; . . . . . . . . . . . . . . . . . . . Checks whether drilling is
completed.
Comprueba si se ha finalizado la
perforación.
#2=#1; . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Stores the depth of the current
hole.
Almacena la profundidad del
orificio actual.
N9 M99;. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Returns to the program that
called the macro program.
Vuelve al programa que llamó al
programa de macro.
N8 #3000=1 (NO Z OR U COMMAND); . . . . . . . Issues an alarm. Emite una alarma.
For details on macro statements, refer to the
instruction manual supplied by the NC manufac-
turer.
Para obtener mayor información sobre las macro-
sentencias, consulte los manuales de instruccio-
nes suministrados por el fabricante de la unidad
de CN.