0 BEGIN PGM 9050_en MM 1 ;The program combines a counter with an 2 ;engraving program. The counter function 3 ;is realized with a table so that the current 4 ;value does not get lost when the control is 5 ;is shut down. At program start, the value 1 6 ;has to be entered in the table line 0 and 7 ;column Q1. The control reads this value, 8 ;converts it to string, combines it with 9 ;another string and engraves the combined text 10 ;on the workpiece. Then the control compares 11 ;the number of finished workpieces with a 12 ;number of desired operations you defined at 13 ;program start. If this number has been 14 ;reached, a message appears and the counter 15 ;is reset. If the number has not yet been 16 ;reached, the control increases the count by 17 ;one and saves the new value in the table. 18 ;!Program runs in the Test Run mode are 19 ;counted by the workpiece counter! 20 ; 21 BLK FORM 0.1 Z X+0 Y+0 Z-10 22 BLK FORM 0.2 X+100 Y+100 Z+0 23 ; 24 ;Entry of the number of operations 25 Q10 = 10 ;Number to be completed 26 ; 27 ;Open table 90502_en 28 FN 26: TABOPEN 90502_en.tab 29 ; 30 ;Read value from column Q1 31 FN 28: TABREAD Q1 =0 /"Q1" 32 ; 33 ;Tool call for engraver 34 TOOL CALL 200 Z S9000 F300 35 ; 36 L X+20 Y+45 R0 FMAX M3 ;Pre-position to text starting point 37 ; 38 ;Define engraving text 39 ;Define text parts as string 40 DECLARE STRING QS2 = "Part No:" 41 ;Convert value from Q1 in string 42 QS1 = TOCHAR( DAT+Q1 DECIMALS0 ) 43 ;Join strings for engraving text 44 QS3 = QS2 || QS1 45 ; 46 ;Define engraving cycle 47 CYCL DEF 225 ENGRAVING ~ QS500= QS3 ;ENGRAVING TEXT ~ Q513=+10 ;CHARACTER HEIGHT ~ Q514=+0 ;SPACE FACTOR ~ Q515=+0 ;FONT ~ Q516=+0 ;TEXT ARRANGEMENT ~ Q374=+0 ;ANGLE OF ROTATION ~ Q517=+50 ;CIRCLE RADIUS ~ Q207=+500 ;FEED RATE FOR MILLNG ~ Q201=-0.5 ;DEPTH ~ Q206=+150 ;FEED RATE FOR PLNGNG ~ Q200=+2 ;SET-UP CLEARANCE ~ Q203=+0 ;SURFACE COORDINATE ~ Q204=+50 ;2ND SET-UP CLEARANCE 48 M99 ;Call the cycle 49 ; 50 ; 51 FN 0: Q2 =+Q1 ;Define the comparison value 52 Q1 = Q1 + 1 ;Update the counter 53 FN 12: IF +Q2 LT +Q10 GOTO LBL 98 ;Jump if quantity not yet reached 54 STOP 55 ; 56 ;Message on screen that the number to be 57 ;finished has been reached 58 FN 16: F-PRINT 90501_en.a / Screen: 59 ;Reset the counter and write to the table 60 Q1 = 1 61 FN 27: TABWRITE 0 /"Q1" = Q1 62 ;Go to end of program 63 FN 9: IF +0 EQU +0 GOTO LBL 99 64 ; 65 LBL 98 66 ;Write current counter value to the table 67 FN 27: TABWRITE 0 /"Q1" = Q1 68 ; 69 ;End of program 70 LBL 99 71 M30 72 END PGM 9050_en MM