// ---------------------------------------- // // 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. // ---------------------------------------- @VARIABLES U0 = 1 :: WHEN ON IS A DEBUG SECTION LABEL OUTPUT SWITCH U1 = #U1 :: speed value integer for high low clutch U2 = #U2 :: flag for changing format from tlchg or start U3 = #U3 :: holds tap cycle depth U4 = #U4 :: holds early exit switch from cyclchg and wrap U5 = #U5 :: holds early exit for wrap elemnt processing V1 = #V1 :: holds the Zpos of a hole plus Zchk of .100 V3 = #V3 :: holds accumulated line length of cut off line element ....... canned cycle variables ........... v60// total hole depth v63// peck increment v64// drill clearance ( machine default = 0.1 ) v65// drill clearance break chip ( machine default = 0.05 ) v66// drill re-entry clearance ( machine default = 0.03 ) v67// drill feedrate //@DECLARE // #DEC #my_decimal_var // #INT #my_integer_var @START #EVAL(#U0=0) #IF(#U0=1)<( ******************** start ***************** )> #FILE #DATE #SYSTIME % #ONBLK G90 G1 X2. Y3. Z#ZHOME A#INDXA R #OFFBLK #IF(#SPEED>400)<#EVAL(#U1=INT((#SPEED/7000)*100))>// HI SPEED CALCULATION #IF(#SPEED<=400)<#EVAL(#U1=INT((#SPEED/7000)*175))>// LO SPEED CALCULATION -------------- TOOL #TOOL OFFSET #DOFF -------------- PROG. TOOL DIA = #TLDIA #IF(#SPEED>400)< HI SPEED BELT = #SPEED RPM> #IF(#SPEED<=400)< LO SPEED BELT = #SPEED RPM> #ONBLK T#TOOL M6 G48 R M3 M8 S#FMT(#U1,T3.0) G4X3.0 #RESET(#ZPOS) #EVAL(#U2=1)// used in the startprof section @TOOLCHG #IF(#U0=1)<( ******************** toolchg ***************** )> < #FXD> Z#ZHOME R M5M9 < X#XHOME>< Y#YHOME> R G49 R #OFFBLK #IF(#SPEED>400)<#EVAL(#U1=INT((#SPEED/7000)*100))>// HI SPEED CALCULATION #IF(#SPEED<=400)<#EVAL(#U1=INT((#SPEED/7000)*175))>// LO SPEED CALCULATION -------------- TOOL #TOOL OFFSET #DOFF -------------- PROG. TOOL DIA = #TLDIA #IF(#SPEED>400)< HI SPEED BELT = #SPEED RPM> #IF(#SPEED<=400)< LO SPEED BELT = #SPEED RPM> #ONBLK M1 T#TOOL M6 G48 R M3 M8 S#FMT(#U1,T3.0) G4X3.0 < Z#ZPSET R> #EVAL(#U2=1)// used to test and reset zpos in stprof & fxd sections #EVAL(#U5=0)// for wrap junk //@STEPCHG //#IF(#U0=1)<( ******************** stepchg ***************** )> // this section may be used // remember that no toolchange happens during one step @TPINDX #IF(#U0=1)<( ******************** tpindx ***************** )> < #FXD> Z#ZSTR// this is the last retract zposition < A#INDXA#RFEED> // if you dont want the following message just remove them. #OFFBLK ------------------- INDEX POSITION TO A#INDXA DEGREES ------------ #ONBLK < X#XPSET>< Y#YPSET>< Z#ZPSET>R @END < #FXD> < #DCOMP> Z#ZHOMEA0.R M5M9G49R M7 X#XHOMEY#YHOMERM9 G49R M30 #OFFBLK% @STPROF #IF(#U0=1)<( ******************** stprof ***************** )> #IF(#U2=1)<< #ABSI>< X#XPOS>< Y#YPOS>#RFEED> #IF(#U2=0)<< #ABSI>< #FXD>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< F#FEED>> #EVAL(#U2=0) @ENDPROF #IF(#U0=1)<( ******************** endprof ***************** )> < #DCOMP>< X#XPOS>< Y#YPOS>< Z#ZPOS>< F#FEED> #IF(#U4=2)< G25A#WRAD G131 #MOV Y#V3 Z#ZPOS G130> @RAP #IF(#U0=1)<( ******************** rap ***************** )> < #FXD> < Z#ZPOS #RFEED> < X#XPOS Y#YPOS #RFEED> @LINE #IF(#U0=1)<( ******************** line ***************** )> #IF(#WRAD<=0)<< #PLANE>< #DCOMP#EXC D#DOFF>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS>< F#FEED>> @ARC #IF(#U0=1)<( ******************** arc ***************** )> < #PLANE>< #MOV>< X#XPOS>< Y#YPOS> I#XCTR J#YCTR< F#FEED> @XZARC #IF(#U0=1)<( ******************** xzarc ***************** )> <#PLANE><#MOV>I#XCTRK#ZCTR @YZARC #IF(#U0=1)<( ******************** yzarc ***************** )> <#PLANE><#MOV>J#YCTRK#ZCTR @HELIX #IF(#U0=1)<( ******************** helix ***************** )> <#PLANE>#MOVZ#ZPOSI#XCTRJ#YCTR @XZHELIX #IF(#U0=1)<( ******************** xzhelix ***************** )> <#PLANE>#MOVY#YPOSI#XCTRK#ZCTR @YZHELIX #IF(#U0=1)<( ******************** yzhelix ***************** )> <#PLANE>#MOVX#XPOSJ#YCTRK#ZCTR @ZCLRMV #IF(#U0=1)<( ******************** zclrmv ***************** )> < #ABSI> < #MOV> < #FXD>< Z#ZPOS #RFEED> @ZCHKMV #IF(#U0=1)<( ******************** zchkmv ***************** )> < #FXD>< Z#ZPOS #RFEED> @ZDPTHMV #IF(#U0=1)<( ******************** zdpthmv ***************** )> << #MOV> Z#ZPOS > @CYCLCHG #IF(#U0=1)<( ******************** cyclchg ***************** )> // There are 4 special template words of use in this section that enable you // #ENDPROF \ These vars will equal either 1 or 0 (True or False) // #RAP / and only one of these can be set to 1 at any time. // #CUT / #IF(#WRAD>0,#AND#ENDPROF=0)<#EVAL(#V3=#V3+#LNLEN)#EVAL(#U4=1)> #IF(#U4=1,#AND#ENDPROF=1)<#EVAL(#U4=2)> @FXD1 #IF(#U0=1)<( ******************** fxd1 ***************** )> // This section will be used for Drilling, Reaming and Special // Use standard G81 from SMF < V60D#ZDPTH> < V64D#ZCHK> < V67D#FEED> #EVAL(#V1=#ZPOS-.1) < Z#V1R> < #FXD> X#XPOS Y#YPOSR @FXD2 #IF(#U0=1)<( ******************** fxd2 ***************** )> // This section will be used for Spot Drilling, Center Drilling, // Counter Boring, Spot Facing and Counter Sinking // Use standard G82 from SMF < V60D#ZDPTH> < V64D#ZCHK> < V67D#FEED> #EVAL(#V1=#ZPOS-.1) #IF(#U2=1)< Z#V1R>#EVAL(#U2=0)< Z#V1R> < #FXD> X#XPOS Y#YPOSR @FXD5 #IF(#U0=1)<( ******************** op_pdrl ***************** )> // This section will be used for Peck Drilling // Use G83 normal deep hole or G84 chip break deep hole based on JOF // #CYCLE can equal 0, 1, 2 or 3, and gets command string from the PECK_CODE #EVAL(#S19=#TABLE(PECK_CODES,#CYCLE)) < V60D#ZDPTH> < V63D#PECK> < V64D#ZCHK> < V67D#FEED> #EVAL(#V1=#ZPOS-.1) < Z#V1R> #S19 X#XPOS Y#YPOSR @PECK_CODES 0,G83 1,G84 @OP_TAP #IF(#U0=1)<( ******************** op_tap ***************** )> // This section will be used for Tapping #OFFBLK ------------------- tapping ----------------- #ONBLK //#IFCHG(#FXD)<#FXD>// Make sure the cycle code gets output after a G80 < X#XPOS>< Y#YPOS>R < Z#ZCHKR> #EVAL(#U3=-1*#ZDPTH) G91 #FXD Z#FMT(#U3,D3.4) F#FEED Z#ZDPTH G90 Z#ZCHK @FXD4 #IF(#U0=1)<( ******************** op_bore ***************** )> // This section will be used for Boring < V60D#ZDPTH> < V63D#PECK> < V64D#ZCHK> < V67D#FEED> #EVAL(#V1=#ZPOS-.1) < Z#V1R> < #FXD> X#XPOS Y#YPOSR @