{12/19/90 Modified: Swedturn 6 CNC 300 L154.71.4m For: Lewis Engineering Co. Machine: Swedturn 6 Control: CNC 300 Converted to English. Turret #1 consists of Tools 1-20, and uses literal 'M22' to turn on the Coolant. Turret #2 consists of Tools greater than 20, and uses normal CoolOn 'M8' command. This Post Processor outputs Absolute values only. DWB}
{4/4/91 Modified: Swedturn 10 CNC 220 L153.71.4 For: Gibbs & Associates Updated to Version 4.0 per Fanuc 10T MS [-] L001.80 Format. Only Canned Cycles supported are RoughContour, Threading and Tapping. DWB}
{7/10/91 Copied & modified: Swedturn 6 CNC 300 L154.80 For: Lewis Engineering Modifications made per marked up read out: Deleted 'G18' line from FirstOperation. Move 'G95' to same line as 'G96' or 'G97' in FirstOperation, to read 'G9596' or 'G9597'. Deleted 'M24'. Changed FeedRate to 'F0.0' for Tap or Threading operations. Modified Tap output: Added formula to FeedIPR# to output the threads per inch value, changed K label to an F modified Format deleted I0 deleted Dwell line at depth deleted Speed at depth moved InverseSpinOn to out move deleted I&K from out move deleted the 4 lines after the out move Modified Threading CannedCycle output changed XatFinZ to a formula to output the Major dia, or Minor dia for internal thread replaced ThrdLead with Thread# to output the threads per inch value Changed M3 & M4 in MachSpec to M32 & M42 M31 specifies spindle clockwise and low range, M32 would be high range, gear ranges are unknown at this time. Jim Radcliffe}
{08/07/91 Updated: Swedturn 6 CNC 300[LE] L222.81 For: Gibbs & Associates Updated to Version 4.0 per Fanuc 6M M001.82 Format. Kim Michelman}
{01/05/97 Original: Swedturn 6 CNC 300[LE] L222.81 Created: Swedturn 6 CNC 300[CM] Lxxx.81 For: Covert Mfg Added 'G70M5' and 'G95' to FirstOp Changed M42/M43 to M3/M4 for SpinOn in the FORM Charles Winston}
{Prog Numeric Format Definitions *******************************************}
DoSubComment: NewProg IF UseComments? AND SubComment? '( SUB NUMBER: ' Program# ' )' EOL END RETURN
DoOpComments: IF UseComments? SetScale('1') IF OperationIDComment? '( OPERATION ' Operation# ': ' OperationType$ ' )' EOL END IF OperationComment? '( ' OperationComment$ ' )' EOL END IF WorkGroupComment? '( ' WorkGroupComment$ ' )' EOL END IF ToolTypeComment? '( TOOL ' Tool# ': ' ToolSize$ ' ' ToolType$ ' )' EOL END IF ToolComment? '( ' ToolComment$ ' )' EOL END IF Metric? {CAM file is in Metric, tools and tool path} SetScale('.03937007874') { change to English, this is an English post} END END RETURN
Approach: { NOT FOR TAILSTOCK, .82 } IF ApproachOD? SeqLabC Rapid XCP AppMove EOL ODApproachSP ELSE IF ApproachID? SeqLabC Rapid XOpCD AppMove EOL IDApproachSP ELSE {ApproachFace} SeqLabC Rapid StockOnNoCan XSP StockOff AppMove EOL FaceApproachSP END END RETURN
CheckOffset: DoEndOpPS IF LAST ProgStop? SeqLabC 'M0' EOL ELSE IF CoolOff? AND LAST NOT CoolOff? SeqLabC CoolOff EOL END END IF ConstantSurfaceFeed? IF LAST NOT ConstantSurfaceFeed? SeqLabC CSSOn 'G96' MaxRPM EOL END ELSE IF LAST ConstantSurfaceFeed? SeqLabC CSSOff 'G97' EOL END END SeqLabC SpeedC IF NewToolOffset? OpToolID LatheOffset END IF LAST ProgStop? SpinOn EOL SeqLabC TurretCoolant EOL ELSE EOL IF NOT CoolOff? AND LAST CoolOff? SeqLabC TurretCoolant EOL END END DoPostScript RETURN
FormatArc: IF ArcCW? CWArcC ELSE CCWArcC END MoveXC MoveZC IF ArcIJFormat? ArcIJC ELSE ArcRC END RETURN
ToolPath: EACHFeat GetToolTip IF LastFeat? IF Drilling? IF Tap? SeqLabC SpinOff EOL SeqLabC TurretCoolant EOL InverseSpinOn ELSE IF Dwell? SeqLabC 'G4I' Dwell# EOL {Dwell is G4 with letter 'I' address, not G41} END END ELSE IF CannedCycle? SeqLab END END END IF PointFeat? SeqLabC MoveSXYC EOL ELSE IF RapidFeat? SeqLabC RapidC MoveXC MoveZC EOL ELSE IF LineFeat? SeqLabC FeedC MoveXC MoveZC EOL ELSE IF ArcFeat? EACHQuadrant { Do not use NOT, LAST, FIRST or NEXT modifiers in this loop } SeqLabC FormatArc EOL NEXTQuadrant ELSE IF ThreadFeat? SeqLabC 'G33' MoveXC MoveZC XTapAtZ 'K' Thread# EOL Rapid END END END END END NEXTFeat RETURN
CheckRapid: IF LAST CannedCycle? Rapid ELSE RapidC END RETURN
{Start of executable Prog **************************************************}
{setup and initializations} InitProg PosSideLathe XsAreRadii SetMaxRPM('3000') SetMaxFeed('500') SetAbs IF PSComment? AND UseComments? 'PostScript:' EOL ' Literals: put between single or double quotes.' EOL ' Separate commands and literals with at least one space.' EOL ' A CR ( RETURN key ) will start a new line.' EOL ' Commands: must be all capital letters when typed in.' EOL ' ENDOP -' EOL ' all literals and commands before an ENDOP command' EOL ' will appear at the beginning of the operation. All ' EOL ' literals and commands after an ENDOP command will appear' EOL ' at the end of the operation. ' EOL END EachOp {Start of post processing *********************} GetLCycle IF FirstOperation? IF UseComments? IF ProgramNameComment? '( ' ProgramName$ ' )' EOL END IF ProgramComment? '( ' ProgramComment$ ' )' EOL END IF FormatNameComment? '( FORMAT: ' FormatName$ ' )' EOL END IF TimeComment? '( ' Date$ ' AT ' Time$ ' )' EOL END IF MovesComment? '( OUTPUT IN ABSOLUTE INCHES )' EOL END END IF Metric? {CAM file is in Metric, tools and tool path} SetScale('.03937007874') { change to English, this is an English post} END OpenSub StockOff {.71.2} SetHome DoOpComments DoPostScript Plane SeqLabC 'G70M5' EOL SeqLabC 'G95' EOL IF ConstantSurfaceFeed? SeqLabC CSSOn 'G96' MaxRPM EOL ELSE SeqLabC CSSOff 'G97' EOL END SeqLabC Preset 'X' ToolOffsetXRadius# 'Z' ToolOffsetZ# 'I0K0' IF Threading? OR TAP? 'F0.0' ELSE Feedrate END Speed OpToolID LatheOffset SpinOn EOL Approach ELSE IF NewTool?
{Finish off last Operation}
StockOff {.62} CheckRapid IF LAST ApproachOD? SeqLabC XCPC EOL ELSE IF LAST ApproachID? SeqLabC LAST XOpECDC EOL END END SeqLabC ZCPC EOL
{IF NewTurret? THEN CoolOff} IF ToolOver?('20') AND LAST NOT ToolOver?('20') { Changing from Turret 1 to Turret 2 } SeqLabC CoolOff EOL ELSE IF NOT ToolOver?('20') AND LAST ToolOver?('20') { Changing from Turret 2 to Turret 1 } SeqLabC CoolOff EOL END END
SeqLabC 'X' TurretX# 'Z' TurretZ# IF LAST ProgStop? 'M0' ELSE ProgStop END EOL
{Start new Operation}
DoOpComments DoPostScript SeqLab IF ConstantSurfaceFeed? IF LAST NOT ConstantSurfaceFeed? SeqLabC CSSOn 'G96' MaxRPM EOL END ELSE IF LAST ConstantSurfaceFeed? SeqLabC CSSOff 'G97' EOL END END SeqLabC Preset 'X' ToolOffsetXRadius# 'Z' ToolOffsetZ# 'I0K0' IF Threading? OR TAP? 'F0.0' ELSE Feedrate END Speed OpToolID LatheOffset SpinOn EOL Approach ELSE IF SameTool? {.62}
{Start new Operation}
DoOpComments StockOff IF LAST StraightConnect? CheckOffset CheckRapid SeqLabC StockOnNoCan XSPC ZSPC EOL ELSE CheckRapid IF ApproachOD? IF LAST ApproachOD? SeqLabC LAST XOpECDC EOL ELSE {around} IF LAST ApproachID? SeqLabC LAST XOpECDC EOL END SeqLabC ZCPC EOL SeqLabC XCPC EOL END CheckOffset ODApproachSP ELSE IF ApproachID? IF LAST ApproachID? SeqLabC LAST XOpECDC EOL ELSE IF LAST ApproachOD? {around} SeqLabC XCPC EOL END SeqLabC ZCPC EOL SeqLabC XOpCDC EOL END CheckOffset IDApproachSP ELSE {ApproachFace} IF LAST ApproachFace? SeqLabC LAST ZOpECPC EOL ELSE IF LAST ApproachOD? {around} SeqLabC XCPC EOL ELSE {LAST ApproachID} SeqLabC LAST XOpECDC EOL END SeqLabC ZCPC EOL END CheckOffset FaceApproachSP END END END END END END {common point for all operations} IF CannedCycle? StockOff IF Roughing? TagInc IF RoughContour? SetPass2 IF ApproachFace? SeqLabC LCycle 'Xł' Tag# CutDepth XStkLeft ZStkLeft EOL ELSE SeqLabC LCycle CutDepth 'Zł' Tag# XStkLeft ZStkLeft EOL END OpenSub DoSubComment '>' Tag# EOL SeqLab 'G50' EOL SeqLabC StepMove StrtPos EOL ToolPath SeqLabC 'G51' EOL CloseSub IF AutoFinish? IF ApproachFace? SeqLabC LCycle 'Xł' Tag# EOL ELSE SeqLabC LCycle 'Zł' Tag# EOL END END END ELSE IF Threading? SeqLabC LCycle IF ApproachOD? MUL# Sub# 'X' CycleStartX# DistanceToThread# NumSc#('2') ELSE MUL# Add# 'X' CycleStartX# DistanceToThread# NumSc#('2') END FinZ XTapAtZ CutMethod ThrdHeight 'K' Thread# CutDepth Speed ToolAngle EOL IF AutoFinish? SeqLabC XatFinZ EOL SeqLabC 'G33' FinZ XTapAtZ 'K' Thread# EOL SeqLabC Rapid XCSP EOL SeqLabC ZCSP EOL END ELSE IF Drilling? IF Tap? SeqLabC LCycle ZDepth 'F' Div# Num#('1') FeedIPR# EOL SeqLabC SpinOff EOL SeqLabC TurretCoolant EOL SeqLabC LCycle ZSP InverseSpinOn EOL END END END END ELSE StockOn SetPass1 ToolPath IF AutoFinish? IF NOT Drilling? AND NOT Grooving? StockOff IF Turning? SetPass1 ELSE SetPass2 END SeqLabC RapidC StrtPos EOL ToolPath END END END NextOp {loops back to EachOP until last Operation}
{End of program ************************************************************}
{finish last operation} StockOff IF CannedCycle? Rapid ELSE RapidC END IF ApproachOD? SeqLabC XCPC EOL ELSE IF ApproachID? SeqLabC XOpECDC EOL END END SeqLabC ZCPC EOL DoEndOpPS SeqLabC CoolOff EOL SeqLabC 'X' FIRST TurretX# 'Z' FIRST TurretZ# SpinOff EOL IF ProgStop? SeqLabC 'M0' EOL END SeqLabC EOP EOL CloseSub Post2 {organize Subs into one program} Close Retag IF UseComments? SetScale('1') {restore scale for comments} Reopen IF FileBytesComment? '( FILE LENGTH: ' FileBytes# ' CHARACTERS )' EOL END IF FileFeetComment? '( FILE LENGTH: ' FileFeet# ' FEET )' EOL END IF FileMetersComment? '( FILE LENGTH: ' FileMeters# ' METERS )' EOL END Close END