0 BEGIN PGM 82501_en MM 1 ;NC program for determining the tolerance values 2 ;and displaying them on the screen. 3 ;The tolerances to be determined are defined in 4 ;the NC program 8250_en.h. 5 ;If you saved all of the required files in the 6 ;same directory, you do not need to edit this 7 ;NC program. 8 ;If the files are saved in different directories, 9 ;you need to adapt the paths in the file 10 ;definitions. 11 ; 12 ; 13 QS2 = "a" ;Define the lower case letter for checking 14 ; 15 ;Check whether uniform hole or uniform shaft 16 Q2 = STRCOMP( SRC_QS1 SEA_QS2 ) 17 ; 18 ;Open the table for uniform hole 19 FN 26: TABOPEN 82503_hole.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 82503_shaft.TAB 26 ; 27 ;LBL 1 jump label 28 LBL 1 29 ; 30 Q2 = 0 ;Row number counter 31 ; 32 ;Read out the value from row 0 column "range" of the table 33 FN 28: TABREAD Q3 =Q2 /"BEREICH" 34 ; 35 ;LBL 11 jump label 36 LBL 11 37 ; 38 ;Check whether the defined fit lies in the range 39 FN 11: IF +Q1 GT +Q3 GOTO LBL 12 40 ; 41 ;Read out the upper dimension from the table 42 FN 28: TABREAD Q4 =Q2 / QS1 43 ; 44 ;Increment the row number by one 45 Q3 = Q2 + 1 46 ; 47 ;Read out the lower dimension from the table 48 FN 28: TABREAD Q5 =Q3 / QS1 49 ; 50 ;Jump to LBL 99 51 FN 9: IF +1 EQU +1 GOTO LBL 99 52 ; 53 ;LBL 12 jump label 54 LBL 12 55 ;Increment the row number by two 56 Q2 = Q2 + 2 57 ; 58 ;Read out the row Q2 column "Range" of the table 59 FN 28: TABREAD Q3 =Q2 /"BEREICH" 60 ; 61 ;Jump to LBL 11 62 FN 9: IF +1 EQU +1 GOTO LBL 11 63 ; 64 ;LBL 99 jump label 65 LBL 99 66 ; 67 ;Calculate the maximum dimension in mm 68 Q2 = Q1 + ( Q4 / 1000 ) 69 ; 70 ;Calculate the minimum dimension in mm 71 Q3 = Q1 + ( Q5 / 1000 ) 72 ; 73 ;Combine the text for the fit 74 QS2 = TOCHAR( DAT+Q1 DECIMALS0 ) || QS1 75 ; 76 ;Display the content of the mask file 82502_en.a on the screen 77 FN 16: F-PRINT 82502_en.A / SCREEN: 78 ; 79 ;End of program 80 END PGM 82501_en MM