[CODE]050815-1532 EST USA
A sample tool change macro.
Following is a tool change macro that I use on HAAS machines.
The O6901 can be any O-number you choose. Whatever number you use must be used in the calling program.
This macro will not work on our 1993 machine because variables are not allowed for P in the G10. A much more complicated macro is required to accomplish the same result and allow no modification in the calling program.
For your reference on alpha to # addresses see the HAAS manual under MACROS the section on Alphabetic Addressing.
The calling line looks like
G65 P6901 E54 R 0.250 S 7500 T07 D07 ( call tool chg sub )
where
G65 is the call to external subroutine P6901.
E54 --- The E maps to variable #8 in the subroutine and
....... 54 specifies the coordinate system. You will see
....... G#8 in the fourth row of the subroutine.
R 0.250 The R maps to variable #18 in the subroutine and
....... 0.250 provides the cutter diameter for G10 L12 to load.
S 7500 -The S maps to variable #19 in the sub and
....... 7500 provides the value for spindle speed.
T07 --- The T maps to #20 in the sub and
....... 07 provides the value for the next tool.
D07 --- The D maps to #7 in the sub and
....... 07 provides the value for cutter comp address.
....... Used with P in the G10 L12, and D in G43.
Depending on your normal useage and how offsets are used may require
modifications to this subroutine.
Also there are people that do not like this general approach.
The reason I like it is that all pertinent parameters are on one easily read line and entered only once. In particular the #7 variable, and the #20. This reduces errors.
We have setting 33 Fanuc, 40 dia, 58 Fanuc, 49 ON (skip same tool change).
Note that by changing the value for R but using the same tool we change from roughing to finishing.
%
O6901
(Beta TOOL CHANGE macro subroutine 981212-1750)
G10 G90 L12 P#7 R#18
G80 M09
G90 M06 T#20
G#8 M08
S#19 M03
G43 H#20 D#7
M99
A sample calling program:
O3002
(BRAD_2.CNC Date-time created 08-14-2005 11:13:20)
(Beta prog 981226-1009 )
(**** TOOL Change to Mill Roughing **** --->1 IDM12R HAAS TL # 7 )
G65 P6901 E54 R 0.250 S 7500 T07 D07 ( call tool chg sub )
G0 X -0.4000 Y 2.3000
Z 0.1000
F 60.0 G1 M97 P 11 Z -0.1300
G90 G0 Z 0.1000
(**** TOOL Change to Mill Finishing **** -->2 IDM12F HAAS TL # 7 )
G65 P6901 E54 R 0.248 S 7500 T07 D07 ( call tool chg sub )
G0 X -0.4000 Y 2.3000
Z 0.1000
F 20.0 G1 M97 P 11 Z -0.1300
G90 G0 Z 0.1000
(**** TOOL Change to Mill Finishing **** -->3 IDM12F HAAS TL # 8 )
G65 P6901 E54 R 0.060 S 7500 T08 D08 ( call tool chg sub )
G0 X -0.4000 Y 2.3000
Z 0.1000
F 20.0 G1 M97 P 11 Z -0.0300
G90 G0 Z 0.1000
M09
M05
G90 G0 G53 Z0
G53 X-15.0 Y0
M30
(This file BRAD_2.SUB Date-time created 08-14-2005 11:13:20)
(Program 981226-1009 CNC_H4.BAS, .EXE QB45)
N 11
G1 G41 X -0.4000 Y 2.0000
G1 X -0.1000 Y 1.8750
G1 X 6.7500 Y 1.8750
G1 X 6.7500 Y 0.0000
G1 X 0.0000 Y 0.0000
G1 X 0.0000 Y 2.0000
G1 G40 X 0.0000 Y 2.2000
M99
%[/CODE
Unfortunately the preview format does not correspond with actual format.
.]