114
96-8000 Rev AC
May 2010
DO1;
<statements>
END1;
executes until the RESET key is pressed.
CAUTION! The following code can be confusing: WH [#1] D01;
END1;
In this example, an alarm results indicating no “Then” was found; “Then” refers
to the D01. Change D01 (zero) to DO1 (letter O).
G65 M
acro
S
UbroUtine
c
all
G65 is the command that calls a subroutine with the ability to pass arguments
to it. The format follows.
G65 Pnnnn [Lnnnn] [arguments];
Anything italicized in square brackets is optional. The G65 command requires
a P address corresponding to a program number currently in the control’s
memory. When the L address is used the macro call is repeated the specified
number of times. In Example 1, subroutine 1000 is called once without condi-
tions passed to the subroutine. G65 calls are similar to, but not the same as,
M98 calls. G65 calls can be nested up to 9 times, which means, program 1 can
call program 2, program 2 can call program 3 and program 3 can call program
4.
Example 1:
G65 P1000;
(Call subroutine 1000 as a macro)
M30;
(Program stop)
O1000;
(Macro Subroutine)
...
M99;
(Return from Macro Subroutine)
In Example 2, subroutine 9010 is designed to drill a sequence of holes along
a line whose slope is determined by the X and Y arguments that are passed to
it in the G65 command line. The Z drill depth is passed as Z, the feed rate is
passed as F, and the number of holes to be drilled is passed as T. The line of
holes is drilled starting from the current tool position when the macro subrou-
tine is called.
Example 2:
G00 G90 X1.0 Y1.0 Z.05 S1000 M03;
(Position tool)
G65 P9010 X.5 Y.25 Z.05 F10. T10;
(Call 9010)
G28;
M30;
O9010;
(Diagonal hole pattern)
F#9;
(F=Feed rate)
WHILE [#20 GT 0] DO1;
(Repeat T times)
G91 G81 Z#26;
(Drill To Z depth)
#20=#20-1;
(Decrement counter)
IF [#20 EQ 0] GOTO5;
(All holes drilled)
G00 X#24 Y#25;
(Move along slope)
Summary of Contents for 96-8000
Page 15: ...6 96 8000 Rev AC May 2010 Mill Warning Decals ...
Page 16: ...7 96 8000 Rev AC May 2010 Safety Lathe Warning Decals ...
Page 41: ...32 96 8000 Rev AC May 2010 ...
Page 93: ...84 96 8000 Rev AC May 2010 ...
Page 129: ...120 96 8000 Rev AC May 2010 ...
Page 133: ...124 96 8000 Rev AC May 2010 ...
Page 268: ......
Page 269: ......