0 BEGIN PGM 1025_EN MM 1 ;Program for defining a point pattern, in 2 ;which holes are drilled on a round 3 ;workpiesce in a linear arrangement. 4 ;The lines are parallel to the X-axis. The 5 ;distance between the holes you define in a 6 ;parameter. The distance of the lines in the 7 ;Y-axis you also define in a parameter, in 8 ;this case as a factor who is mulitiplicated 9 ;with the distance in the X-axis. After the 10 ;input of all parameters, defining the tool 11 ;and the cycle for the machining process, the 12 ;control calculates all possible drilling 13 ;positions, where the process gets executed. 14 ;In this program, a circular workpiece is 15 ;created by calling another program. 16 ; 17 ; 18 ;Input parameter 19 FN 0: Q1 =+80 ;CIRCLE CENTER IN THE X-AXIS 20 FN 0: Q2 =+80 ;CIRCLE CENTER IN THE Y-AXIS 21 FN 0: Q3 =+80 ;CIRCLE RADIUS 22 FN 0: Q4 =+8 ;MACHINING CLEARANCE IN 23 ; ;THE X-AXIS 24 FN 0: Q5 =+0.866 ;CLEARANCe FACTOR 25 ; ;IN THE Y-AXIS 26 ; ;Q4 * Q5 =DISTANCE IN Y 27 FN 0: Q8 =+2 ;SAFTY CLEARANCE 28 ;Input parameter completed 29 ; 30 BLK FORM 0.1 Z X-0.5 Y-0.5 Z-20 31 BLK FORM 0.2 X+160.5 Y+160.5 Z+0 32 ; 33 ;Call program 10251_en.h for preparing 34 ;the round workpice 35 CALL PGM TNC:\Database\10251_en.H 36 ; 37 ;Tool call drill 38 TOOL CALL 5 Z S200 39 ; 40 ;Define the cycle for the machining process 41 CYCL DEF 1.0 PECKING 42 CYCL DEF 1.1 SET UPQ8 43 CYCL DEF 1.2 DEPTH-21 44 CYCL DEF 1.3 PLNGNG10 45 CYCL DEF 1.4 DWELL0 46 CYCL DEF 1.5 F100 47 ; 48 CALL LBL 1 ;Call subprogram position calculation 49 ; 50 ;Move back and end of program 51 L Z+50 R0 FMAX M2 52 ; 53 ;Subprogram 54 LBL 1 55 ;Calculate the distances and the first position 56 FN 2: Q14 =+Q3 - +Q108 57 FN 1: Q13 =+Q14 + +Q2 58 FN 1: Q15 =+Q3 + +Q108 59 FN 2: Q32 =+Q2 - +Q3 60 FN 2: Q32 =+Q32 - -Q108 61 FN 0: Q21 =+Q1 62 FN 0: Q22 =+Q32 63 FN 3: Q27 =+Q4 * +Q5 64 FN 3: Q23 =+Q4 * +0.5 65 FN 3: Q24 =+Q4 * +3 66 FN 1: Q24 =+Q24 + +Q3 67 ; 68 L Z+100 R0 FMAX M3 ;Move to a safe position 69 L X+Q21 Y+Q22 R0 FMAX M3 ;Move to the first position 70 L Z+Q8 FMAX M99 ;Move to the set-up clearance and call the cycle 71 LBL 5 ;Determine the other positions, prepositioning and cycle call 72 FN 1: Q21 =+Q21 + -Q23 73 FN 1: Q22 =+Q22 + +Q27 74 FN 11: IF +Q22 GT +Q13 GOTO LBL 99 75 LBL 30 76 FN 1: Q21 =+Q21 + -Q4 77 CALL LBL 50 78 FN 12: IF +Q29 LT +Q14 GOTO LBL 30 79 FN 9: IF +Q29 EQU +Q14 GOTO LBL 31 80 LBL 32 81 FN 1: Q21 =+Q21 + +Q4 82 CALL LBL 50 83 FN 11: IF +Q29 GT +Q14 GOTO LBL 32 84 LBL 31 85 L X+Q21 Y+Q22 R0 FMAX M99 86 FN 1: Q21 =+Q21 + +Q4 87 CALL LBL 50 88 FN 12: IF +Q29 LT +Q14 GOTO LBL 31 89 FN 9: IF +Q29 EQU +Q14 GOTO LBL 31 90 FN 1: Q21 =+Q21 + +Q23 91 FN 1: Q22 =+Q22 + +Q27 92 FN 11: IF +Q22 GT +Q13 GOTO LBL 99 93 LBL 40 94 FN 1: Q21 =+Q21 + +Q4 95 CALL LBL 50 96 FN 12: IF +Q29 LT +Q14 GOTO LBL 40 97 FN 9: IF +Q29 EQU +Q14 GOTO LBL 42 98 LBL 41 99 FN 1: Q21 =+Q21 + -Q4 100 CALL LBL 50 101 FN 11: IF +Q29 GT +Q14 GOTO LBL 41 102 LBL 42 103 L X+Q21 Y+Q22 R0 FMAX M99 104 FN 1: Q21 =+Q21 + -Q4 105 CALL LBL 50 106 FN 12: IF +Q29 LT +Q14 GOTO LBL 42 107 FN 9: IF +Q29 EQU +Q14 GOTO LBL 42 108 FN 9: IF +0 EQU +0 GOTO LBL 5 109 LBL 0 110 LBL 50 111 FN 2: Q28 =+Q1 - +Q21 112 FN 2: Q29 =+Q2 - +Q22 113 FN 8: Q29 =+Q28 LEN +Q29 114 FN 3: Q30 =+Q28 * +Q28 115 FN 5: Q30 = SQRT +Q30 116 FN 11: IF +Q30 GT +Q24 GOTO LBL 99 117 LBL 0 118 LBL 99 119 L Z+50 R0 FMAX ;Move back 120 LBL 0 121 END PGM 1025_EN MM