@COMMENT ---------------------------------------- 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: Mori Seiki SL-2 Lathe Control: Fanuc 11T The maximum spindle speed for SL-2 machines is 4500 RPM. The @VARSET section contains the variable setting #mRPM that you can change for max RPM. To program a bar puller, it is recommended to use a dummy step with a speed of 0 RPM and a feed of 100 inches per minute. It is necessary to create @M10 and @M11 User Commands at the points you wish to clamp and unclamp the chuck. SmartCAM will automatically output the /M99 block at the end of the program when @M10 and @M11 are used. @ @DECLARE //#OUTCND // outputs conditional status //#OUTSEC // outputs @section names //#OUTREF // outputs processing errors //#OUTRPT // outputs an error report file #INT #mRPM // Max RPM #INT #bpOnOff // Bar puller switch @ @VARSET #EVAL(#mRPM=3500)// max RPM, change as desired @ @START #CALL(VARSET) % O#FILE #EVAL(#BLK=1) N#BLK #FDMODE #C0 G50 S#FMT(#mRPM,T4.0) G00 T#TOFF #TLID (#TLCMT) #SPMODE S#SPEED #SPNDL #NEXTPT #MOV X#XPOS Z#ZPOS @ @TOOLCHG #MOV X#XPOS Z#ZPOS T#LTOOL M01 <#SPOFF > #EVAL(#U1=INT(#TLTIME)) #EVAL(#U2=#TLTIME-#U1) #EVAL(#U0=#U2*60) (T#FMT(#LTOOL,F2.0) EST.TIME:#EXLN #IF(#U1>0)<#FMT(#U1,T3.0) MIN. >#FMT(#U0,D4.2) SEC.) #EVAL(#BLK=#BLK+1) N#BLK #FDMODE #C0 G50 S#FMT(#mRPM,T4.0) G00 T#TOFF #TLID (#TLCMT) #SPMODE S#SPEED #SPNDL #NEXTPT #MOV X#XPOS Z#ZPOS @ @END #EVAL(#C0=1) #MOV X#XHOME Z#ZHOME #C0 T#LTOOL M01 #EVAL(#U1=INT(#TLTIME)) #EVAL(#U2=#TLTIME-#U1) #EVAL(#U0=#U2*60) (T#FMT(#LTOOL,F2.0) EST.TIME:#EXLN #IF(#U1>0)<#FMT(#U1,T3.0) MIN. >#FMT(#U0,D4.2) 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,D4.2) SEC.) #IF(#bpOnOff=1) M30 % @ @STPROF #RESET(#FXD) <#MOV > @ @RAP #RESET(#FXD) <#MOV > @ @LINE #RESET(#FXD) <#MOV > @ @ARC #RESET(#FXD) <#MOV >R#ARAD @ @OP_THD <#FXD > @ @OP_TURN <#FXD > @ @OP_FACE <#FXD > @ @OP_TAP G32 Z#ZPASS F#FEED M05 #CALL(G04) #IF(#SPNDL=1)<#EVAL(#SPNDL=2)>#ELSE<#EVAL(#SPNDL=1)> G32 Z#ZPOS F#FEED #SPNDL @ @G04 G04 U#DWELL#EVAL(#TIME=#DWELL/60) @ @G71 G71 P#FMT(#V3,T4.0) Q#FMT(#V4,T4.0) U#V5 W#V6 D#FMT(#V7,T1.4) F#FEED S#SPEED @ @G70 G70 P#FMT(#V3,T4.0) Q#FMT(#V4,T4.0) @ @M10 <#MOV > M10 #CALL(G04) @ @M11 <#MOV > M11 #CALL(G04) #EVAL(#bpOnOff=1) @