// ---------------------------------------- // // 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. // ---------------------------------------- // // Machine: FADAL VMC with A-Axis // Control: FADAL 88HS // Original Date: 7-27-1998 // REVISED Date 11-15-2000 // added variable peck depth for drilling // perfected indexing callouts, cleaned up code output, added #S1 to prg. number // Designed for SmartCam V11.5, using .pm4 & .jof // Supported Functions: // Always codes out to E1 work plane, only for 4th axis programs // G-Codes (Preparatory Functions) // G0 Positioning mode // G1 Linear interpolation (contouring) // G2 Clockwise circular interpolation // G3 Counter clockwise circular interpolation // G4 Dwell // G17 X, Y plane // G18 X, Z plane // G19 Y, Z plane // G40 Tool radius compensation cancel // G41 Tool radius compensation, left // G42 Tool radius compensation, right // G73 Pecking cycle, chip break only // G74 Left hand Tapping, with Reversal, Tension-compresion holder // G80 Cancel fixed cycle // G81 Drilling cycle // G82 Spot drill cycle // G83 Pecking cycle, full withdrawl // G84 Tapping cycle, with reversal, Tension-compression holder // G84.1 RIGID TAPPING // G85 TapMatic taping cycle // G85 Boring cycle // G88 Boring cycle with dwell at bottom of hole // G90 Absolute positioning mode // G91 Incremental positioning mode // G94 IPM Feed Rate Mode // G95 IPR Feed Rate Mode // G96 Constant Surface speed on // G97 Constant Surface speed off (Direct RPM programming) // G98 Fixed cycle return level // G99 Fixed cycle return level // M-Codes (Miscellaneous Functions) // M3 Spindle on CW // M4 Spindle on CCW // M5 Spindle Stop // M6 Tool Change // M7 Coolant on - Mist // M8 Coolant on - Flood // M9 Coolant off // M30 End of program / rewind tape // // VARIABLES USED IN TEMPLATE FILE // //#V0=variable used in profile start, not sure of use //#V1=initial peck value //#V2=reducing peck value per peck //#V3=minimum peck value 1/4 of tool dia. //#V4=used in indexing section for shortest path logic //#V5=used in cycles to adjust #zcheck for tapping clearance //#V6=used in cycles to adjust feed rate //#V7=used to add .2 to RPM for rigid tapping cycle //#V9=switch used for exiting sections early //#U1=forces x and y position to output on cycles //#U2=(0) A-AXIS BRAKE ON //#U2=(1) A-AXIS BRAKE OFF //#U3= used in indexing shortest path logic //#S1=program number, set in job notes //#S2=additional notes to be printed after part description //#S3=additional notes to be printed after part description //#S4=additional notes to be printed after part description //#S5=additional notes to be printed after part description @DECLARE #STR #StepDesc #STR #PARTDESC #STR #TM_NOTE #STR #STPNOTE @ // PROGRAM START @START % #ONBLK #IF(#S1=0)#ELSE (#DATE) (#SYSTIME) (FILENAME = #FILE) #EVAL(#PARTDESC=jos(prt_desc)) (#PARTDESC) <(#S2)> <(#S3)> <(#S4)> <(#S5)> #IF(#NTOOL<>#TOOL)< T#TOOL M6> ( #TDESC ) #EVAL(#TM_NOTE=jos(tm_notes) #IFSTR(#TM_NOTE<>)<(TOOL NOTES: #TM_NOTES)> #EVAL(#StepDesc=jos(st_desc)) (STEP DESC.: #StepDesc) #EVAL(#STPNOTE=jos(st_notes) #IFSTR(#STPNOTE<>)<(STEP NOTES: #STPNOTE)> #EVAL(#U1=1) // #U1 sets switch for fixed cycles to reset x and y position for first hole #EVAL(#V7=#SPEED+.2) #EVAL(#CYCLE=jos(cycle)) #IF(#CYCLE=3,#AND#TLTYPE=4)#ELSE #IF(#CYCLE=3,#AND#TLTYPE=4)< G84.2> #IF(#CYCLE<>3)< #SPNDL S#SPEED> #MOV X#XPOS Y#YPOS A#INDXA M60 (CLAMP A-AXIS) G43 H#LOFF D#DOFF Z#ZPOS #COOLNT // TOOL CHANGES @TOOLCHG #RESET(#FXD) < #FXD> M9 M5 #MOV G28 G91 Z0 T#TOOL M6 ( #TDESC ) M1 #EVAL(#TM_NOTE=jos(tm_notes) #IFSTR(#TM_NOTE<>)<(TOOL NOTES: #TM_NOTES)> #EVAL(#StepDesc=jos(st_desc)) (STEP DESC.: #StepDesc) #EVAL(#STPNOTE=jos(st_notes) #IFSTR(#STPNOTE<>)<(STEP NOTES: #STPNOTE)> #EVAL(#U1=1) // sets switch for fixed cycles to reset for first hole #EVAL(#V7=#SPEED+.2) #EVAL(#CYCLE=jos(cycle)) #IF(#CYCLE=3,#AND#TLTYPE=4)#ELSE #IF(#CYCLE=3,#AND#TLTYPE=4)< G84.2> #IF(#CYCLE<>3)< #SPNDL S#SPEED> #MOV X#XPOS Y#YPOS A#INDXA < M60 (CLAMP A-AXIS)> G43 H#LOFF D#DOFF #IF(#WKSCHG<>1)< Z#ZPOS>#ELSE< Z#ZHOME> #COOLNT @ //STEP CHANGE WITHOUT TOOL CHANGE @STEPCHG #UPDATE(#FXD) < #FXD>< S#SPEED><#COOLNT> #EVAL(#StepDesc=jos(st_desc)) (#StepDesc) @ //COOLANT CODE TABLE FOR COOLANT @COOLNT 0,M9 1,M8 2,M7 // AT PROGRAM END @END G80 M9 M5 G00 G28 G91 Z0 Y0 (TOTAL CYCLE TIME = #CYTIME MIN.) T#NTOOL M6 M30 #OFFBLK % //SUBROUTINE DEFINITIONS @SUBDEF O#SNAME (SUBDEF,#SNAME, NOTE USED BY #FILE) #ONBLK #ABSI @ENDDEF G90 M99 #OFFBLK @GOSUB M98 P#SNAME L#SREPT< T#NTOOL> #ABSI // AT DRILL SUBROUTINE @FXDDEF < X#XPOS>< Y#YPOS> // A-AXIS INDEXING AND/OR FIXTURE LOCATION CHANGE @TPINDX #IF(#WKSCHG=1)<#EXIT> #EVAL(#U1=1) #MOV #ABSI #FXD Z#ZHOME(CLEARANCE POINT) ( INDEX TO A#INDXA DEGREES) A#INDXA #IF(#U2=1)<#EXIT> M60 (A-AXIS BRAKE ON) // AT PROFILE STARTS @STPROF #EVAL(#V0=#ZPOS-#ZST) #IF(#V0>=0)<#CALL(Z)>#ELSE<#CALL(XY)> //AT PROFILE ENDS @ENDPROF << #MOV> Z#ZPOS> < #DCOMP> // AT POSITIONING MOVES @RAP #EVAL(#V0=#ZPOS-#ZST) #IF(#V0>=0)<#CALL(Z)>#ELSE<#CALL(XY)> @Z < #PLANE>< #ABSI>< #FXD>< #MOV>< Z#ZPOS> < X#XPOS>< Y#YPOS> @XY < #PLANE>< #ABSI>< #FXD>< #MOV>< X#XPOS>< Y#YPOS> < Z#ZPOS> @LINE < #DCOMP < #PLANE>>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< F#FEED> @ARC < #PLANE>< #MOV>< X#XPOS>< Y#YPOS>< I#XCTR>< J#YCTR>< F#FEED> @XZARC < #PLANE>< #MOV>< X#XPOS>< Z#ZPOS>< I#XCTR>< K#ZCTR>< F#FEED> @YZARC < #PLANE>< #MOV>< Y#YPOS>< Z#ZPOS>< J#YCTR>< K#ZCTR>< F#FEED> //HELICAL FEED MOVES @HELIX #IF(#U1=1)<#RESET(#XPOS,#YPOS)#EVAL(#U1=0)> < #PLANE> #MOV X#XPOS Y#YPOS Z#ZPOS I#XCTR J#YCTR< F#FEED> (HELICAL MOVE) @XZHELIX < #PLANE> #MOV< X#XPOS> Y#YPOS < Z#ZPOS> I#XCTR K#ZCTR< F#FEED> @YZHELIX < #PLANE> #MOV X#XPOS< Y#YPOS>< Z#ZPOS> J#YCTR K#ZCTR< F#FEED> @ZCLRMV < #ABSI>< #FXD><< #MOV> Z#ZPOS> @ZCHKMV < #FXD><< #MOV> Z#ZPOS>< #PLANE> @ZDPTHMV << #MOV> Z#ZPOS< F#FEED>>< #PLANE> @ // ream and drill (no dwell) @OP_REAM #CALL(OP_DRL) @OP_DRL #IF(#U1=1)<#RESET(#CYCLE,#XPOS,#YPOS,#FEED)#EVAL(#U1=0)> < #ABSI>< #CYCLE>< #RTNLVL>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK> #UPDATE(#FXD) @@CYCLE 0, G81 @ // spot drill, center drill, counter bore, counter sink, spot face w/dwell @OP_CSINK #CALL(OP_SPFACE) @OP_CDRL #CALL(OP_SPFACE) @OP_SPDRL #CALL(OP_SPFACE) @OP_CBORE #CALL(OP_SPFACE) @OP_SPFACE #IF(#U1=1)<#RESET(#CYCLE,#XPOS,#YPOS)#EVAL(#U1=0)> < #ABSI>< #CYCLE>< #RTNLVL>< X#XPOS>< Y#YPOS>#EXLN < Z#ZDPTH R#ZCHK>< P#DWELL>< F#FEED> #UPDATE(#FXD) @@CYCLE 0,G82 @ // peck drill full or partial retract (no dwell) @OP_PDRL #IF(#U1=1)<#RESET(#CYCLE,#XPOS,#YPOS)#EVAL(#U1=0)> #IFCHG(#CYCLE)<#RESET(#XPOS,#YPOS)> #EVAL(#V9=0) #IF(#CYCLE=2, #OR#CYCLE=3)<#CALL(SP_PECK)> #IF(#V9=1)<#EXIT> < #ABSI>< #CYCLE>< #RTNLVL>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>#EXLN < Q#PECK> < F#FEED> #UPDATE(#FXD) @@CYCLE 0,G83 1,G73 @ @SP_PECK //peck drilling cycle using I J K for reducing peck per step #EVAL(#V1=jos(pekdpth1))//initial peck value #EVAL(#V2=jos(pekdpth2))//reducing peck value per peck #EVAL(#V3=jos(tl_dia)/4)//minimum peck value 1/4 of tool dia. #IF(#U1=1)<#RESET(#XPOS,#YPOS)#EVAL(#U1=0)> #IFCHG(#CYCLE)<#RESET(#XPOS,#YPOS)> #EVAL(#V9=1)//sets value to exit op_pdrl section < #ABSI>< #CYCLE>< #RTNLVL>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>#EXLN I#V1 J#V2 K#V3 < F#FEED> #UPDATE(#FXD) @@CYCLE 2,G83 3,G73 @ // tap @OP_TAP // Use G74/G84 (M04=left hand tapping) or G84.1 (Rigid tapping cycle) or G85(for tapmatic cycle) #IF(#U1=1)<#RESET(#CYCLE,#XPOS,#YPOS)#EVAL(#U1=0)> #IFCHG(#CYCLE)<#RESET(#XPOS,#YPOS)> // set the R0 value to .300" higher than level in model, for tapping clearance #EVAL(#V5=#ZCHK+.3) #EVAL(#V9=0) //set feed rate to 95% to allow for extension of tapping heads #EVAL(#V6=#FEED*.95) #EVAL(#CYCLE=jos(cycle)) #IF(#CYCLE=3)<#CALL(RIGIDTAP)> #IF(#V9=1)<#EXIT> < #ABSI>< #CYCLE>< #RTNLVL>< X#XPOS>< Y#YPOS>< Z#ZDPTH>< R#V5>< F#FMT(#V6,D3.1)>< S#SPEED> #UPDATE(#FXD) @@CYCLE 0,G84 1,G74` 2,G85 3,G84.1 @ @RIGIDTAP #IF(#U1=1)<#RESET(#CYCLE,#XPOS,#YPOS)#EVAL(#U1=0)> #IFCHG(#CYCLE)<#RESET(#XPOS,#YPOS)> // sets the R0 value to .300" higher than level in model, for tapping clearance #EVAL(#V5=#ZCHK+.3) #EVAL(#V9=1) #ABSI #CYCLE #RTNLVL X#XPOS Y#YPOS Z#ZDPTH R#V5 F#FEED S#SPEED #UPDATE(#FXD) @@CYCLE 3,G84.1 @ // bore (dwell for cycle > 1) @OP_SPEC #CALL(OP_BORE) @OP_BORE #IF(#U1=1)<#RESET(#CYCLE,#XPOS,#YPOS)#EVAL(#U1=0)> #IFCHG(#CYCLE)<#RESET(#XPOS,#YPOS)> < #ABSI>< #CYCLE>< #RTNLVL>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>#EXLN #IF(#CYCLE>0)<< P#DWELL>> < F#FEED> #UPDATE(#FXD) @@CYCLE 0,G85 1,G88 @ // FIXED CYCLES @FXD1 < #ABSI>< #RTNLVL #FXD F#FEED> X#XPOS Y#YPOS < Z#ZDPTH R#ZCHK>< S#SPEED> @FXD2 < #ABSI>< #RTNLVL #FXD F#FEED> X#XPOS Y#YPOS < Z#ZDPTH R#ZCHK P#DWELL>< S#SPEED> @FXD3 < #ABSI>< #RTNLVL #FXD F#FEED> X#XPOS Y#YPOS < Z#ZDPTH R#ZCHK>< S#SPEED> @FXD4 < #ABSI>< #RTNLVL #FXD F#FEED> X#XPOS Y#YPOS < Z#ZDPTH R#ZCHK> @FXD5 < #ABSI>< #RTNLVL #FXD F#FEED> X#XPOS Y#YPOS < Z#ZDPTH R#ZCHK Q#PECK> @DWELL G04 P#DWELL#EVAL(#TIME=#DWELL/60) @