O20000(ATC Program) (Record the workpiece position before ATC) #2 = #880 #3 = #881 #4 = #882 #5 = #883 #1514 = 1 //Pause and lift up Enabled (Judge to excute the ATC or not) IF #1300>#1301 GOTO4; When current tool no. is greater then the magazine capacity then exit from ATC program. IF #1>#1301 GOTO4; Target Tool no. is greater than the magazine capacity then exit from ATC program. IF #1302==0 GOTO4; Magazine type is NULL then exit. IF #1300==#1 GOTO4; If current tool no. is same as the target tool no. then exit. IF #720 == 0 GOTO50; (Judge by the sign of each axis Home) IF [#1515+#1516+#1517]>=3 GOTO50; #1503 = 1(X.Y,ZX, Y, Z axis didn't Home All.) G04 P10 GOTO4 ;XYZ didn't Home then exit N50 (Judge the magzine type) IF #1302==1 GOTO4; If the Magazine type is "Multiple", exit. IF #1302==2 GOTO22; If magazine type is "Follow row" then excute the "Follow row" ATC IF #1302==3 GOTO23; If magazine type is "Fixed row" then excute the "Fixed row" ATC IF #1302==4 GOTO4; If magazine type is "Servo disc" then excute the "Servo disc" ATC N17; IF #1302==1 GOTO4; If the Magazine type is "Multiple", exit. IF #1302==2 GOTO32; If magazine type is "Follow row" then excute the "Follow row" ATC IF #1302==3 GOTO33; If magazine type is "Fixed row" then excute the "Fixed row" ATC IF #1302==4 GOTO4; If magazine type is "Servo disc" then excute the "Servo disc" ATC (---------------ATC of Follow Row starts-----------------) N22 IF#1300 == 0 GOTO17; If current tool no. is 0, then only excute tool change movements. #1503 = 1(Excute the "Follow row" ATC!) M05 //Spindle Stop M09 //Coolant Stop M300 //Air pressure detection M152 //Magazine Open M303 //Magazine open detection #1503 = 1(Spindle lift up to the highest position when ATC, speed: Para #812) G53 Z#1306 F#1312 ; Spindle lift up to highest position when ATC #1503 = 1(Spindle move to the G53 X&Y position of Current tool, Speed: Para #811) G53 X[#[1330+#1300-1]]F#1311 ; G53 Y[#[1350+#1300-1]]F#1311 ; #1503 = 1(Spindle move to the G53 Z position of Current tool, Speed: Para #819) G53 Z[#[1370+#1300-1]] F#1319 ; M300 //Air pressure detection M154 //Spindle Release the tool G04 P#1314 M301 //Spindle release signal detection #1300 = 0 ;Update the curent tool no. to 0 #1503 = 1(Spindle lift up to the highest position when ATC, speed: Para #812) G53 Z#1306 F#1312 ;Spindle lift up to highest position when ATC IF #1!=0 GOTO17; Target tool no. is not 0, excute ATC GOTO5; Follow row tool uploading finished (---------------Uploading Tool for Follow row ATC Finished-----------------) (---------------Changing tool of Follow Starts-----------------) N32 M05 // Spindle Stop M09 // Coolant Stop M300 // Air pressure detection M154 // Spindle Release the tool G04 P#1314 M301 // Spindle release signal detection #1503 = 1(Spindle lift up to the highest position when ATC, speed: Para #812) G53 Z#1306 F#1312 ; Spindle lift up to highest position when ATC #1503 = 1(Spindle moves to the G53 X&Y position of Current tool, Speed: Para #811) G53 X[#[1330+#1-1]] Y[#[1350+#1-1]] F#1311 ; #1503 = 1(Spindle moves to the G53 Z position of Current tool, Speed: Para #819) G53 Z[#[1370+#1-1]]+10 F#1319 ; G53 Z[#[1370+#1-1]] F1000 ; M300 // Air pressure detection M155 // Tool locked G04 P#1314 M302 // Tool locked signal detection #1300 = #1; update the curent tool no. to target tool no. #1503 = 1( Spindle lift up to the highest position when ATC, speed: Para #812) G53 Z#1306 F#1312 ; Spindle lift up to highest position when ATC GOTO5; Follow row ATC finished (--------------- Follow row ATC finished-----------------) (--------------- Tool uploading for Fixed row starts-----------------) N23 IF#1300 == 0 GOTO17; If current tool no. is 0, then only excute tool change movements. #1503 = 1(Fixed row ATC starts!) M05 //Spindle Stop M09 //Coolant Stop M300 //Air pressure detection M152 //Magazine open M303 //Magazine open signal detection #1503 = 1(Spindle lift up to the highest position when ATC) G53 Z#1306 F#1311 ;Spindle lift up to highest position when ATC #1503 = 1(Spindle moved to Y-axis tool change front Mach position) G53 Y#1309 F#1311 ;Y怄Spindle moved to Y-axis tool change front Mach position #1503 = 1(Spindle moved to X-axis tool change front Mach position) G53 X[#[1330+#1300-1]] F#1311 ;X-axis tool change front Mach position #1503 = 1(Spindle moved to Z-axis tool change front Mach position) G53 Z[#[1370+#1-1]] F#1319 ; #1503 = 1(Spindle moves to Y-axis mach of the current tool position) G53 Y[#[1350+#1300-1]] F#1313 ; Y axis Mach position M300 //Air pressure detection M154 //Tool release G04 P#1314 M301 //Tool release signal detection #1300 = 0 ; update the current tool no. to 0 #1503 = 1(Spindle lift up to the highest position when ATC, speed: Para #812) G53 Z#1306 F#1312 ;Spindle lift up to the highest position when ATC IF #1!=0 GOTO17;Target tool no. is not 0, excute ATC GOTO5;Tool uploading for Fixed row finished. (---------------Tool uploading for Fixed row finished-----------------) (---------------ATC of Fix row change tool starts-----------------) N33 M05 // Spindle Stop M09 // Coolant Stop M300 // Air pressure detection M154 // Tool release G04 P#1314 M301 // Tool release signal detection #1503 = 1(Spindle lift up to the highest position when ATC) G53 Z#1306 F#1312 ; Spindle lift up to the highest position when ATC #1503 = 1(Spindle move to the G53 X&Y position of Current tool) G53 X[#[1330+#1-1]] Y[#[1350+#1-1]] F#1311 ; #1503 = 1(Spindle moves to the G53 Z position of Current tool) G53 Z[#[1370+#1-1]]+10 F#1319 ; G53 Z[#[1370+#1-1]] F1000 ; M300 // Air pressure detection M155 // Tool locked G04 P#1314 M302 // Tool locked signal detection #1300 = #1; Update the current no. to the target tool no. #1503 = 1( Spindle moved to Y-axis tool change front Mach position) G53 Y#1309 F#1313 ; Spindle moved to Y-axis tool change front Mach position #1503 = 1( Spindle lift up to the highest position of ATC) G53 Z#1306 F#1311 ; Spindle lift up to the highest position of ATC GOTO5; Fix Row ATC finished (---------------ATC of Fix Row finished-----------------) N5 #1300 = #1; Update the target tool no. IF #1315==0 GOTO6; Judge if back to the orignal position before ATC when ATC is fnished. #1503 = 1(Spindle lift up to the highest position when ATC, speed: Para #812) G53 Z#1306 F#1311 ;Spindle lift up to the highest position when ATC #1503 = 1(back to the XY orignal position before ATC when ATC is fnished) G90 G53 Y#3 F#1311 G90 G53 X#2 F#1311 N6 IF #1300==0 GOTO3; The current tool no. is 0, then don't excute probing automatically. IF #1305==0 GOTO3; If probe after ATC not active, then don't excute probing automatically. G53 Z#1306 F#1311 G90 G53 Y#3 F#1311 G90 G53 X#2 F#1311 #1503 = 1(Probing automatically) #1502=2; The second time fix probe. M98P502 N3 #1300 = #1;Update the target tool no. IF #1993==1 GOTO4; M153 N4 #1514 = 0//Pause Sign #1503 = 1000 // Clear assist sign M99