GetOpToolID: { TailStockOn } IF Equal? Tool# Num#('13') 'T11' ELSE OpToolID END RETURN
GetLOfstOff: { TailStockOff } IF Equal? LAST Tool# Num#('13') 'T11' ELSE LOfstOff END RETURN
GetGearRange: IF GTEqual? CalcRPM1# Num#('300') 'M39' ELSE IF GTEqual? CalcRPM1# Num#('100') 'M38' ELSE 'M37' END END RETURN
CSSOnToCSSOn: IF GTEqual? CalcRPM1# Num#('300') IF LessThan? LAST CalcRPM1# Num#('300') SetFlag('2') END ELSE IF GTEqual? CalcRPM1# Num#('100') IF GTEqual? LAST CalcRPM1# Num#('300') SetFlag('2') ELSE IF LessThan? LAST CalcRPM1# Num#('100') SetFlag('2') END END ELSE IF GTEqual? LAST CalcRPM1# Num#('100') SetFlag('2') END END END RETURN
CSSOffToCSSOn: IF GTEqual? CalcRPM1# Num#('300') IF LessThan? LAST SpeedRPM# Num#('300') SetFlag('2') END ELSE IF GTEqual? CalcRPM1# Num#('100') IF GTEqual? LAST SpeedRPM# Num#('300') SetFlag('2') ELSE IF LessThan? LAST SpeedRPM# Num#('100') SetFlag('2') END END ELSE IF GTEqual? LAST SpeedRPM# Num#('100') SetFlag('2') END END END RETURN
CSSOnToCSSOf: IF GTEqual? SpeedRPM# Num#('300') IF LessThan? LAST CalcRPM1# Num#('300') SetFlag('2') END ELSE IF GTEqual? SpeedRPM# Num#('100') IF GTEqual? LAST CalcRPM1# Num#('300') SetFlag('2') ELSE IF LessThan? LAST CalcRPM1# Num#('100') SetFlag('2') END END ELSE IF GTEqual? LAST CalcRPM1# Num#('100') SetFlag('2') END END END RETURN
ckNewGear: CSSOff IF ConstantSurfaceFeed? IF LAST ConstantSurfaceFeed? CSSOnToCSSOn ELSE CSSOffToCSSOn END ELSE IF LAST ConstantSurfaceFeed? CSSOnToCSSOf ELSE IF NewGear? SetFlag('2') END END END RETURN
BarFeeder: IF FirstOperation? OR NewTool? SetFlag('1') { Will output 'G99 M02' at end of program } SeqLabC Rapid StockOn XSP StockOff ThisOpEntryZCP EOL SeqLabC StockOn 'Z' ZDepth# EOL SeqLabC CoolOff EOL SeqLabC SpinOff EOL SeqLabC 'M06' EOL { Open Chuck/Collet } SeqLabC 'G04U.5' EOL SeqLabC Feed StockOff ZOpECP FeedRate EOL SeqLabC 'M07' EOL { Close Chuck/Collet } SeqLabC 'G04U.5' EOL IF NotEqual? ZOpCP# ZOpECP# SeqLabC Rapid ZOpCP EOL END ELSE { SameTool } ' ' EOL '( OPERATION ' Operation# ': ' OperationType$ ' )' EOL '( WARNING!!! )' EOL '( YOU HAVE CHOSEN A SAMETOOL DRILLING OPERATION FOR THE BARFEEDER STATION #10. )' EOL '( YOU MAY NOT GET THE DESIRED RESULTS. )' EOL ' ' EOL END RETURN
TailStockOn: SeqLabC SpinOff EOL SeqLabC 'M31' EOL { Advance Programmable TailStock with Parts Catcher Attachment } RETURN
TailStockOff: SeqLabC SpinOff EOL SeqLabC 'M32' EOL { Retract Programmable TailStock with Parts Catcher Attachment } RETURN
RestoreScale: IF Metric? {CAM file is in Metric, tools and tool path} SetScale('.03937007874') { change to English, this is an English post} 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 RestoreScale END RETURN
StockOnNoCan: IF NOT CannedCycle? StockOn {need stock for SP positioning, if not a canned cycle} END RETURN
FeedNoCan: IF NOT CannedCycle? FeedC END RETURN
FeedRateNoCan: IF NOT CannedCycle? FeedRateC END RETURN
ApproachSP: IF ApproachFace? SeqLabC StockOnNoCan XSPC EOL SeqLabC StockOff ZOpCPC EOL StockOnNoCan IF NotEqual? CycleStartZ# ZOpCP# SeqLabC FeedNoCan ZSPC FeedRateNoCan EOL END ELSE { ODApproach/IDApproach } SeqLabC StockOnNoCan ZSPC EOL SeqLabC StockOff XOpCDC EOL StockOnNoCan IF NotEqual? CycleStartX# XOpCD# SeqLabC FeedNoCan XSPC FeedRateNoCan EOL END END RETURN
AppMove: StockOff ThisOpEntryZCP CoolOn RETURN
Approach: { NOT FOR TAILSTOCK, .82 } Rapid RapidF# { RapidF# Forces FeedRate } IF ApproachOD? SeqLabC ThisOpEntryXCP AppMove EOL ELSE IF ApproachID? SeqLabC XOpCD AppMove EOL ELSE {ApproachFace} SeqLabC StockOnNoCan XSP AppMove EOL END END ApproachSP RETURN
CheckOffset: DoEndOpPS SetFlagF('2') { NewGear } ckNewGear IF LAST ProgStop? SeqLabC 'M00' EOL ELSE IF CoolOff? AND LAST NOT CoolOff? SeqLabC CoolOff EOL END IF Flag?('2') { NewGear } SeqLabC SpinOff EOL END END IF NewToolOffset? SeqLabC GetLOfstOff '00' EOL SeqLabC GetOpToolID LatheOffset EOL END IF ConstantSurfaceFeed? CSSOn IF LAST ConstantSurfaceFeed? IF NotEqual? MaxRPM# LAST MaxRPM# SeqLabC Preset MaxRPM EOL END IF Flag?('2') { NewGear } GetGearRange Speed ELSE IF LAST ProgStop? Speed ELSE IF NotEqual? SpeedRPM# LAST SpeedRPM# Speed END END END ELSE SeqLabC Preset MaxRPM EOL IF Flag?('2') { NewGear } GetGearRange END 'G96' Speed END ELSE CSSOff IF LAST ConstantSurfaceFeed? IF Flag?('2') { NewGear } GearRange END 'G97' Speed ELSE IF Flag?('2') { NewGear } GearRange Speed ELSE IF LAST ProgStop? Speed ELSE IF NotEqual? SpeedRPM# LAST SpeedRPM# Speed END END END END END IF LAST ProgStop? SeqLabC {SpeedC} EOL SeqLabC SpinOn EOL SeqLabC CoolOn EOL ELSE SeqLabC {SpeedC} EOL IF Flag?('2') { NewGear } SeqLabC SpinOn EOL END IF NOT CoolOff? AND LAST CoolOff? SeqLabC CoolOn EOL END END SetFlagF('2') { NewGear } DoPostScript RETURN
FormatArc: IF ArcCW? CWArcC ELSE CCWArcC END MoveXC MoveZC IF ArcIJFormat? ArcIJC ELSE ArcRC END RETURN
CkCRC: { 4.2 } IF XMove? OR ZMove? { Approach Length Feature and Multiple Pockets } IF LastFeat? CRCOffC { Exit Length Feature } ELSE CRCOnC { Entry Length Feature } END END RETURN
ToolPath: EACHFeat GetToolTip IF LastFeat? IF Drilling? IF Tap? SeqLabC SpinOff EOL SeqLabC 'G04U2.' EOL SeqLabC Speed InverseSpinOn EOL ELSE IF Dwell? SeqLabC 'G04U' Dwell# EOL END END ELSE IF CannedCycle? SeqLab END END END IF PointFeat? SeqLabC MoveSXYC EOL ELSE IF RapidFeat? IF LAST ThreadFeat? Rapid END SeqLabC RapidC MoveXC MoveZC EOL ELSE IF LineFeat? SeqLabC CkCRC FeedC MoveXC MoveZC FeedRateC EOL ELSE IF ArcFeat? EACHQuadrant { Do not use NOT, LAST, FIRST or NEXT modifiers in this loop } SeqLabC FormatArc FeedRateC EOL NEXTQuadrant ELSE IF ThreadFeat? SeqLabC 'G32' MoveXC MoveZC IF Taper? XTapAtZ END ThrdLead EOL END END END END END NEXTFeat RETURN
CheckRapid: CRCOffC IF LAST CannedCycle? OR LAST Threading? Rapid ELSE RapidC END RETURN
{Start of executable Prog **************************************************}
{setup and initializations} InitProg SetAbs PosSideLathe StandardXZArcs SetMaxRPM('2200') IF Metric? SetMaxFeed('12700') ELSE SetMaxFeed('500') END SetFlagF('1') { Barfeeder Operation will output 'G99 M02' at end of program } SetFlagF('2') { NewGear } 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? EOR EOL ProgID1 IF UseComments? AND ProgramNameComment? '( ' ProgramName$ ' )' END EOL IF UseComments? 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 RestoreScale OpenSub StockOff {.71.2} SetHome DoOpComments DoPostScript Plane SeqLab 'G20' EOL { Sets Control into INCH System } SeqLabC Preset Home IF ConstantSurfaceFeed? MaxRPM END EOL SeqLabC Rapid GetOpToolID LatheOffset EOL IF Drilling? AND Equal? Tool# Num#('10') BarFeeder ELSE IF Equal? Tool# Num#('13') TailStockOn END SeqLabC CSSOff IF ConstantSurfaceFeed? GetGearRange CalcRPM1 ELSE GearRange Speed END EOL SeqLabC SpinOn EOL Approach END ELSE IF NewTool?
{Finish off last Operation}
IF LAST Drilling? AND Equal? LAST Tool# Num#('10') { BarFeeder Station } ELSE StockOff {.62} CheckRapid IF LAST ApproachOD? SeqLabC LAST OpExitXCPC EOL ELSE IF LAST ApproachID? SeqLabC LAST XOpECDC EOL END END SeqLabC LAST OpExitZCPC EOL DoEndOpPS IF LAST ConstantSurfaceFeed? SeqLabC CSSOff 'G97' CalcRPM2 EOL END IF Equal? LAST Tool# Num#('13') TailStockOff END END { Suppression of BarFeeder Station } SeqLabC 'G28U0W0' EOL SeqLabC Rapid GetLOfstOff '00' EOL IF LAST ProgStop? SeqLabC 'M00' EOL ELSE SeqLabC ProgStop EOL END
{Start new Operation}
DoOpComments DoPostScript SeqLab Preset Home IF ConstantSurfaceFeed? MaxRPM END EOL SeqLabC Rapid GetOpToolID LatheOffset EOL IF Drilling? AND Equal? Tool# Num#('10') BarFeeder ELSE IF Equal? Tool# Num#('13') TailStockOn END SeqLabC CSSOff IF ConstantSurfaceFeed? GetGearRange CalcRPM1 ELSE GearRange Speed END EOL SeqLabC SpinOn EOL Approach END ELSE IF SameTool? {.62}
{Start new Operation}
IF Drilling? AND Equal? Tool# Num#('10') BarFeeder ELSE StockOff DoOpComments 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 LAST OpExitZCPC EOL SeqLabC LAST OpExitXCPC EOL END ELSE IF ApproachID? IF LAST ApproachID? SeqLabC LAST XOpECDC EOL ELSE IF LAST ApproachOD? {around} SeqLabC LAST OpExitXCPC EOL END SeqLabC LAST OpExitZCPC EOL SeqLabC XOpCDC EOL END ELSE {ApproachFace} IF LAST ApproachFace? SeqLabC LAST ZOpECPC EOL ELSE IF LAST ApproachOD? {around} SeqLabC LAST OpExitXCPC EOL ELSE {LAST ApproachID} SeqLabC LAST XOpECDC EOL END SeqLabC LAST OpExitZCPC EOL END END END CheckOffset ApproachSP END END { Suppression of BarFeeder Station } END END END {common point for all operations} IF Drilling? AND Equal? Tool# Num#('10') { BarFeeder Station } ELSE IF ConstantSurfaceFeed? AND NOT SameTool? SeqLabC CSSOn 'G96' Speed EOL END IF CannedCycle? StockOff IF Roughing? IF RoughSimple? StockOn SetPass1 SeqLabC LCycle IF ApproachFace? 'Z' FirstMoveEPZ# XatFinZ ELSE XatFinZ FinZ END XTapAtZ FeedRate EOL SimpleRough ELSE TagInc SetPass2 IF RoughContour? SeqLabC LCycle 'PÅ‚' Tag# 'Q²' Tag# XStkLeft ZStkLeft CutDepth FeedRate EOL '>' Tag# EOL SeqLab StepMove StrtPos EOL ELSE IF RoughPatternShift? SeqLabC LCycle 'PÅ‚' Tag# 'Q²' Tag# XStkLeft ZStkLeft XminusU ZminusW NumCuts FeedRate EOL '>' Tag# EOL SeqLab Rapid StrtPos EOL END END ToolPath '<' Tag# EOL IF AutoFinish? SeqLabC 'G70' 'PÅ‚' Tag# 'Q²' Tag# EOL END SetPass1 TrackXNO# CycleStartX# TrackZNO# CycleStartZ# END ELSE IF Threading? IF Chamfer? SeqLabC 'M23' EOL END IF NOT ConstantVolumeCut? AND NOT SingleEdgeCut? SeqLabC 'G92X' FirstMoveEPX# FinZ XTapAtZ ThrdLead EOL SimpleRough SeqLabC XatFinZ EOL IF AutoFinish? SeqLabC XatFinZ EOL END ELSE SeqLabC LCycle XatFinZ FinZ XTapAtZ ThrdHeight CutDepth ThrdLead 'A' InFeedAngle# EOL IF AutoFinish? SeqLabC 'G92' XatFinZ FinZ XTapAtZ ThrdLead EOL END END IF Chamfer? SeqLabC 'M24' EOL END ELSE IF Drilling? IF Tap? SeqLabC LCycle ZDepth 'E' FeedIPR# EOL SeqLabC SpinOff EOL SeqLabC 'G04U2.' EOL SeqLabC Speed InverseSpinOn EOL SeqLabC ZSP EOL ELSE IF PeckChipBreaker? SeqLabC LCycle ZDepth RLevel Dwell Peck Retract FeedRate EOL SeqLabC DrillOff EOL IF AutoFinish? SeqLabC Feed ZDepth FeedRate EOL IF Dwell? SeqLabC 'G04U' Dwell# EOL END SeqLabC Rapid ZSP EOL END END END END END END ELSE StockOn SetPass1 ToolPath IF AutoFinish? { .82.1c } StockOff IF Turning? IF ApproachFace? SeqLabC RapidC ZOpECPC EOL ELSE SeqLabC RapidC XOpECDC EOL END ApproachSP SeqLabC StockOff StrtPosC EOL ToolPath ELSE IF Roughing? AND NOT RoughSimple? SetPass2 SeqLabC RapidC XSPC ZSPC EOL SeqLabC StockOff StrtPosC EOL ToolPath SetPass1 ELSE IF Threading? SeqLabC 'X' MUL# Num#('2') ADD# FinishXRadius# Taper# EOL SeqLabC 'G32' IF Taper? XatFinZ FinZ XTapAtZ ELSE FinZ END ThrdLead EOL SeqLabC Rapid XSP EOL SeqLabC ZSP EOL END END END END END IF Drilling? AND Tap? SeqLabC SpinOff EOL SeqLabC 'G04U2.' EOL SeqLabC Speed SpinOn EOL END END { Suppression of BarFeeder Station } NextOp {loops back to EachOP until last Operation}
{End of program ************************************************************}
{finish last operation} IF Drilling? AND Equal? Tool# Num#('10') { BarFeeder Station } ELSE StockOff CRCOffC IF CannedCycle? OR Threading? Rapid ELSE RapidC END IF ApproachOD? SeqLabC OpExitXCPC EOL ELSE IF ApproachID? SeqLabC XOpECDC EOL END END SeqLabC OpExitZCPC EOL DoEndOpPS SeqLabC CoolOff EOL IF ConstantSurfaceFeed? SeqLabC CSSOff 'G97S' CalcEPRPM# EOL END IF Equal? Tool# Num#('13') TailStockOff ELSE SeqLabC SpinOff EOL END END { Suppression of BarFeeder Station } SeqLabC 'G28U0W0' EOL SeqLabC Rapid GetOpToolID '00' EOL IF ProgStop? SeqLabC 'M00' EOL END IF Flag?('1') { BarFeeder Station was used earlier } SeqLabC 'M99' EOL { Tape Rewind } SeqLabC 'M02' EOL ELSE SeqLabC EOP EOL END Post EOR EOL 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