I just looked around a little bit and noticed I'm missing the "%" on O00024 program. Hope that's not all it is...
Hi guys, I'm doing research on micro drilling in shape memory alloys, and I'm trying to get a macro working that will vary the pecking increment based on a formula that uses the tool's diameter and the hole depth.
The main program (O00023) runs fine up until the point where it calls the macro O00024. The mill I'm using is a Haas OM2, and when I copy the code from my USB to the machine, it doesn't seem to "understand" what any of the variables mean. For example, the line:
WHILE[#2 GT #3]DO1;
becomes commented out like this:
(WHILE[#2 GT #3]DO1?)
Is there something wrong with the way I have this coded, or is possible that this machine's controller is not capable of running macros? How can I check this?
I appreciate any help! Thanks.
-Stephen
Here's the code in question:
%
O00023
( Stephen - Drilling Program )
(created 06/22/11)
N35 G00 G17 G21 G40 G90
(STANDARD START-UP SETTINGS)
N45 T1
(IDENTIFIES TOOLING)
N50 G55 G00 X0. Y0. Z1.
(MOVES MACHINE TO STARTING COORDINATES)
(COORDINATES SET IN LINE G55 IN OFFSETS)
(MUST SET ZEROES ON UPPER LEFT CORNER OF PART)
N55 G43 H01
(CALLS OUT TOOL LENGTH COMPENSATION)
N60 S30000 M03
(SETS SPINDLE SPEED AND TURNS ON CLOCK-WISE)
N70 G65 P00024 L10 A0.1 B0.0 C-0.75 D0.2 I0.4 J3.0
(G65 CALLS FOR MACRO)
(L10 --> NUMBER OF TIMES TO REPEAT MACRO)
N75 G90 G55 X0. Y0. Z5.
(RETURNS TOOL TO START POSITION)
N80 M30
(ENDS PROGRAM)
%
O00024;
( Stephen - Drilling Macro)
(created 06/22/11)
WHILE[#2 GT #3]DO1;
(Pecking Loop Start)
#6=#2-#4;
(Current Peck Depth)
IF[#6 LT #3]THEN #6=#3;
(Sets Peck Depth to Final Depth if it overshoots)
G00 Z#2+0.2;
(Stands off 0.2 mm)
G01 Z#6 F#5;
G00 Z#1;
#2=#2-#4;
(Resets Hole Depth for next pass)
#8=-1.0*#6/#7;
(Defines aspect ratio)
#4=#7*[-1.5*#8+19.5]/9;
(Sets new peck increment)
END1;
(Pecking Loop End)
G91 X0.2 F200.
(MOVES INCREMENTAL DISTANCE IN X DIRECTION)
(NOT DEPENDENT UPON COORDINATES)
M99;
(RETURNS TO MAIN PROGRAM)
I just looked around a little bit and noticed I'm missing the "%" on O00024 program. Hope that's not all it is...
I am not up to par on the Haas syntax but calling a macro and using a local variable of "L" when there is not one that I know of may be causing your problem.
IIRC the "L" for number of times to repeat is used with the M98 subcall and can not be used with a macro call of G65.
Stevo
Hmm, if I remember right the sample in the manual I was looking at used L to loop, but I'll check on it.
See the attachment for more information about G65.
I stand corrected. I thought that you could only use the L() for repetition only with the M98 call and not the macro call.
Thanks for the info Sinha.
Stevo
It sounds like the original poster's Haas mill doesn't have macro language enabled.
If I remember right, you can turn it on and get 500 hours free. After that, you have to write a check to Haas.
Frederic
[URL="http://www.pure-geometry.com/"]Pure Geometry LLC[/URL]
Vertical Lathe tool holders and more.
You could very well be right Fred. It does seem to appear that way. I am not familiar with what happens in the Haas when trying to use this option when it is not installed. Another thing to try is to program in MDI #1=1. And try to run it and see if you get an alarm.
Stevo