What's new
What's new

subprograms and multiple work offsets

AlbertRaczynski

Plastic
Joined
Aug 14, 2007
Location
Gilberts, IL
Hello everyone,
I had a question that maybe some of you could help me answer. I know there is a way to do what I want to do, just have not yet had to do it, so I could use some help implementing this. What I am trying to do is setup multiple parts in my machine, say 4 parts. Each part will have its own work offset, ie G54 G55 G56 G57... etc. Rather than copy each operation and post it 4 times in my program (for each work offset this will be many lines of code, taking up more memory) I would like to do a subroutine call.
For instance:
1st operation uses tool 1 and comes down to face the part.
Rather than going to my next operation, and next tool, I would like to and the end of the first operation use a subroutine call, to jump to the beginning of the 1st operation and bumps the work offset to the next one (G55) and repeats the process until I tell it to break out of the 'loop' or subroutine. Upon which it will switch to the next tool and repeat the operation 4 times for each work offset.

Am I making myself clear enough? Could anyone offer me some advice on the actual syntax to implement this?
 
Haas

Hi,
I do multiple parts with multiple work coordinates.
I use a local subroutine M97 P1000, you can put the program after M30 using N1000 then your program ending in M99.
4 Parts go like this.

T0101
G0G54 X0.Y0.S3000M3
G43Z.05H1M08
M97P1000
G0G55X0.Y.0
M97P1000
G0G56X0.Y0.
M97P1000
G0G57X0.Y0.
M97P1000
G0Z3.00
M01
T0202
SAME AS ABOVE BUT USE M97P2000


M30

N1000
G1Z-.5F10.0
X??Y???
X???
Y???
G0Z.050
M99
N2000
G1Z-.5F10.0
X???
Y???
G0Z.050
M99

JUST USE THE HAAS COPY AND ITS EASY TO DO.
I HOPE THIS ANSWERED YOU QUESTION.

Don
 
I do the same as Hi-Point except I exclude the G0 before the G55, G56 Etc. and also leave out the "X", "Y" moves afterwards. Saves typing which is time.

Best Regards,
Russ
 
Actually, if you include all your clearance moves in your subroutine, then all you need is

G54
M97 P1000
G55
M97 P1000
G56
M97 P1000
etc etc.
M30
N1000
G00 X0 Y0 Z1.
all your motions here
G00 Z1.
M99
%

Not only does it reduce typing, it also allows single place editing.
 
Actually, if you include all your clearance moves in your subroutine, then all you need is

G54
M97 P1000
G55
M97 P1000
G56
M97 P1000
etc etc.
M30
N1000
G00 X0 Y0 Z1.
all your motions here
G00 Z1.
M99
%

Not only does it reduce typing, it also allows single place editing.

Exactly as Seymour does it.

If you can get some results there have been some good threads on this in the past.


One of the benefits of this type of programming is that once the code is good for one part it is good for them all. If you got to make a change it is only made in one spot.

....

Now too bad so sad that Fanuck does not us M97. :willy_nilly:
 
so it looks like you define the work coordinate systems first, and designate the function call by using Pxxxx and mark the beginning of the code with Nxxxx? Does this make sense / sound right? I think I get it.
 
Wow, ok I feel quite retarded now. Totally figured this out in about 5 minutes. You guys rock for helping me out! I will owe you all beers at some point in time.
 
Wow, ok I feel quite retarded now. Totally figured this out in about 5 minutes. You guys rock for helping me out! I will owe you all beers at some point in time.

Don't feel like a retard. Go out and have fun with G5xs and Subs.:cheers:

Now take a look at the fun you can have with G52.:D

G52 is your friend.
 
Here is something I didn't know could be done. I call the drill cycle then call the hole location sub N1610, then G52 program zero shift, then call hole location sub ect. all while still in the canned cycle. G80 turns it off after drilling 6 different parts 5" wide in 'X' and 3" wide in 'Y' . The L0 in the canned cycle inhibits the cycle until the next set of 'X' -'Y' values are found in the sub. I have only tested this on our Haas simulator.

I agree G52 is your friend!!

%
O5555 (TEST G52 ZERO SHIFT)
N10 (WRITTEN 10-22-2008 09:26:05)
N20 (MODIFIED 10-23-2008 09:37:19)
N30 ( TOOL #1 IS A NO. 7 DRILL )
N40 G53 G00 Z0. ( RESTART TOOL #1 HERE )
N50 G53 G00 X-20. Y0.
N60 T1 M06
N70 S1234 M03
N80 G54 G00 G90 X1. Y1.
N90 G43 Z0.25 H1 D1 M08
N100 G81 G98 R0.1 Z-0.25 F6. L0 (Call Drill Cycle)
N110 M97 P1610
N120 G52 X5.
N130 M97 P1610
N140 G52 X10.
N150 M97 P1610
N160 G52 Y3.
N170 M97 P1610
N180 G52 X5.
N190 M97 P1610
N200 G52 X0.
N210 M97 P1610
N220 G80 (Exit Drill Cycle)
N230 G52 X0. Y0.
N240 G53 G00 Z0. M09
N250 G53 G00 X-20. Y0.
N260 M01 ( OP STOP )
N270 ( TOOL #2 IS A .25-20 TAP )
N280 G53 G00 Z0. ( RESTART TOOL #2 HERE )
N290 G53 G00 X-20. Y0.
N300 T2 M06
N310 S1234 M03
N320 G54 G00 G90 X1. Y1.
N330 G43 Z0.25 H2 D2 M08
N340 G84 G98 R0.1 Z-0.25 F50. S1000 L0 (Call Tap Cycle)
N350 M97 P1610
N360 G52 X5.
N370 M97 P1610
N380 G52 X10.
N390 M97 P1610
N400 G52 Y3.
N410 M97 P1610
N420 G52 X5.
N430 M97 P1610
N440 G52 X0.
N450 M97 P1610
N460 G80 (Exit Tap Cycle)
N470 G52 X0. Y0.
N480 G53 G00 Z0. M09
N490 G53 G00 X-20. Y0.
N500 M30 ( END OF MAIN PROGRAM )
N1610 (NO. 7 DRILL / .25-20 TAP)
N1620 X1. Y1.
N1630 X2. Y1.
N1640 X3. Y1.
N1650 X4. Y1.
N1660 X4. Y2.
N1670 X3. Y2.
N1680 X2. Y2.
N1690 X1. Y2.
N1700 M99
%
 








 
Back
Top