Hello chaps
After the earlier posting i thought i should post the code for the experts to have a look at
I have marked the line in the subroutine where it always changes the f value
Here it is
% filename is :- simple boresinglecut.tap
% program number:- 01001 (program number -put at start of program)
% Program name :- simple boresinglecut.tap
% Program description:- Makes a single cut in the bore according to parms set
% SETUP STRING (INITIALIZATION)------
% make sure to home the machine first then to reference x and z positions
m05 (stop the spindle)
g18 (xz plane)
g21 (feed in mm)
g40 (g49)
g95 (feed per rev mode set on)
%G80 (cancel motion mode)
%g96 (CSS control)
s1400 (CSS cancel and set speed to 1400)
%g61 (exact stop mode)
g64 (constant velocity mode)
f.1 (feed .1 per rev)
g028 (go to home position)
% -- setting up parms-------------------------
#1=27.0 (bore start dia)
#2=-38 (end of z cut notice the minus !!)
#10=.5 (first diameter on bore x axis)
#11=4 (second diameter on bore x axis)
#20=4.5 (first cut length on z axis)
#21=9 (second cut length on z axis)
#22=42 (third cut on length z axis)
m04 (start spindle forwards)
m98 p1 l3 (run sub no 1 5 times)
% ---- program shutdown starts----
m09 (water off)
m5 (stop spindle)
m30 (end program and rewind m2 will also end program)
% ----------this is the end of the program --
O01 (subroutine #1 starts)
g0z19 (start to clear front of boring bar)
g0x#1 (START cut X axis)
g0z1 (move z closer) ********this is where it always changes the feedrate
g01 x#1 z-5 (cut in 5 mm for the location)
g01 x[#1-#10] z-9 (bore first taper)
g01 x[#1-#11] z-39 (bore second taper)
g0 x[#1-#11-1]z-38 (back off quickly)
m 05 g0z50 (stop spindle move tool out of the way for measuring)
g0x#1 (put tool back to show size on dro)
%m00 (msg,stop and measure then press cycle start)
m04 (start spindle again)
#1=[#1+2] (add 2mm on dia parm )
m99 (this is end of sub 01)
% LEAVE THIS % TO MARK END OF FILE