You are on page 1of 50
CUSTOM MACRO SAMPLE PROGRAMMING {SECOND EDITION) SEB4-004E Contents Page INTRODUCTION Seb eeneeeeeeeneeenees 1 PRECAUTIONS WHEN USING . x MACRO CALL WITH G CODE , 2 ALARM DISPIAY .......004 é FUNCTION USED IN MACRO PROGRAM . 5 MACRO PROGRAM... sees eas ‘i 10 M-l True circle cutting (type 1) = 09100 10 M-2 True circle cutting (type IT) - 09110 13 M-3_ Deep cutting of circuit pocket - 09120 - 16 M-4 Fish cutting inside of square - 09130 ~ 20 M-5 Deep cutting of square pocket - 09140 - . 24 M-6 Bolt hole circle - 09150 - . aaa: M7 Special deep hole cycle (A) = 09180 - ...... 33 M-8 special deep hole cycle (B) = 09190, 09200 ~ 36 M-9 Reamer cycle - 09291, 09290 - 39 M-10 Matrix machining ={09220) es sascnnoeie (42 VARIABLE LIST 40.0 .cscseceseeesees Z ay ee er 2. 2.3 2.4 INTRODUCTION ‘ This manual describes sample programming for machining such as circular cutting, or square cutting by use of the custom macro B optionally available in FANUC SYSTEM 6M-MODEL B. ‘This manual describes so that the user can create the custom macro. For detailed description on the custom macro, refer to the section on Custom Macro in the Operator's manual for FANUC SYSTEM 6M-MODEL B. Necessary option: Custom macro B Tape length of this Program (M-1 - M-10): Approx. 15m PRECAUTIONS: WHEN USING When punching this program in a tape, use the 180 code. Also, pay attention to the parenthesis. and brace, alphabet 0 and numeric 0. ‘The mark at the head of program means the alphabet 0, the Parenthesis indicates the comment and the alarm message, "0" of DO and 60TO is alphabet 0. As a rule, the system does not judge whether the data is negative or positive in the argument specification. therefore, specify the data by positive values, except for the absolute coordinate values. ‘The argument indicated by a black triangle at the right corner like cannot be omitted in the command format. If it is omitted, alarm No.’ 140-is: indicated. When the feedrate F is omitted, the previously specified modal F code is used. However, specify it as much as possible. Generally, the argument is specified together with decimal point. When the decimal point is omitted, its position becomes as shown below. Address MM programming INCH programming a,c B (without B 3-digit option) B (with B 3-digit option) DH E, F (in G94 mode) B, F (in G95 mode) 1, 3,8 M, S, T oR u,v, w X,Y, 3 3 o 0 0 2 3 0 5 3 3 (2) 3 (2) (2 a 3) (2) (2) (2) (2) 2.5 ‘The numerics indicates the position of the least significant digit. ‘The values in parentheses indicate the decimal point when parameter FMIC#1 in decimal point as counted from number of digits below the the cases of address E and F, and when parameter MIC=1 in the cases of the other addresses. For the correspondence between the address of argument specification and the number of local variable, see Section 7. MACRO CALL WITH G CODE Normally, the macro is called with the format of "G6SP program number argument specification;". “Gxxx argument specification; Tt can also be called in the format of In this case, it is necessary to set the correspondence between the G code xxx for macro call and the Program number A\AA of the called macro at the parameters as listed below. The procedure is described below. i 44) iii) Change the program number of the used macro to 69010 - 69019. Set the G code numeric at the parameter corresponding to the Program number. Change the call command format to "G numeric set at parameter argument specifications". Note 1: ‘Though G01 - G255 can be used as the G codes, use G100 - G119 Note as much as possible. ‘This method cannot be used for programs M-7, M-8 and M-9 using G66 (modal macro call). 323 | G code calling program 09010 Example: 324 | G code calling program 09011 | (Call true circle cutting program 325 | G code calling program 09012 9100 by G112.) 326 | G code calling program 69013 327 | @ code calling program 69014 | Change the program number to 59012, 328 | G code calling program 09015 | 329 | G code calling program 09016 Set 112 at parameter 325. 330 | G code calling program 09017 { 331 | @ code calling program 9018 | Command format: 332 |G code calling program 09019 ALARM. DISPLAY When an erroneous command is specified, an alarm as shown below arises, the alarm number and the alarm message are displayed on the CRT screen, and the machine is stopped. Alarm number Contents 140 (140 ARGUMENT IS NOT ASSIGNED) A necessary argument is not specified in the command format 141. (141 OVERSIZE OFFSET VALUE] An offset amount larger than the programmed minimum arc radius is set. a2 [142 COMMAND DATA ERROR] ‘The specified data is erroneous, and the macro cannot be executed. Alarm reset Like the ordinary NC alarm, reset the alarms listed above by pressing the rest button on the NC control panel. 5. FUNCTION USED IN MACRO PROGRAM #27 = #4001 #28 = #4003 Machining program G#27G#28D# 2999 #29 = #4107 (Description) This method is used for returning to the original condition of the macro program when the modal data in the NC is stored at the time of macro call and the sequence returns from the macro program even if the data in the macro program is changed. #4001, #4003, and #4107 are the system variables for reading out the G codes of the first and third groups and the D codes currently being specified. ‘The read-out values are replaced at local variables #27, #28 and #29 and stored. Even when the G codes and the D codes change in the subsequent programs, the sequence returns to the original condition when G#27G#28D#29 is executed. IF [#42080] OTOL GorO10 NI#3000 = 140 (ARGUMENT IS NOT ASSIGNED) NLOM99 (Description) This method is used to display the alarm message on the scr yn and set the NC to the ordinary alarm condition when some conditions are satisfied. Output of alarm message (system variable #3000) Within 26 characters #3000 = 140 (message) « Parenthesis (control in, out) Alarm number (Al number between 1 and 200 which are not used normally) Conditional judgement and divergence IP [#40#0) GOTOL *2Q means equal (=) #0 means empty (not 0), and #4 means the value of address I specified by the argument. ‘That is, when I which is essential for executing this macro program is not speciffed (when I data = empty), the macro program cannot be executed. Therefore, the sequence is jumped to sequence No. N1 by GOT1. Unconditional divergence (GOTGn) When the program advanced smoothly, the sequence is jumped to N10 so that no alarm arises by GOTO10 prior to the block Nl. Other divergence instruction IP[#4LE#30]GO1035 (#45430) Junp to N35 if the value of #4 is equal to or smaller than the value of #30, IP [4817823] GOT05 (#8<423) Jump to NS if the value of #8 is smaller than the value of #23. IP(¥14GE#15]GOTO15 (#82 #23) Jump to N15 if the value of #14 is equal to or larger than the value of #15. 4#4G7830 (#45430) and #8NE#23(#8%#23) are also available. #10=ABS [4 [2000487] (Description) This method is used to read the tool offset amount by the system vafiable and making the absolute value as the value of #10, @ Read of tool offset anount The offset values set at offset Nos. 01 - 99 (200) can be read out by using #2001 to #2099 (#2200), As for #[2000+#71, 2000 is added to the offset number specified by argument designation D(#7), and the form of #20 CL is generated. @® Absolute value (ABS) Even when the value in [ _] is negative, the absolute value is taken and the negative value is converted to a positive value by ABS [ }. ‘That is, In the example shown abov. even when the offset amount is negative, the value of #10 becomes always positive. #33=81+360* [432-1] /#11 #30=#24484*C0S [#33] (Description) In the custom macro, addition/subtraction and multiplication/division, and function calculations can be performed. Addition is indicated by "+", subtraction is indicated by + multiplication is indicated by * (asterisk), and division is indicated by */* (slash). Functions are indicated by SIN[ J, Cos{ J, TAN{ 1, ABS{ 1, ROUND[ J, etc. Calculation priority is given to function, multiplication/division, and addition/subtraction in this order. This priority Sequence can be changed by surrounding with the brace (up to fifth power). #1250 DOL IP [#12713] GO705 41254124617 ENDL Repetition Dom \ rl, 2, 3) ' ' ' \ ENDn (m of DO and m of END are of the (Peser iption) same numeric.) Assume that #17 is given by argument specification 1.0. By DO1-END1, calculation in this section is repeated until IF < conditional expression > is satisfied. In the calculation of #12=#12+#17, the left side is new #12 obtained after calculation, and #12 at the right side is the previous value. since the initial value is #12=0, #12=0+1.0=1.0 in the first calculation, and #12=1.0+1,0=2.0, #12=2,041,0=3.0, ..... in the second and subsequent calculations. Since IP < conditional expression > is satisfied (the value of #12 is larger than 13) when #12813,0+1.0=14.0, the sequence is jumped to block NS by GOTOS. WHILE #1017421] 62 Repetition WHILE < conditional #10=#104417 END2 expression> Dom (m1, 2, 3) (Description) ‘The programs between D02 and END2 are repeated as long as the conditional expression in [ } is satisfied, that is, until the value of #10 is smaller than the value of #21. When the conditional expression becomes unsatisfied, the sequence advances to the block next to END2. #15=[ ROUND [#21/2*1000] ]/1000 ROUND: Rounding (Description) When #21=15.343, #25=#21/2=7.6715 holds. When it is used for axis movement, X#25 becomes equivalent to X7.671, It follows that #26=#21-#25=7.6715, and X#26 becomes equivalent to X7.671. (Rounding is effected in the unit of the least input increment.) ‘Though #21=425+#26 should hold, X-#21 becomes X-15,343, and is not equal to X7.671 and the amount of movement X15.342 by X7.671. Therefore, the value of #21/2 is multiplied by 1000, and the Product is rounded and then divided by 1000 to obtain #25=7.672. When #26=7.671 is added, #21=7, 672+7,671. 5.343 is satisfied. That is, the processing is performed for eliminating calculation errors. 6. MACRO PROGRAM True circle cutting (type @® ccw (counterclockwise) Argument 1 | Machining hole radius D_ | offset number P | Feedrate Command fort 65P9100 way @ clockwise machining (cw) + Specify Wl. @® counterclockwise machining (CCH): Omit W. = 10 - Note 1: Use only positive values for argument specification. Note 2: Tool diameter compensation is not used. Note 3: When W is not specified, CCW movement is performed automatically. Use example 5 20 | $16 end mill, DO1=8.0 fe 6916002-50.0; G012-10.0F60; Se G65P9100125,0D01F120; ks 600260,0; jconeerolcenise) 825 end mill, D05=12.5 —" (CCH) 1¥ 9060020; G012z-10,0F60; ot x G65P9100140, OD05F120W1 ; 00250.0; Clockwise (Cw) es o1 02 03 o4 os 06 o7 08 09 10 1 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 39100(TRUE CIRCLE TYPE 1) $27=44001 #28=44003 #2964107 TFC#45Q¢0 )G0T01 IFC #7EQ#0)GOTO1 F1=ABS( +4) -ABS( #{ 2000+47)) IPC#1LE0 JG0TO2 $20=0172 #21=ROUND( 420% 1000) $22—621/1000 #2mt1-422 $3=41-42 IFC #23EQ#03GOT010 001091x-#2¥-43F49 G17G02X-#3Ye35¢3 141 X#aveaTe3 Go1xX#2Y-#3F (#943) coos N10G01091X-#2v#3F#9 G17G03x-#37-#35 -#3, 141 Xe3Y-#3 183 GOIX#2Y#3F( #9%3) cords N1#3000=140 (ARGUMENT IS NOT ASSIGNED) N2#3000=141 (OVERSIZE RADIUS OFFSET VALUE) N5G#27G#28D+29M99 Alarm 140 arises when there is no I and D argument specifications. #1=machining hole radius - offset amount #150, alarm 151 arises. Processing for minimizing the error when #1 is halved. #2 is the dietance (x) up to the approach circle. #3 becones the radius.of the approach circle. When W is not specified, the sequence goes to N10 (CCH). CW program Jump to NS CCW program Jump to NS ] Bare sessece So 2_True circle cutting (t 11 @ ow (clockwise) @ _cew (counterclockwise) 69110 r hole radius R_|_ Approach circle radius D | offset number Pr | Feedrate Command format Gespo110 R D. (wa) + @ ctockwise machining (cm) 1 specify wi. @ counterclockwise machining (CCW): Omit W. wt = Note 1: Use only positive values for argument specification. Note 2: Since tool diameter compensation G41/G42 is used, the offset amount must be smaller than the radius of the approach circle. Note 3: Start-up and cancel are effected at rapid travers Use_example * Specify the radius R of approach circle by considering the cutter radius and the stock removal 20 630 end mill, D30=15.0 ig 916002-72.0 G65P9110r100, 0R30,0D30F100; > 3 x G00Z72,07 | Counterclockwise T Gee 6.25 end mill, D25=12.5 ¢91G002-72. 00272.0; Clockwise (cH) -u- aL 12 13 14 15 16 17 18 19 20 21 22 23 24 28 26 27 28 39110(TRUE CIRCLE TYRE 2) #27=94001 $28=64003 $29=64107 TFC#4EQ#0 )GOTO1 TFC#18EQ#01GOTO1 IF(#7EQ#0 )GOTO1 IFC#18GE+4)GOTO2 #10=ABS(4(2000+47)) IFC#4LE#10)G0T03 IFC#18LE#10G0TO3 IFC#23EQ¢0}G0T010 G17G91G00G42X-(#4-418) ¥-18D07 GO2X=#1 8Ye185418Fe9 Ie X#18Yoi8 1418 GO0G40X( #4-#18)Y-918 cords Alarm 140 arises if there is no I, Ry D argunent specification. Alarm 142 arises 1£ approach circle radius 2 machining Role radius. Mowoffaet amount fetching. alarm 141 arises if machining hole radius < offset amount Approach circle radiue < offeet amount. When W is not specified, the sequence jumps to MIO (CCW) « om program Jump to NS N10G17G91G00G41X-(+4-18) #1 8De7 GO3X-#18Y-#185-#1 8749 Ie 1X1 8Y-#18 1018 G00G40X(+4-#1 8) 418 Gros cow program ‘Jump to NS N1#3000=140(ARGUMENT IS NOT ASSIGNED) N2#3000=142(COMMAND DATA ERROR) N3#3000=141 (OVERSIZE RADIUS OFFSET VALUE) N5G#27G428D+29M09 eS Deep cutting of circular pocket yi aia L 9120 Argunent Y I | Radius of machining hole W | Depth of cut per pass in 2 (positive) @irection (positive) + D | offset number (positive) F | Circular cutting feedrate (positive) + © | Cutting width per pass 8 | Cutting speed in 2 direction (positive) (positive) % | Depth of cut (positive) ayes. Command format G65P9120 T PLEO To Op 0dr Obs nemgeneny aabENy Note 1: When S is omitted, the feed rate becomes a half the F value. Note 2: Specify so that Q < cutter diameter. Note 3: Z is the distance from the tool nose to bottom of the pocket. Use example @® when feed in z direction is not performed with this macro (x-¥ movement only) Command format G65P9120. 1 == OR + Radius of machining hole (1) = 40,0 6 end mill, DOI= Offset number (D) = 01 Cutting width per pass (0) = 7.0 corz, F , Feedrate (F) 130 G65P9120140.0D0197.0F130; Gooz, , @ when performing feed in 2 direction by one pass Command format G65P9120 1 a es Radius of machining hole (I) = 50.0] 25 end mill, D05=12.7 Offset number (D) = 05 Cutting width per pass (Q) = 10,0 G65P9120150.0D05Q10.0215.0F150 + Machining depth (z) = 15.0 Feedrate (F) = 150 * S-F/2=75 since *S is omitted. @® when cutting by dividing feed in Z direction into several passes Command format G65P9120 1 Radius of machining hole (I) = 45.0 Feedrate (F) = 140 Offset number (D) = 13 Feedrate (S) = 80 Cutting width per pass (Q) = 10.0 Machining depth (z) = 40.0 Depth of cut per pa in 2 direction (Ww) = 9.0 620 end mill, D013=10.2 113010.0240, o9. OF 140880 a on 02 03 o4 05. 08. 07 08 09 10 uw 12 13 4 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 38 36 37 38 39 40 41 42 43 44 45 46 a7 48 49 50 51 52 33 54 39120(CIRCULAR POCKET DEEP CUTTING) #27=84001 $28=#4003 #29=84107 IPC#4EQ#0}GOTO30 IFC+7EQ#0 }GOTO30 TFC417EQ#0}GOTO3 0 #30=ABSC #( 20004473) IFC+4LE#30)G0T03 5 IFC #1 9EQ40 ]GOTO1 BOI02 N1#19—69/2 N23 1=ABS( #26) $8=431 IP(#23EQ+0] 0070s #23=ABS( 423) Gd154 N3#23=631 N42 1=64-930 IFC#8LT#23 }GOTOS DOL +10=0 P10=610+817 091001Z-#23F419 WHILEC#10LT#21}D02 XPLTF#S G03I-#10 P10—b 104817 END2 $22—621-(410-017) G01X#22Fe9 G03I-#21 GO1X-#2 1F (4943) $9=48-#23 IFC#8LE423)G0TO5 ENDI NSIFC#8LE0 JGOTO20 G91G012-#8F#19 #10=0 F10=b10+417 WHILEC #1 0LT#21)D01 XP1TFH9 Go3I-#10 + 10=e10+017 END1 $22=621-(410-417) Go1xez2Fe9 Go3t-#21 G01X-#21FC+9%3) N20G00Z#31 GOr540 Alam 140 arises if there is no I, D, Q argument specification. (Jump to N30) Fetching of #30-0ffset amount. Alara 141 if machining hole radius $ off set amount (Jump to #35) To NI if there is no § specification. 99/2. ‘#3iemachining depth. 31 (replacement) Jump to N3 if no W is specified. Since there is no W specification, depth of cut per pase W=z. ‘#2iemachining hole radius - offset amount. To NS (final depth feed) if machining depth #8 < W.. DO1-END1 is repeated. H0=Q (radius of 1st tool center movement circle) DO2-END2 Is repeated until #10<#21 is satisfied. #0=#10+9 (Radius of movement circle is increased by Q.) Calculation of remaining stock removal lees than . (Movenent of tool center at final circle) Returning to center at feedrate 3 tines the F value. New machining depth=previous-depth of cut per past to NS if885 depth of cut per pass, Returning to original height (to N20) is #80. Pinal 7 feed (Pinal circular cutting at specified depth) Returning to original height. N30#3000=140(ARGUMENT IS NOT ASSIGNED) N38#3000=141 (OVERSIZE OFFSET VALUE) N40G#27G62 8D#29N9 9 =e of square M4 Finish cutting insic | | T =| ( co) > | | » | t SS u @ om (clockwise) @® cow (counterclockwise) 09130 Argument, y A U | Lateral side length R | Radius of approach circle t—+ a 7 v | Longitudinal side length D | offset number © | Radius of corner arc F | Feedrate Command format Gespoizoy__v Rw as @ clockwise machining (cw) : Specify wl. @ counterclockwise machining (CCW): Omit W. Note 1: For argument specification, use only positive values. Note 2: When not entering a corner arc, do not specify C. <= Note 3: Since tool diameter compensation, be sure to satisfy compensation anount > R,C. Note 4: When W is not specified, CCW movement is performed automatically (down cut). Use example 50. zo #16 end mill, D21=8.0 G91G002-50.07 (cow) 6012-10. 0F100; G65P9130U80.0V60.0C10.0R12.0021F130 ; 600260.0; T a Counterclockwise (com t= . | 20 end mili, D02=10.0 G91G002 - 50.0; | G012-10.0F80; | G65P91300100, 0v80,0R20,0D02F140; J \ G00260.0; el * Tf corner arc C is not specified, 100 the corner becomes equal to the Counterclockwise cutter radius. ee #12 end mill, D15=6.0 69060020; G01z-10.0F150; G65P9130060.0V80.0R10.0C8,0D15F90W1; 00750.0; ‘* when W1 is specified, clockwise (CW) movement is performed, Clockwise (CH) -2 on 02 03 04 05 06 o7 08 09 10 a 12 13 4 18 16 un 18 19 20 a 22 23 24 28 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 a az 43 44 45 46 a7 48 49 50 51 $9130(SQUARE) #27=#4001 #2e—ee003 $20—¢4107 TPC $21£Q¢0)G0TOs IF(#22EQ¢0 )GOTOS Alarm 140 arises when there is no U, V, R, D IP(#18EQ¢0 )GOTOS specification. IFC#7EQ#0 )GOTOs PLO=ABS(4( 2000+#7)) srettitag (edi Dac ee tea TEC#18LT#10}GOT10 darn 141 arlees if Reoffaet anount. IFC #3EQ#0)GOTO1 To Nl if C is not specified. IF(#3LT#10)GOTO10 Alarm 141 if Ccoffset amount. Ni#15=CROUND(+21/2%1000}3/1000 9iSetateral axis length 0/2. #1 6=CROUND(+22/2%1000}3/1000 —#16eLongitudinal axis length v/2. IFC#3GE#15)G0T015 IPC43GE#16 }GOTO15 IFC #18GE#15 JGOTOLS IPC#18GB#16) GOTO15 IF(#23EQ#¢0}G0T02 To N2 (COW) Af W is not specified. G9 1G17G01G42X#18Y-C#16-#18) De 7F+9 Go2x-#18Y-4181-#18 G01X-C#15-#3) Go2x-ssess¢3 GO1YC#22-2%83) ow program Gooxesvesre3 GO1XC#21-2%#3) Go2xesy-#3s-43 Go1Y-( 422-2483) G02x-#3Y-#31-#9 GO1X-(#21-#15-#3) Go2x-#18Y#185418 G01G40X#18YC#16-#18 IF (4943) Br520 Jump to #20 N2G91G17G01G41X-#18Y-(4#16-#18)D47 P49 Go3x#18Y-618 1418 Go1xC#15-#2) Gosxesvesse3 Go1yC#22-24¢3) cow progran Go3X-s3ye3I-#3 G01X-C#2 1-23) Go3Xx-#3y-#35 -#3 Go1Y-(#22-24#3) GOsxesY-#3 +3 G01X(#21-#15-#3) GoaKei 8Y#187418 G01G40X-#18Y( +15-#18) F(49%3) Gr520 Jump to N20 N5#3000=140(ARGUMENT 13 NOT ASSIGNED) N10#3000=141 (OVERSIZE OFFSET VELUE) N15#3000=142 (COMMAND DATA ERROR) N20G#27G#28D+29M99 = 23- 5_Deep cutting of square pocket Y x 7 My | | | | | Gor40 Argument v | Lateral side length w | Depth of cat per pass in z (positive value) direction (positive value) v | Longitudinal side length r (positive value) Pocket cutting feedrate (positive value) Q | Width of cut per pass s (positive value) Feedrate in % direction (positive) °| Offset number 2 Machining depth (positive value? =e Command format oo | cesponaou_ ieee sestigbe ee Tess nt Note 1: When $ is omitted, the feedrate becomes a half the F value. Note 2: Machining depth Z is the distance from the tool nose to the pocket bottom. Note 3: When Q>cutter radius, incomplete cutting will arise. Note 4: This method is applicable to horizontally long square, vertically long square and true square. Use example @ when feed in 2 direction is not performed with this macro (X-¥ movenent only) Command format { cesparsop___ vg Lateral side length (0) = 100.0] $20 end mitt, p11=10,2 Longitudinal side length (Vv) = 80.0 Width of cut per pass (0) = 9.0 | Gol z ¥ 00h Offset number (D) = 1.0 j Feedrate (F) = 120 | | 665P91400200. ove0.099. 0021120; ‘6002, ~ an @ wen performing feed in z direction by one pass Command format 685P91.400_ Vet Se eee ee : Lateral side length (U) = 100.0 Longitudinal side length (Vv) = 100.0 Width of cut per pass (9) = 10.0 Machining depth (2) = 20.0 Offset number (D) = 03 Feedrate (F) = 100 26 end mill, D03=12.7 ag epee ASTI SS Tw I0 200 Int Ad. AT ST>} G65P91 400100, 0¥100,.0910.0220. 0D03F100 + * Since S is omitted, S=F/2=50. @ when cutting by dividing feed in z direction into several passes Command format eespandoy ov wk . Lateral side length (U) = 80.0 Feedrate (F) = 140 Longitudinal side length (v) = 100,0 Feedrate (5) = 60 Width of cut per pass (Q) = 9.0 Offset number (D) = 26 Machining depth (2) = 30.0 Depth of cut per pass in 2 direction (W) = 8.0 620 end mill, D26=10,2 8, OF140860 7 ae) on oz 03 oa os 06 or os 09 10 11 12 13. 14 15 18 17 18 19 20 an 22 23 24 25 26 27 28 29 30 31 32 33 34 35 38 37 38 a9 40 a. a 43 44 45 46 a7 48 49 50 31 52 53 54 55 56 57 #29>94107 $27=P4002 $28=84003 IFC#21£Q¢0)G01090 IFC #228940 )GDT090 IFC417EQ#0JGOTO90 IFC#7EQ+0 JGDTO90 $3 1=CROUND( #2172%1000) J/1000 #32=( ROUND(422/2%1000) 1/1000 $14=951-ABS(#(2000+#7 1) #15=#32-ABS(4(2000+47)) TFC#14LT0IGOTO85 IFC#15LT0}GOTO95 IF(#1929¢0) GOTO1 GOro2 Ni¢i9—9/2 N2#16=ABSC #26) F10=F16 #12=0 IF(#23EQ¢0)G0TOS: #25=ABS( #23) Gdros N3#23=016 [> NS IFC #1 0LT#23JGOTS10 91G012-#23F419 e121 29923 Oris N10G91G012-#10F#19 12124410 N15 1FC#14LE#15)GOTOs0 #305617 33—03 1-832 +017 Bab15 IPC #15LE617)GO1045 GOr1ds5 N40¢33=417 $30=052-491+017 S8=415 NSSIFC#14LE#1 7 )GOTO4S G91G01 Y-#30Fr¢0 Xxe33 YC2W430) X-(2%633) Y¥-Coe#30) X33 NS0s8=#15: #30=63 04617 P5sebsa+e17 IPC#8LE#17)GOTO4S Go1y-#17 xXes3. YC2w#30) X-( 28633) Y-(2e930) xes3. GoTOs0 30 J | | 140(SQUARE POCKET DEEP CUTTING) To N90 (alarm 140) when there is no U, V, Q, D argument specification. #31elateral side length/2 #32eLongitudinal side length/2 #149431 ~ offset amount 415¢#32 - offset amount To N95 (alarm 142) if a half of each side is sraller than offset amount. Sumping to Nl and S=F/2 setting when § is not specified. ‘#6emachining depth 1 §10°416 (replacenent) #12 is the depth after machining. Jumping to N3 and Waz setting when W is not specified. #23edepth of cut per pat To N10 {¢ the machining depth 1s smaller than W (depth of cut per pasa W cutting. Machining depth #2edepth after previous cutting + depeh of cut per pass To N4O if #14 < #15 (true square or vertically ‘long square). Gatculation of #30 (1/2 of longitudinal side) and #33 (1/2 of lateral aide) of aquare along which the tool center moves at the nt pans of horizontally long square end varticelly long square. To N45 (final pass) if #85 width of cut per pass. First ‘square cutting program. #8 is reduced by Q from #15 each time. Second and subsequent square calculations (one side increased by Q). Second and subsequent square cutting program. -27- To NS 58 59 60 61 62 63 64 65 66 67 68 69 70 1 12 13 N45G91G01Y-#8F#9 xe1a YC2w#15) X-C2ee1 4) Y-Cae#15) xe14 Yo1SPC#9%3) IPC#12EQ¢16 JGDTO8O #10=F 10-423 cords N80G91Go0z#16 GOTO100 Final square cutting program, To N 80 if depth after machining #12=machining depth 2 (#16). #20 is the remaining depth of cut obtained by subtracting W from machining depth. arelief. N8543000=141 (OVERSIZE OFFSET VALUE) N90#3000=140(ARGUMENT IS NOT ASSIGNED) N95#3000=142 (COMMAND DATA ERROR) N100G#27GS28De29N99 - 28 - M-6 Bolt hole circle {absolute progranming) 3rd hole 09150 Argument x | X coordinate value of A | Start angle of ist hole circle center ¥ | ¥ coordinate value of H | Number of holes equally circle center distributed Circle radius (positive value) = acs Command format Canned cycle command (Specify LO) c65P9150x__¥ Note 1: When the start angle A is omitted, it is regarded as 0°. Mote 2: Be sure to program in absolute designation. ares? ee? ; cote yeti pe Pye af i; a? Use example Equal distribution of 4 holes 220, 20 2-200 6905, G81R2. 02-20. OF 110L0; G65P9150X50. 0Y80.0130.0A45.0H4; 6805 Equal distribution of 12 holes 690; G83R2.0Z-20.093.0F90L0; G65P9150X0YOI50,0H125 G80; * Since A is omitted, the start angle becomes 0°. ae :9150(BOLT HOLE CIRCLE G90) IPC#+24EQ#0 ]GOTO1 IF(#25£Q40)GOTO1 IFC#4EQ#0)GOTO1 TFC#11£940}GOTO1 +3: WHILEC#3 2LEABSC#11))D01 #33=01+360e(432-1)/411 $30=624+#4%COS( #337 $3 1=#25+44 4S INC #33) xXe30ved1 #32=032+1 BND1 G80G00x#24¥425 Gor02 N1#3000=140(ARGUMENT IS N2M99 ‘To WL (alarm 160) when there is no x, ¥, Ty H argument specification. 432 (number of holes) DO1-ENDI is repeated as long as number of holes ; number of holes equally distributed. Calculation of X and ¥ coordinate values of hole at arbitrary position counting from the first. Positioning x ¥ to calculated hole position. Increasing the number of holes by one. turning to the center of equal distribution circle. NOT ASSIGNED) = 32- M-7 Special deep hole cycle (A) Point 1 a Point R. Point % Distance from initial point to R (positive value) Distance from point R to % (positive value) Peck cycle pattern distance (positive) (positive) | Command format G66P9180R, hire FicnteMiinned, 7 Positioning command Note 1: The macro program is of incremental designation. -33- aX RSS G90G54G00X0Y0; G6 6P9180R98.0Z52.0K20.0Q3.0F100; X15.0Y-15.03 X60.0¥-200; X80.0¥-50.0; X300¥-40.03 X15.0Y-65.0; Ger: -u- $9180(SPECIAL DEEP HOLE CYCLE A) $28—04001 $29=$4003 IFC#18EQ¢0)GOT01 IF(#26EQ¢03GOTO1 TPC #65040 )GOT01 IPC#1 7894000101 #6=ABSC#6) $1 7=ABS(#17) +18=ABSC#18) $26=AB8(426) G91G00z-(#18-01) Positioning to O.lm prior to point R. #2320 WHILE((#26-+23]GE#6)D02 po2-EWp2 49 repeated as long as 2-depth after cut = K. +8=0 WHILEC(#6-#8}GE¢173D01 DO1-END1 is repeated as long as K-#8 = GO1Z-C#17+0.1 FS Cutting feed distance per pass. Go0zo1 $3=e8+417 $8=48-Q ENDI G01Z-(46-#8+01) Cutting by remaining cutting amount of K. $2982 9+ 46 429=623°Ke Goozezs J Positioning to 0.1mm prior to previously machined z-ce23-01) position after returning to point R. $3=0 WHILEC (426-#23-#8 JGE#17)D01 eteize0 Fes aa Machining progtan when the remaining depth {= Brees: shaller than K- ENDI G01z-C#26-#23-#8+01) Goozc $16+426) Returning to initial point. O05 2 pirate N1#3000=140 (ARGUMENT IS NOT ASSIGNED) NsGe28ce20M99 oan M-8 Special deep hole cycle (B) Point 1 Point R Point K Point 2 09190(91) 09200(G90) Argument y R | Distance from point I to 1 | Coordinate value of return point R (Positive value) point I at K | Distance from point R to Coordinate value of point R point K (positive value) ce Distance from point R to point % (positive value) Depth of cut per pass (positive) Feedrate Coordinate value of point K Coordinate value of point z Depth of cut per pat (positive) F a Geta Feedrate Commané_format G66P9190R_ Ge6P92001_R XK 2 0 OF ' eat" ey Xiao sy t Positioning ' Positioning i ' 1 command 1 command 1 1 1 I ' ! 67; os7 ; Note 1: The machining up to point K is already performed, and machining from point K to point z is performed by this cycle. mites on 02 03 04 0s 06 o7 08 09 10 an 12 12 14 15 16 17 18 19 20 a1 22 23 24 25 26 27 28 29 oO oz 03 4 05 06 o7 08 09 10 un 12 13. 14 15 16 17 18 19 20 21 19190(SPECIAL DEEP HOLE 427=44001 #28=64003 IFC#18EQ¢0)GOTO1 IFC#6EQ#0}GOTOI IFC#26EQ#0JGOTO1 IF(#17EQ#0 )GOTO1 FO=ABS(46) #1 7=ABS(417) #18=aBs(+18) $26=ABS(#26) #1 0=426-#6 F3=46 G91G002-#18 WHILE(#10GE#17)D01 Z-(#8-01) Go12-(417+01 JF #9 Goozt4a+417) $8=684617 #10=10-417 ENDI IFC#105Q0 JG0T02 Z-C#8-01) G012-(410+01 JFS9 Goozce26+418) GO103 N1#3000=140(ARGUMENT 18 N2G00Z418 N3G#27G#28M9 9 $9200(SPECIAL DEEP HOLE IFC#4EQ40 ]GOTO10 TFC #1 8EQ#0 )GOTO10 IFC#6 EQ#0 }GOTO10 IFC#26EQ#0}G0TO10 IF(#17EQ#0)G0T010 +8=06 G90gooze18 WHILEC #8G7#26JD01 2C #8401) GO1Z(#8-#1 7] 49 Goozeis $3=68-417 END} TFC#8EQ#26 }GOTOS 2C#8+01) 01242 6F#9 NSGOOZ#4 cOrO15, CYCLE B) #1092-K (Calculation of actual cutting depth) K Positioning to point Re DOL-ENDI is repeated as long as actual cutting depth > Gepth of cut per pass. Cutting distance per pass is Q+0.1. Returning to point R. Culculation of remaining actual cutting depth. 2 (to initial point) if cutting depth is 0. NOT ASSIGNED) CYCLE B) +85 coordinate value of point K. Repesting as long as coordinate value of point K > coordinate value of point 2- Positioning to 0.1m prior to previously machined point. Infeed. Returning to point R. Coordinate value of point K is made to approach point K by Q. i N10#3000=140(ARGUMENT IS NOT ASSINED) NisM99 = 38 - Reaming cycle 9 ¥—F Initial point 9 3 i | | 3 ona i—-} 1 t hod eee 1 | net it ; Point R Point R | F F| | oF Point 2 Point Z 092911691) '09290(690) Argunent Incremental Absolute y R | Distance from initial point Coordinate value of return to point R (positive value) point + % | Distance from point R to Coordinate value of point R Point Z (positive value) P | cutting feedrate 2% | Coordinate value of point 2 S | Return feedrate | F | Cutting feedrate X | Return feedrate Command _for! | c6epo291R__ 7 s+ | | eesrozsor_rR_s Fs ; Ray ' | vane , 1 1 | | | | | ' ' i ' i 667 + 667; -39- le 2100.0 100 + {2-250 Ot” For the hole position, see the example of M-7. Incremental programming 691600 + G66P9291R98.0227.0F1805300 ; X15,0¥-15.9 5 X45.0-5.0 x20.0¥-30.0 5 X-50,0¥10.0 5 X-15,0¥-25.0 os7 Absolute programming G90G00G54x0v0 + G66P92907100.0R2.02-25.0F200 ; x15, 0¥-15.0 x60, 0Y-20.0 + ce7 ; So 39291 (REAMER CYCLE) 428=84001 $29=484003 IP (+18EQ+0 GOTO5 IFC #26EQ#0)GOTOS IF(#9EQ#0}G0TO5 #18=ABSC418) $26=ABS( #26) #10=81 91 $10=Sx1 IFC#10NEO)GOTO1 —to HI (S specified) if #10 0. #19=2kH9 S=2xF when #100 (S unspecified) N1G00Z-#18 Go1z-#20Fe9 Z$26PH19 Gooz#is GOT10 NS#3000=140(ARGUMENT IS NOT ASSIGNED) N10G#28G#29N99 :9290(REAMER CYCLE) IPL#4EQ#0GOTOS IFC#18EQ#0}GOTOs IF (#26 EQ JGOTOS IFC#9EQ40)GOT0S #L0F19 kT IF(#1 0NE0JGOTO1 F19=2ke9 N1G00Z#18 G01Z$26F49 2418F819 Goozes GOTO10 NS#3000=140 (ARGUMENT IS NOT ASSIGNED) N1OM93 are M-10 Matrix machining (desired program is executed after positioning at equal interval) Y H pes. D pes. 09220 = 42- Argument v X | X movement amount (G91) from start point to Ist hole/coordinate value of 1st hole (G90) + ¥ | ¥ movement amount (G91) from start point to 1st hole/coordinate value of 1st hole (G90) SIMI S-

You might also like