SIMPLE SUB ROUTINE EXAMPLE
I am is need of a simple sub routine example. I have an Fanuc o-t controller on a lathe.
I am machining a tube that will yield 4 parts from one tube.
I have written the program out to get the 4 parts but if I want to change something, the process of looking through the lines of prg can get me lost.
What i would like to do is move to my starting point and call the sub routine,
after it runs through, I would like to move the z to the face of the beginning of the next part and run the sub routine again.
The tube is 2. x 1. x 2.5 and each part will be .500 of used material per part.
Here is what I am thinking and if someone would like to add to the prg to correct it, please do.
%
o0100(main prg)
G28U0W0G99
T0101 S2000 M03 (OD TURNING)
G00 Z0. X2.05
M98 P1000
G00 Z-.5
M98 P1000
G00 Z-1.0
M98 P1000
G00 Z-1.5
M98 P1000
G00 Z-2.0
G98P1000
M30
%
N1000 (SUB)
G01 F.008 X.950
G00 Z.05 X1.990
G01 F.008 Z-.500
G28 U0 W0
T0303 (ID TURNING)
G00 Z.05 X1.050
G01 F.008 Z-.5
G00 X1.0
G00 Z.1
G28 U0 W0
T0505 (PARTING TOOL)
G00 X2.05 Z-.500
G01F.005 X.950
G00 X2.05
G28 U0 W0
T0101
M99
Thanking someone in advance,
Greg
Re: SIMPLE SUB ROUTINE EXAMPLE
%
o0100(main prg)
G28U0W0G99
G54
M98P1000
G55
M98P1000
G56
M98P1000
G57
M98P1000
G58
M98P1000
G28U0.W0.
T0101
M30
%
N1000 (SUB)
T0101 S2000 M03 (OD TURNING)
G01 F.008 X.950
G00 Z.05 X1.990
G01 F.008 Z-.500
G28 U0 W0
T0303 (ID TURNING)
G00 Z.05 X1.050
G01 F.008 Z-.5
G00 X1.0
G00 Z.1
G28 U0 W0
T0505 (PARTING TOOL)
G00 X2.05 Z-.500
G01F.005 X.950
G00 X2.05
G28 U0 W0
M99
I would write the main like this in order to keep the subroutine
in absoulute insead of incramental by moving work offsets
g55 would be .5 less than g54
good luck
rcs60
Re: SIMPLE SUB ROUTINE EXAMPLE
Thank you, I will give this a try.