0 BEGIN PGM 82601_EN MM 1 ;NC program for determining the tolerance values of a 2 ;fit. The control subsequently executes a measuring 3 ;cycle. It then evaluates the measurement result and 4 ;determines whether the measured fit is within the 5 ;defined tolerance. The control then displays the 6 ;status, the measurement result, and the dimensions on 7 ;the screen. 8 ;All of the required parameters are defined in 9 ;NC program 8255_en.h. 10 ;If you saved all of the required files in the same 11 ;directory, you do not need to adjust this NC program. 12 ;If the files are saved in different directories, you 13 ;need to adjust the paths in the file definitions. 14 ; QS2 = "a" ;Define the lowercase letter for checking 15 ; 16 ;Check whether uniform hole or uniform shaft Q2 = STRCOMP( SRC_QS1 SEA_QS2 ) 17 ; 18 ;Open the table for uniform hole 19 FN 26: TABOPEN Hole_82603.TAB 20 ; 21 ;If hole, then jump to LBL 1 22 FN 9: IF +Q2 EQU -1 GOTO LBL 1 23 ; 24 ;Open the table for uniform shaft 25 FN 26: TABOPEN Shaft_82603.TAB 26 ; 27 ;LBL 1 jump label 28 LBL 1 29 ; Q22 = 0 ;Row number counter 30 ; 31 ;Read the value from row 0, column "BEREICH" of the table 32 FN 28: TABREAD Q3 =Q22 /"BEREICH" 33 ; 34 ;LBL 11 jump label 35 LBL 11 36 ; 37 ;Check whether the defined fit is within the range 38 FN 11: IF +Q1 GT +Q3 GOTO LBL 12 39 ; 40 ;Read the upper dimension from the table 41 FN 28: TABREAD Q4 =Q22 / QS1 42 ; 43 ;Increment the row number by one Q22 = Q22 + 1 44 ; 45 ;Read the lower dimension from the table 46 FN 28: TABREAD Q5 =Q22 / QS1 47 ; 48 ;Jump to LBL 99 49 FN 9: IF +1 EQU +1 GOTO LBL 99 50 ; 51 ;LBL 12 jump label 52 LBL 12 53 ;Increment the row number by two Q22 = Q22 + 2 54 ; 55 ;Read the value from row Q2, column "BEREICH" of the table 56 FN 28: TABREAD Q3 =Q22 /"BEREICH" 57 ; 58 ;Jump to LBL 11 59 FN 9: IF +1 EQU +1 GOTO LBL 11 60 ; 61 ;LBL 99 jump label 62 LBL 99 63 ; 64 ;Calculate the maximum dimension in mm Q23 = Q1 + ( Q4 / 1000 ) 65 ; 66 ;Calculate the minimum dimension in mm Q33 = Q1 + ( Q5 / 1000 ) 67 ; 68 ;Tool call for 3-D touch probe 69 TOOL CALL "TOUCH_PROBE" Z S50 70 ;Pre-position 71 L Z+100 R0 FMAX 72 L X+Q11 Y+Q21 R0 FMAX 73 ; 74 ;Jump to measuring position 75 ;If hole, then jump to LBL 14 76 FN 9: IF +Q2 EQU -1 GOTO LBL 14 77 ;If shaft, then jump to LBL 15 78 FN 11: IF +Q2 GT -1 GOTO LBL 15 79 ; 80 ;Measure the hole 81 LBL 14 82 TCH PROBE 421 MEASURE HOLE ~ Q273=+Q11 ;CENTER IN 1ST AXIS ~ Q274=+Q21 ;CENTER IN 2ND AXIS ~ Q262=+Q1 ;NOMINAL DIAMETER ~ Q325=+Q41 ;STARTING ANGLE ~ Q247=+90 ;STEPPING ANGLE ~ Q261=+Q31 ;MEASURING HEIGHT ~ Q320=+Q51 ;SET-UP CLEARANCE ~ Q260=+100 ;CLEARANCE HEIGHT ~ Q301=+1 ;MOVE TO CLEARANCE ~ Q275=+Q23 ;MAXIMUM LIMIT ~ Q276=+Q33 ;MINIMUM LIMIT ~ Q279=+0 ;TOLERANCE 1ST CENTER ~ Q280=+0 ;TOLERANCE 2ND CENTER ~ Q281=+0 ;MEASURING LOG ~ Q309=+0 ;PGM STOP TOLERANCE ~ Q330=+0 ;TOOL ~ Q423=+4 ;NO. OF PROBE POINTS ~ Q365=+1 ;TYPE OF TRAVERSE 83 M140 MB MAX F9999 84 ;Jump to determine the status 85 FN 9: IF +1 EQU +1 GOTO LBL 16 86 ; 87 ;Measure the shaft 88 LBL 15 89 TCH PROBE 422 MEAS. CIRCLE OUTSIDE ~ Q273=+Q11 ;CENTER IN 1ST AXIS ~ Q274=+Q21 ;CENTER IN 2ND AXIS ~ Q262=+Q1 ;NOMINAL DIAMETER ~ Q325=+Q41 ;STARTING ANGLE ~ Q247=+90 ;STEPPING ANGLE ~ Q261=+Q31 ;MEASURING HEIGHT ~ Q320=+Q51 ;SET-UP CLEARANCE ~ Q260=+100 ;CLEARANCE HEIGHT ~ Q301=+1 ;MOVE TO CLEARANCE ~ Q277=+Q23 ;MAXIMUM LIMIT ~ Q278=+Q33 ;MINIMUM LIMIT ~ Q279=+0 ;TOLERANCE 1ST CENTER ~ Q280=+0 ;TOLERANCE 2ND CENTER ~ Q281=+0 ;MEASURING LOG ~ Q309=+0 ;PGM STOP TOLERANCE ~ Q330=+0 ;TOOL ~ Q423=+4 ;NO. OF PROBE POINTS ~ Q365=+1 ;TYPE OF TRAVERSE 90 M140 MB MAX F9999 91 ;Jump to determine the status 92 FN 9: IF +1 EQU +1 GOTO LBL 16 93 ; 94 LBL 16 95 ;Determine the status 96 FN 9: IF +Q180 EQU +1 GOTO LBL 20 97 FN 9: IF +Q181 EQU +1 GOTO LBL 21 98 FN 9: IF +Q182 EQU +1 GOTO LBL 22 99 ; 100 LBL 20 QS3 = "PASS" 101 FN 9: IF +1 EQU +1 GOTO LBL 23 102 ; 103 LBL 21 QS3 = "REWORK" 104 FN 9: IF +1 EQU +1 GOTO LBL 23 105 ; 106 LBL 22 QS3 = "SCRAP" 107 FN 9: IF +1 EQU +1 GOTO LBL 23 108 ; 109 LBL 23 110 ;Compile the text for the fit QS2 = TOCHAR( DAT+Q1 DECIMALS0 ) || QS1 111 ; 112 ;Display the contents of the mask file 82552_en.a 113 ;on the screen 114 FN 16: F-PRINT 82602_en.A / SCREEN: 115 ; 116 ;End of program 117 END PGM 82601_EN MM