O9943; //LINEAR FACING IF (#13==#0) GOTO 10; @81=#13; N10 #27=$1; #28=$3; #29=$7; #3=ABS(#5); IF (#6!=#0) GOTO 100; #6=@91; //default feed rate N100 F#6; IF (#20!=#0) GOTO 110; #20=@92; //default tool diameter N110 IF (#23!=#0) GOTO 120; #23=#20*@93*0.01; //default cut width N120 IF (#4!=#0) GOTO 130; #4=@96; //default cut depth N130 IF (#19!=0) GOTO 140; #19=@95; //default spindle speed N140 IF (#19>0) GOTO 150; //start spindle S-#19M04; GOTO 160; N150 S#19M03; N160 IF (@81<1.5) GOTO 170; #5=#9*COS(#10); //POLAR COORD DATA INPUT #6=#9*SIN(#10); GOTO 180; N170 #5=#9-#24; //CARTESIAN COORD DATA INPUT #6=#10-#25; #10=ATAN(#6,#5); //angle between line and X axis N180 IF (#1>=0) GOTO 190; #2=#10-90; //approach angle #1=-#1; //left hand side is going to be machined GOTO 200; N190 #2=#10+90 ; //right side is going to be machined N200 IF (#1>=#20*0.5) GOTO 230; #1=#20*0.5; N230 #31=#24-#1*COS(#2)-#3*COS(#10); #32=#25-#1*SIN(#2)-#3*SIN(#10); //(#31,#32) is starting point #5=#5+(#3+#3)*COS(#10); #6=#6+(#3+#3)*SIN(#10); #13=(#1-#20*0.5)/#23; //number of passes of cutting IF (#13!=FIX(#13)) GOTO 210; //check integer #13=#13-1; N210 #13=FIX(#13); IF (#13>=0) GOTO 250; #13=0; N250 #11=#23*COS(#2); #12=#23*SIN(#2); #15=#1-#13*#23-#20*0.5;//cut width smaller than W #17=#15*SIN(#2); #15=#15*COS(#2); //displacement smaller than #23 #18=#13; //backup counter value #16=#8/#4; IF (#16!=FIX(#16)) GOTO 220; #16=#16-1; N220 #16=FIX(#16); #19=#26; M08; N1000 IF (#16<0.5) GOTO 1500; G90G00Z@90; X#31Y#32; //start point of machining G04P10; //all G04P10 is used to as exact stop Z#19; G04P10; #19=#19-#4; G01Z#19; G91G01X#5Y#6; //cut from point #1 to #2 #13=#18; //counter initialization N1010 IF (#13<0.5) GOTO 1030; G91G01X#11Y#12; //approach target X-#5Y-#6; //cut from point #2 to #1 #13=#13-1; IF (#13<0.5) GOTO 1040; X#11Y#12; //approaches X#5Y#6; //cut from point #1 to #2 #13=#13-1; GOTO 1010; N1030 G91G01X#15Y#17; //cut width smaller than W X-#5Y-#6; GOTO 1020; N1040 G91G01X#15Y#17; //cut width smaller than W X#5Y#6; N1020 #16=#16-1; //machining in current plane is completed GOTO 1000; N1500 G90G00Z@90; X#31Y#32; G04P10; #26=#26-#8; Z#19; G04P10; G01Z#26; G91G01X#5Y#6; #13=#18; N1510 IF (#13<0.5) GOTO 1530 ; G91G01X#11Y#12; X-#5Y-#6; #13=#13-1; IF (#13<0.5) GOTO 1540; X#11Y#12; X#5Y#6; #13=#13-1; //machining from point #2 to point #1 GOTO 1510; N1530 G91G01X#15Y#17; X-#5Y-#6; GOTO 2000; N1540 G91G01X#15Y#17; X#5Y#6; N2000 G90G0Z@90; ;; M05; ;; M09; ;; X#24Y#25; G#27G#28G#29; M99; ;/**********************************************************************/ ;/* */ ;/* Modified on 1997-02-12 By Bing Shi Lee */ ;/* The timing when coolant turned off is changed. */ ;/* 1997-01-06 By Bing-Shi Lee */ ;/* */ ;/* This Macro O9941 performs LINEAR FACING */ ;/* */ ;/* Modification due on this version */ ;/* New input data d(#1) is defined indicating right side (#1>=0) or */ ;/* left side (#1<0) is going to be machined. */ ;/* Former version does not cut along along straight line at */ ;/* beginning. */ ;/* From now on, cuts along straight at beginning. After that, */ ;/* repeat approach and machining cycle. */ ;/* */ ;/* Input data includes: */ ;/* X1(#24), Y1(#25) : the coord of the first end point of straight */ ;/* line */ ;/* X2(#9), Y2(#10) : the coord of the second end point of straight */ ;/* line (if @81=1) */ ;/* : the distance and polar angle of the second */ ;/* end point (if @81=2) */ ;/* d(#1) : distance from starting point to the specified line */ ;/* if d>=0 means right side is going to be machined */ ;/* if d<0 means left side is going to be machined */ ;/* E(#5) : extension distance along each end of the straight */ ;/* line */ ;/* Z(#26) : the height where machining starts */ ;/* H(#8) : the depth of total cutting */ ;/* D(#4) : the cut depth of each cutting */ ;/* W(#23) : cut width of each machining */ ;/* */ ;/**********************************************************************/