0 BEGIN PGM 8200_EN MM 1 ;NC program in which the control uses a 2 ;measured coordinate to automatically 3 ;decide which NC program it will use for 4 ;machining the measured workpiece blank. 5 ;First you define the program paths of the 6 ;NC programs to be run. In addition, you 7 ;define the measured Y coordinate for which 8 ;the corresponding program is to be called. 9 ;You can also define tolerances by which the 10 ;measurement result can deviate in negativ 11 ;and positiv direction from the given 12 ;coordinate. You can additionally define a 13 ;specific number of program runs. 14 ; 15 ; 16 ;Function for skipping the program definition 17 ;in the program run 18 FN 9: IF +0 EQU +0 GOTO LBL 201 19 ; 20 ;Definition of programs that are to be run 21 ;depending on the result of measurement 22 LBL 11 23 CALL PGM 82005_en.h ;Program No.1 24 LBL 0 25 ; 26 LBL 12 27 CALL PGM 82004_en.h ;Program No.2 28 LBL 0 29 ; 30 LBL 13 31 CALL PGM 82003_en.h ;Program No.3 32 LBL 0 33 ; 34 LBL 14 35 CALL PGM 82002_en.h ;Program No.4 36 LBL 0 37 ; 38 LBL 15 39 CALL PGM 82001_en.h ;Program No.5 40 LBL 0 41 ; 42 LBL 201 ;Program continuation 43 ;Entry of the Z coordinates to be 44 ;differentiated 45 ;Z coordinate for program 1 46 FN 0: Q81 =+25 47 ;Z coordinate for program 2 48 FN 0: Q82 =+20 49 ;Z coordinate for program 3 50 FN 0: Q83 =+15 51 ;Z coordinate for program 4 52 FN 0: Q84 =+10 53 ;Z coordinate for program 5 54 FN 0: Q85 =+5 55 ; 56 ;Further input 57 FN 0: Q91 =+1 ;TOLERANCE OF THE Z COORDINATE 58 FN 0: Q94 =+10 ;NUMBER OF PROGRAM REPETITIONS 59 ; 60 LBL 200 ;Beginning of repetition 61 ; 62 CALL PGM 82006_en.h ;Program call for a pallet switch 63 ; 64 ;Reset from tilted working plane 65 PLANE RESET TURN FMAX 66 ; 67 ;Tool call for touch probe 68 TOOL CALL 500 Z 69 ; 70 ;Activate the datum 71 CYCL DEF 247 DATUM SETTING ~ Q339=+5 ;DATUM NUMBER 72 ;Component center, lower edge of workpiece 73 ; 74 L X+0 Y+0 R0 F5000 ;Pre-position 75 L Z+100 ;Move to clearance height 76 ; 77 ;Define the measuring cycle 78 ;!Here you have to fill in the coordinates 79 ;for measuring! / 80 TCH PROBE 0.0 REF. PLANE Q90 Z- 81 TCH PROBE 0.1 X+0 Y+0 Z+100 82 ; 83 ;The measurment result is given as the value 84 ;the the test run 85 ;!IMPORTANT INFORMATION! This NC block must be 86 ;deleted in the program run because it would 87 ;overwrite the actual result of 88 ;measurement! 89 FN 0: Q90 =+15.1 90 ; 91 ;Automatic selection of which program matches 92 ;the measurment result 93 ;Program No.1 94 FN 2: Q31 =+Q81 - +Q91 ;Tolerance in Z coordinate 95 FN 11: IF +Q90 GT +Q31 GOTO LBL "PROG_01" ;If the measured height is greater than the coordinate, jump to "PROG_01" 96 ; 97 ;Program No.2 98 FN 2: Q32 =+Q82 - +Q91 ;Tolerance in Z coordinate 99 FN 11: IF +Q90 GT +Q32 GOTO LBL "PROG_02" ;If the measured height is greater than the coordinate, jump to "PROG_02" 100 ; 101 ;Program No.3 102 FN 2: Q33 =+Q83 - +Q91 ;Tolerance in Z coordinate 103 FN 11: IF +Q90 GT +Q33 GOTO LBL "PROG_03" ;If the measured height is greater than the coordinate, jump to "PROG_03" 104 ; 105 ;Program No.4 106 FN 2: Q34 =+Q84 - +Q91 ;Tolerance in Z coordinate 107 FN 11: IF +Q90 GT +Q34 GOTO LBL "PROG_04" ;If the measured heigt is greater than the coordinate, jump to "PROG_04" 108 ; 109 ;Program No.5 110 FN 2: Q35 =+Q85 - +Q91 ;Tolerance in Z coordinate 111 FN 11: IF +Q90 GT +Q35 GOTO LBL "PROG_05" ;If the measured height is greater than the coordinate, junp to "PROG_05" 112 ; 113 ;If no selection was possible, jump to end 114 ;of program 115 FN 9: IF +0 EQU +0 GOTO LBL "end" 116 ; 117 ; 118 LBL "PROG_01" 119 CALL LBL 1 ;Jump to check the maximum coordinate 120 FN 9: IF +0 EQU +0 GOTO LBL "end" ;Go to end of program 121 ; 122 LBL "PROG_02" 123 CALL LBL 2 ;Jump to check the maximum coordinate 124 FN 9: IF +0 EQU +0 GOTO LBL "end" ;Go to end of program 125 ; 126 LBL "PROG_03" 127 CALL LBL 3 ;Jump to check the maximum coordinate 128 FN 9: IF +0 EQU +0 GOTO LBL "end" ;Go to end of program 129 ; 130 LBL "PROG_04" 131 CALL LBL 4 ;Jump to check the maximum coordinate 132 FN 9: IF +0 EQU +0 GOTO LBL "end" ;Go to end of program 133 ; 134 LBL "PROG_05" 135 CALL LBL 5 ;Jump to check the maximum coordinate 136 FN 9: IF +0 EQU +0 GOTO LBL "end" ;Go to end of program 137 ; 138 ;End of program 139 LBL "end" 140 ; 141 LBL 0 142 ;Call of repetition 143 CALL LBL 200 REPQ94 144 ;If number of repetitions has been reached, 145 ;program end 146 M30 147 ; 148 ; 149 ;Check whether the measurement result as 150 ;also in the positive range within 151 ;tolerance. 152 LBL 1 ;Program No.1 153 FN 1: Q41 =+Q81 + +Q91 ;Maximum Z coordinate 154 FN 11: IF +Q90 GT +Q41 GOTO LBL "end" ;If the measured coordinate is greater than the maximum, jump to program end 155 CALL LBL 11 ;Jump to program definition 156 LBL 0 157 ; 158 LBL 2 ;Program No.2 159 FN 1: Q42 =+Q82 + +Q91 ;Maximum Z coordinate 160 FN 11: IF +Q90 GT +Q42 GOTO LBL "end" ;If the measured coordinate is greater than the maximum, jump to program end 161 CALL LBL 12 ;Jump to program definition 162 LBL 0 163 ; 164 LBL 3 ;Program No.3 165 FN 1: Q43 =+Q83 + +Q91 ;Maximum Z coordinate 166 FN 11: IF +Q90 GT +Q43 GOTO LBL "end" ;If the measured coordinate is greater than the maximum, jump to program end 167 CALL LBL 13 ;Jump to program definition 168 LBL 0 169 ; 170 LBL 4 ;Program No.4 171 FN 1: Q44 =+Q84 + +Q91 ;Maximum Z coordinate 172 FN 11: IF +Q90 GT +Q44 GOTO LBL "end" ;If the measured coordinate is greater than the maximum, jump to program end 173 CALL LBL 14 ;Jump to program definition 174 LBL 0 175 ; 176 LBL 5 ;Program No.5 177 FN 1: Q45 =+Q85 + +Q91 ;Maximum Z coordinate 178 FN 11: IF +Q90 GT +Q45 GOTO LBL "end" ;If the measured coordinate is greater than the maximum, jump to program end 179 CALL LBL 15 ;Jump to program definition 180 LBL 0 181 ; 182 END PGM 8200_EN MM