// ---------------------------------------- // // The following SmartCAM code generator has been // created to generate NC code for the respective // machine and control combinations listed below. // // Due to differences in programming styles, // controller versions, and optional equipment, // SmartCAMcnc DOES NOT and CANNOT guarantee // that the NC code generated is correct for any // specific machine. Some modification to the code // generator to match your setup and output // requirements is likely necessary. // // Modifications to code generators do not TYPICALLY // require a significant amount of time. SmartCAM // customers with active SMA contracts are entitled // to support for their code generators from the // SmartCAMcnc Support Group. To contact them for // support, please send an email to: // Support@SmartCAMcnc.com. If you would like // information on purchasing SMA for your SmartCAM // products, please contact: Sales@SmartCAMcnc.com // // DISCLAIMER: It is the responsibility of the end // user to confirm and verify that the NC code // created by any code generator is accurate and // will not cause a machine malfunction which // could result in stock, tooling, machine, and/or // personal injury. // // SmartCAMcnc assumes no responsibility or // liability for any damage caused or alleged to // have been caused by the use of any of the code // generators it provides. // ---------------------------------------- @COMMENTS Machine: Mazak Mazatech H-400 Horizontal Machining Center Control: Mazak Mazatrol M-32 CNC Control @DECLARE //#OUTCND// outputs conditional status //#OUTSEC// outputs @section names //#OUTREF// outputs processing errors //#OUTRPT// outputs an error report file @ @START #IF(#INDXC=0)<#EVAL(#C0=0)> #IF(#INDXC=90)<#EVAL(#C0=1)> #IF(#INDXC=180)<#EVAL(#C0=2)> #IF(#INDXC=270)<#EVAL(#C0=3)> #IF(#INDXC<>0,AND#INDXC<>90,AND#INDXC<>180,AND#INDXC<>270)<#EVAL(#C0=4)> % O#FILE #ONBLK #PLANE G40 G49 #ABSI G28 G91 X0.0 Y0.0 Z0.0 T#TOOL M6 T0 M0 T#NTOOL#OFFBLK (T#TOOL #TDESC #TLCMT) #ONBLK G28 G91 X0.0 Y0.0 Z0.0 M8 #MOV #C0 X#XPOS Y#YPOS Z#ZPOS B#INDXC S#SPEED F#FEED #SPNDL @ @TPINDX #IF(#INDXC=0)<#EVAL(#C0=0)> #IF(#INDXC=90)<#EVAL(#C0=1)> #IF(#INDXC=180)<#EVAL(#C0=2)> #IF(#INDXC=270)<#EVAL(#C0=3)> #IF(#INDXC<>0,AND#INDXC<>90,AND#INDXC<>180,AND#INDXC<>270)<#EVAL(#C0=4)> #NEXTPT #MOV #C0 X#XPOS Y#YPOS Z#ZPOS B#INDXC @ @TOOLCHG #IF(#INDXC=0)<#EVAL(#C0=0)> #IF(#INDXC=90)<#EVAL(#C0=1)> #IF(#INDXC=180)<#EVAL(#C0=2)> #IF(#INDXC=270)<#EVAL(#C0=3)> #IF(#INDXC<>0,AND#INDXC<>90,AND#INDXC<>180,AND#INDXC<>270)<#EVAL(#C0=4)> < #FXD> M9 #MOV G91 G28 X0.0 Y0.0 Z0.0 M1 M6 T#LTOOL #EVAL(#U1=INT(#TLTIME)) #EVAL(#U2=#TLTIME-#U1) #EVAL(#U0=#U2*60) #OFFBLK(T#FMT(#LTOOL,T2.0) EST.TIME:#EXLN #IF(#U1>0)< #FMT(#U1,T3.0) MIN.> #FMT(#U0,T2.0) SEC.)#ONBLK < T#NTOOL>#OFFBLK (T#TOOL #TDESC #TLCMT) #ONBLK G28 G91 X0.0 Y0.0 Z0.0 M8 #MOV #C0 X#XPOS Y#YPOS Z#ZPOS B#INDXC S#SPEED F#FEED #SPNDL @ @END < #FXD> M9 G0 G91 G28 X0.0 Y0.0 Z0.0 M1 T0 M6 T0 #EVAL(#U1=INT(#TLTIME)) #EVAL(#U2=#TLTIME-#U1) #EVAL(#U0=#U2*60) #OFFBLK(T#FMT(#LTOOL,T2.0) EST.TIME:#EXLN #IF(#U1>0)< #FMT(#U1,T3.0) MIN.> #FMT(#U0,T2.0) SEC.) #EVAL(#U1=INT(#CYTIME)) #EVAL(#U2=#CYTIME-#U1) #EVAL(#U0=#U2*60) (TOTAL EST.TIME:#EXLN #IF(#U1>0)< #FMT(#U1,T3.0) MIN.> #FMT(#U0,T2.0) SEC.)#ONBLK M30 #OFFBLK% @ @SUBDEF % O#SNAME #ONBLK #ABSI @ @ENDDEF M99 #OFFBLK% @ @GOSUB M98 P#SNAME L#SREPT @ @STPROF < #ABSI>< #FXD>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS> #RESET(#DOFF) @ @ENDPROF < #MOV Z#ZPOS> < #DCOMP> @ @RAP < #ABSI>< #FXD>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS> @ @LINE < #PLANE>< #MOV>< #DCOMP#EXC< D#DOFF>>< X#XPOS>< Y#YPOS>< Z#ZPOS>< F#FEED> @ @ARC #IF(#TANG=360,OR#TANG=-360) << #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< I#XCTR>< J#YCTR>< F#FEED>> #ELSE<< #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< R#ARAD>< F#FEED>> @ @XZARC #IF(#TANG=360,OR#TANG=-360) << #PLANE>< #MOV>< X#XPOS>< Z#ZPOS>< I#XCTR>< K#ZCTR>< F#FEED>> #ELSE<< #PLANE>< #MOV>< X#XPOS>< Z#ZPOS>< R#ARAD>< F#FEED>> @ @YZARC #IF(#TANG=360,OR#TANG=-360) << #PLANE>< #MOV>< Y#YPOS>< Z#ZPOS>< J#YCTR>< K#ZCTR>< F#FEED>> #ELSE<< #PLANE>< #MOV>< Y#YPOS>< Z#ZPOS>< R#ARAD>< F#FEED>> @ @HELIX #IF(#TANG=360,OR#TANG=-360) << #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< I#XCTR>< J#YCTR>< F#FEED>> #ELSE<< #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< R#ARAD>< F#FEED>> @ @XZHELIX #IF(#TANG=360,OR#TANG=-360) << #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< I#XCTR>< K#ZCTR>< F#FEED>> #ELSE<< #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< R#ARAD>< F#FEED>> @ @YZHELIX #IF(#TANG=360,OR#TANG=-360) << #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< J#YCTR>< K#ZCTR>< F#FEED>> #ELSE<< #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< R#ARAD>< F#FEED>> @ @ZCLRMV < #ABSI>< #FXD><< #MOV> Z#ZPOS> @ @ZCHKMV < #FXD><< #MOV> Z#ZPOS> @ @ZDPTHMV << #MOV> Z#ZPOS< F#FEED>> @ @OP_DRL < #ABSI>< #CYCLE>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> @@CYCLE 0,G81 @ @OP_SPDRL < #ABSI>< #CYCLE>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK P#DWELL>< F#FEED> @@CYCLE 0,G82 @ @OP_TAP < #ABSI>< #CYCLE>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> @@CYCLE 0,G84 @ @OP_BORE < #ABSI>< #CYCLE>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> @@CYCLE 0,G76 @ @OP_PDRL #EVAL(#PECK=#TLDIA/2) < #ABSI>< #CYCLE>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK Q#PECK>< F#FEED> @@CYCLE 0,G83 @ @DWELL G4 P#DWELL#EVAL(#TIME=#DWELL/60) @