// ---------------------------------------- // // 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 The Haas VF-1 Vertical Machining Center is capable of accepting any Fanuc or Yasnac program and executing it without any edits. This Code Generator supports the more popular Fanuc Programming format. G90 Absolute Positioning Mode is assumed. Supported functions: ----------------------------------------------------------------- G-Codes (Preparatory Codes) G00 Rapid positioning code G01 Linear Interpolation G02 Clockwise Circular Interpolation G03 Counter-clockwise Circular Interpolation G04 Dwell (Decimal 3.4 Format) G17 XY Plane G18 XZ Plane G19 YZ Plane G40 Tool Radius Compensation, Cancel G41 Tool Radius Compensation, Left G42 Tool Radius Compensation, Right G43 Tool Length Compensation, Positive G49 Tool Length Compensation, Cancel G80 Cancel Canned Cycle G81 Drilling Cycle G82 Spot Drill Cycle (with Dwell) G83 Peck Drill Cycle G84 Tapping Cycle G86 Boring Cycle ----------------------------------------------------------------- G90 Absolute Positioning Mode G91 Incremental Positioning Mode G94 Inches Per Minute Feed Mode G98 Return to "Initial" Plane G99 Return to "Reference" Plane ----------------------------------------------------------------- M-Codes (Miscellaneous Functions) M00 Program Stop (User_Elmt @STOP) M01 Optional Stop (User_Elmt @OPSTOP) M02 End of Program M03 Spindle On, CW M04 Spindle On, CCW M05 Spindle Off M08 Flood Coolant ON M09 Flood Coolant OFF M98 Sub-Routine Program Call M99 Return to Main Program ------------------------------------------------------------------ Special Functions : --------------------------------------------------------------------------- Sub-Routines : Sub-routines are supported to one level deep. The Sub-program number must be identified in the Edit-Define_Sub Toolbox. Sub-Routine "Handle Points" must always be : For "Subs" - X0, Y0, Z0 For "Drill Subs" - X0, Y0 and the "Z_Clear" Value for that Drill routine. If clear is set to 0.1, Handle Point is X0, Y0, Z0.1 "Insertion Points" for the Sub-routine must be : For "Subs" - X0, Y0, Z0 in the active Work_Plane. For "Drill Subs" - X0, Y0 and the "Z_Clear" Value for that Drill routine in the active Work Plane. If Clear is set to 0.1, Insertion Point is X0, Y0, Z0.1 NOTE: If sub-routines are used, you must go into Edit Plus and delete the percent sign (%) that follows the M30 and re-insert it after the last sub-routine in the program. Sub-routines are currently output in absolute values. You may switch to incremental sub-routine output by changing Machine Define (.SMF) file question number 332 to <1>. ------------------------------------------------------------------- Fixture Offsets Fixture offsets positions may be built using the Work_Plane-Define_Plane Toolbox. The Plane_Name must be a value of 2 to 26 for calling each of the available offsets. ( See Table ) Fixture Offset Table XY_Plane G54 2 G55 3 G56 4 G57 5 G58 6 G59 7 G110 8 G111 9 G112 10 G113 11 G114 12 G115 13 G116 14 G117 15 G118 16 G119 17 G120 18 G121 19 G122 20 G123 21 G124 22 G125 23 G126 24 G127 25 G128 26 G129 --------------------------------------------------------------------------- @START % ( #FILE ) #ONBLK #MOV #ABSI #FXD #DCOMP #PLANE G49 T#TOOL M06#OFFBLK #IF(#TLCMT)<( --- #TLCMT --- )#ONBLK>#ELSE<( --- #TDESC --- )#ONBLK> M1 S#SPEED #SPNDL #IF(#TINDX=2)<#CALL(WKSYS)>#ELSE< G54 #MOV X#XPOS Y#YPOS> M8 G43 H#LOFF Z#ZPOS #EVAL(#U1=1) @TOOLCHG < #FXD>< #DCOMP> M9 #MOV G91 G28 Z0 G49 T#TOOL M6#OFFBLK #IF(#TLCMT)<( --- #TLCMT --- )#ONBLK>#ELSE<( --- #TDESC --- )#ONBLK> M1 S#SPEED #SPNDL #IF(#TINDX=2)<#CALL(WKSYS)>#ELSE< #ABSI #MOV X#XPOS Y#YPOS> M8 G43 H#LOFF Z#ZPOS #EVAL(#U1=1) @END < #FXD> M09 G0 G91 G28 Z0 #SPOFF G49 M30 #OFFBLK% @STPROF < #ABSI>< #FXD>< #MOV>< X#XPOS>< Y#YPOS> @ENDPROF < #DCOMP> << #MOV> Z#ZPOS> @RAP #EVAL(#MOV=0) #IF(#TINDX=2)<#OFFBLK> #IF(#TINDX=2)<#CALL(WKSYS)> < #ABSI>< #FXD>< #MOV>< X#XPOS>< Y#YPOS>< Z#ZPOS> #RESET(#FXD) #EVAL(#U1=1) @LINE < #PLANE>< #MOV>< #DCOMP#EXC D#DOFF>< X#XPOS>< Y#YPOS>< Z#ZPOS>< F#FEED> @ARC #IF(#ABS(#TANG)=360)<< #PLANE>< #MOV> X#XPOS Y#YPOS#EXLN #IF(#XCTR=0)< I0>#ELSE< I#XCTR>#IF(#YCTR=0)< J0>#ELSE< J#YCTR>#EXLN < F#FEED>>#ELSE<< #MOV> X#XPOS Y#YPOS R#ARAD< F#FEED>> @XZARC #IF(#ABS(#TANG)=360)<< #PLANE>< #MOV> X#XPOS Z#ZPOS#EXLN #IF(#XCTR=0)< I0>#ELSE< I#XCTR>#IF(#ZCTR=0)< K0>#ELSE< K#ZCTR>#EXLN < F#FEED>>#ELSE<< #MOV> X#XPOS Z#ZPOS R#ARAD< F#FEED>> @YZARC #IF(#ABS(#TANG)=360)<< #PLANE>< #MOV> Y#YPOS Z#ZPOS#EXLN #IF(#YCTR=0)< J0>#ELSE< J#YCTR>#IF(#ZCTR=0)< K0>#ELSE< K#ZCTR>#EXLN < F#FEED>>#ELSE<< #MOV> Y#YPOS Z#ZPOS R#ARAD< F#FEED>> @HELIX < #PLANE> #MOV< X#XPOS>< Y#YPOS> Z#ZPOS I#XCTR J#YCTR< F#FEED> @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> @ZDPTHMV << #MOV> Z#ZPOS< F#FEED>> @FXD1 #IF(#U1=1)<#RESET(#XPOS,#YPOS)> < #RTNLVL>< #ABSI>< #FXD>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> #EVAL(#U1=0) @FXD2 #IF(#U1=1)<#RESET(#XPOS,#YPOS)> < #RTNLVL>< #ABSI>< #FXD>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK P#DWELL>< F#FEED> #EVAL(#U1=0) @FXD3 #IF(#U1=1)<#RESET(#XPOS,#YPOS)> < #RTNLVL>< #ABSI>< #FXD>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> #EVAL(#U1=0) @FXD4 #IF(#U1=1)<#RESET(#XPOS,#YPOS)> < #RTNLVL>< #ABSI>< #FXD>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK>< F#FEED> #EVAL(#U1=0) @FXD5 #IF(#U1=1)<#RESET(#XPOS,#YPOS)> < #RTNLVL>< #ABSI>< #FXD>< X#XPOS>< Y#YPOS>< Z#ZDPTH R#ZCHK Q#PECK>< F#FEED> #EVAL(#U1=0) @SUBDEF #EVAL(#BLK=1000) O#SNAME ( SUB PROGRAM FILENAME #SNAME.SUB, USED BY #FILE ) #ONBLK #ABSI @ENDDEF #IF(#U4=1)< #FXD> G90 #EVAL(#U4=0) M99#OFFBLK @GOSUB M98 P#SNAME < #ABSI> #RESET(#SPEED,#FEED) #IF(#SBTYP=2)<#EVAL(#U4=1)>#ELSE<#EVAL(#U4=0)> @FXDDEF < X#XPOS>< Y#YPOS> #EVAL(#U4=1) @WKSYS #EVAL(#MOV=0) #RESET(#MOV) #IF(#WKPLN)<#EVAL(#U1=#WKPLN)>#ELSE<#EVAL(#U1=1)> #EVAL(#S1=#TABLE(TBLWKS,#U1)) < #FXD> ( --- #S1 FIXTURE OFFSET --- ) << #ABSI> #MOV #S1 X#XPOS Y#YPOS> #EVAL(#MOV=0) #IF(#TINDX=2)<#EVAL(#TINDX=0)> #RESET(#FXD) @TPINDX #IF(#TINDX=2)<#CALL(WKSYS)> #IF(#TINDX=2)<#EXIT> @TBLWKS 0,G54 1,G54 2,G55 3,G56 4,G57 5,G58 6,G59 7,G110 8,G111 9,G112 10,G113 11,G114 12,G115 13,G116 14,G117 15,G118 16,G119 17,G120 18,G121 19,G122 20,G123 21,G124 22,G125 23,G126 24,G127 25,G128 26,G129 @DWELL G04 P#DWELL @STOP M0 @OPSTOP M1 @