plik


{ MILL=T LATHE=T ADV_MILL=F SUBS=T ROTARY_MILL=T MILLTURN_POLAR-SEG=F MILLTURN_Y-AXIS=T METRIC=F } { Before you change this post, make sure that flag(10) is set correctly: >>> You must check G90/G91 output since I DID NOT !!! <<< >>> As far as I know, U & W should works for both G-codes groups <<< Flag(10): True for Fanuc Control with Standard G-codes (Default). G32 - Thread Cutting G50 - Preset and Max RPM Setting G98 - Per Minute Feedrate G99 - Per Revolution Feedrate X,Z - Absolute Programming U,W - Incremental Programming False for Fanuc Control with Special G-codes. G33 - Thread Cutting G92 - Preset and Max RPM Setting - Must be set in the "Form" under Origins & Values G94 - Per Minute Feedrate G95 - Per Revolution Feedrate G90 - Absolute Programming - Must be set in the "Form" under Origins & Values G91 - Incremental Programming - Must be set in the "Form" under Origins & Values } {Change Comments ***********************************************************} {1/5/99, Initial : Created: Fanuc 16T [VG] YSML800.17 Customer: Master Post for Gibbs & Associates This is a master Mill-Turn post for 4-axis machine with Fanuc control. Face milling output is being segmented for Rotary Milling option in VG. JHE} {1/20/99, Initial : Fanuc 16T [VG] YSML800.17 Created: Fanuc 16T [VG] YSML800.17.1 Customer: Master Post for Gibbs & Associates Changes to "Prog": 1. Changed Inch SetArcSegmentAccuracy to (.0005). 2. Added SetArcSegmentAccuracy('.0127') for Metric. 3. Added FORMAT to DIV# 4. In threadCycle sub, changed chamfer calculation to DIV# RunOutZ# FeedIPR#. JHE} {2/24/99 Copied: Fanuc 16T [VG] YSML800.17.1 Created: Fanuc 18T0 [LTC] YIML821.17.1 For: Lemco Tool Corporation Machine: Nakamura-Tome TW-20 Control: Nakamura-Tome Fanuc 18T0 Versions: Virtual 5.04.06/ComPost2 1.7b15 Changes made per Kurt Steinbach of Lemco Tool Corporation, manual, phone calls, faxes, sample part files "CPTL5-1L.vnc" and "CPTL5-1R.vnc" This post supports two controls. The LEFT unit is the default and supports the Y axis. The RIGHT unit is supported via the PalletIn? Boolean Added Flag(21) for support of RIGHT unit. Added PalletInF initializer for support of LEFT unit at progStart. Added FlagF(21) initializer for support of LEFT unit at progStart. Added PalletIn? Boolean at psStuff. True sets Flag(21) to TRUE for support of RIGHT Unit. Flag(21) is tested at doMoveSY, doMoveYC, firstOp1, newToolOp2, newToolOp3, endOp2 and endOp3. There are hard-coded part transfer routines for each unit. This post supports Polar Coordinate Interpolation. Added FORMAT#12, '#;400.' for Polar Coordinate Interpolation RapidF at Prog Numeric Format Definitions. Added following Polar Coordinate Interpolation procedures. pciOn sets PolarInterpolation? to TRUE and outputs G112. pciOff sets PolarInterpolation? to FALSE and outputs G113. pciRapid outputs unconditional Feed/Rapid based on PolarInterpolation? test. pciRapidC outputs conditional FeedC/RapidC based on PolarInterpolation? test. pciConnect outputs unconditional Feed/Connect based on PolarInterpolation? test. pciRapidF outputs unconditional RapidF based on PolarInterpolation? test. pciRapidFC outputs conditional RapidFC based on PolarInterpolation? test. PolarInterpolation? is also tested at doMoveSY, doMoveYC and doFeedRate. Renamed doMoveSYC procedure to doMoveSY. Changed MoveSYC to doMoveSYC call 2 places at rotateStartPosC. Added new doMoveSYC procedure which calls doMoveSY procedure. Added appropriate PostScript Comments at progStart. This post supports LowPressure/HighPressure Coolant Control. FloodCoolant is normal M08/M09 HighPressure Coolant MistCoolant is special M06/M07 LowPressure Coolant Added ResetCool at psInit. Added getCoolOn procedure. Added getCoolOff procedure. Added appropriate PostScript Comments at progStart. This post supports special Tool Sequence Numbers. Added FORMAT#11, '00;' for special Tool Sequence Number routines at Prog Numeric Format Definitions. Added Var(21) to Var(32) for Tools 1 to 12. Added toolSeqInit procedure. Initializes Var(21) to Var(32). Added toolSeq procedure. Increments Var(21) to Var(32) and outputs with Address N. Modified Canned Drill Cycle routines. Added XsAreRadii/XsAreRadiiF toggle for Formulas at doRLevel. Added doTPPeck procedure to output 'Q' Peck#. Added call to doTPPeck procedure 4 places at tpPointFeat. Added support of RigidTap and LeftHand RigidTap Cycles at drillingOp. All Tapping Operations are handled as RigidTap Cycles. Added FeedTapIPR# to FORMAT#5 for RigidTap at Prog Numeric Format Definitions. Set MILLTURN_POLAR-SEG to FALSE at Heading. Changed FORMAT to output zero values without a decimal in both FORM and PROG. Added call to psStuff at doPostScript and doEndOpPS. Added resetAngle0 procedure to output 'G28H' TrackC# Num#('0'). Added condition to output InverseSpinOn at doSpinOn. TurningOp and FaceTool use normal M03/M04 commands, ODTool uses M04/M03. Changed CircleIC CircleJC to ArcRC for FaceTool at formatArc. Changed CircleIC CircleKC to ArcRC for TurningOp at tpArcFeat. Added checkRapid2 procedure. Emulates checkRapid procedure without LAST modifiers for output at end of LastOp. Commented out XsAreRadii at progStart. Made modifications per sample programs provided by customer. Modifications made to firstOp1, turnApproach, millApproach, millApproachSP, newToolOp1, newToolOp2, newToolOp3, sameToolOp1, sameToolOp2, endOp1, endOp2 and endOp3. DWB} {Prog Numeric Format Definitions *******************************************} #1 = '###.00' #2 = '###.####;0' #3 = '####0' #4 = '###^##0' #5 = '##.######;0' #6 = '##^###0' {used for Peck & minmun depth of cut - JHE} #7 = '#' #8 = '0^0;00' {Added for thread chamfer - JHE} #9 = '00;00' {Added for thread angle & # of spring passes - JHE} #10 = '*#####.###;0' {Added for rotary axis - JHE} #11 = '00;' { toolSeq } #12 = '#;400.' { Polar Coordinate Interpolation RapidF } FORMAT(FileFeet#,1) FORMAT(FileMeters#,1) FORMAT(Recall#,2) FORMAT(ADD#,2) FORMAT(SUB#,2) FORMAT(MUL#,2) FORMAT(SPX#,2) FORMAT(SPY#,2) FORMAT(SPZ#,2) FORMAT(EPX#,2) FORMAT(EPY#,2) FORMAT(EPZ#,2) FORMAT(TrackX#,2) FORMAT(TrackY#,2) FORMAT(TrackZ#,2) FORMAT(TrackXNO#,2) FORMAT(TrackYNO#,2) FORMAT(TrackZNO#,2) FORMAT(ArcCPH#,2) FORMAT(ArcCPV#,2) FORMAT(ToolDiameter#,2) FORMAT(LastCutXRadius#,2) FORMAT(InFeedAngle#,2) FORMAT(TRUNC#,3) FORMAT(Program#,3) FORMAT(Program2#,3) FORMAT(CallMasterNum#,3) FORMAT(Operation#,3) FORMAT(Tag#,3) FORMAT(Tool#,3) FORMAT(CalcEPRPM#,3) FORMAT(Dwell#,4) FORMAT(FeedTapIPR#,5) FORMAT(Peck#,6) FORMAT(RapidF#,7) FORMAT(DIV#,8) {Added - JHE} FORMAT(SpringPasses#,9) FORMAT(UnitAngle#,10) FORMAT(TrackC#,10) FORMAT(TrackCNO#,10) FORMAT(MoveC#,10) {Polar Coordinate Interpolation Subroutines ********************************} pciOn: IF Milling? AND NOT PolarInterpolation? SetPolarInterpolation SeqLabC 'G112' EOL { Polar Coordinate Interpolation On } END RETURN pciOff: IF PolarInterpolation? SetPolarInterpolationF SeqLabC 'G113' EOL { Polar Coordinate Interpolation Off } END RETURN pciRapid: IF PolarInterpolation? Feed ELSE Rapid END RETURN pciRapidC: IF PolarInterpolation? FeedC ELSE RapidC END RETURN pciConnect: IF PolarInterpolation? Feed ELSE Connect END RETURN pciRapidF: FORMAT(RapidF#,12) RapidF FORMAT(RapidF#,7) RETURN pciRapidFC: IF PolarInterpolation? AND NOT EmptyLine? FORMAT(RapidF#,12) RapidFC FORMAT(RapidF#,7) END RETURN {Prog Subroutines **********************************************************} resetSP: {update to the correct StartPos} IF NOT TurningOp? IF Rotations? OR Repeats? OR AutoCycle? CalcSCAng IF AbsValue? IF FaceTool? TrackXNO# SPX# ELSE TrackZNO# SPZ# END TrackYNO# SPY# TrackCNO# MoveC# ELSE SetAbs IF FaceTool? TrackXNO# SPX# ELSE TrackZNO# SPZ# END TrackYNO# SPY# TrackCNO# MoveC# SetInc END END END RETURN saveEP: {save the correct EndPos} IF PointFeat? IF AutoCycle? SetACSPCompF IF FaceTool? Save# Num#('1') ADD# Recall# Num#('1') SPX# { xOpEP } ELSE Save# Num#('3') ADD# Recall# Num#('3') SPZ# { zOpEP } END Save# Num#('2') ADD# Recall# Num#('2') SPY# { yOpEP } Save# Num#('4') ADD# Recall# Num#('4') MoveC# { cOpEP } SetACSPComp ELSE IF FaceTool? Save# Num#('1') SPX# { xOpEP } ELSE Save# Num#('3') SPZ# { zOpEP } END Save# Num#('2') SPY# { yOpEP } Save# Num#('4') MoveC# { cOpEP } END ELSE IF FaceTool? Save# Num#('1') EPX# { xOpEP } ELSE Save# Num#('3') EPZ# { zOpEP } END Save# Num#('2') EPY# { yOpEP } Save# Num#('4') MoveC# { cOpEP } END RETURN getEP: {save the correct EndPos} IF NOT TurningOp? IF Rotations? OR Repeats? OR AutoCycle? IF AbsValue? saveEP ELSE SetAbs saveEP SetInc END END END RETURN setSRXYtoACEP: IF FaceTool? TrackXNO# Recall# Num#('1') { xOpEP } ELSE TrackZNO# Recall# Num#('3') { zOpEP } END TrackYNO# Recall# Num#('2') { yOpEP } TrackCNO# Recall# Num#('4') { cOpEP } RETURN doMillCP1: {no calls to this sub - JHE} IF FaceTool? ThisOpEntryZCP ELSE ThisOpEntryXCP END RETURN doMillCP2: IF FaceTool? IF AbsValue? ZOpCP ELSE 'W' ZOpCP# END ELSE IF AbsValue? XOpCD ELSE 'U' XOpCD# END END RETURN doMillCP3: IF FaceTool? IF AbsValue? ZOpECP ELSE 'W' ZOpECP# END ELSE IF AbsValue? XOpECD ELSE 'U' XOpECD# END END RETURN doMillCP1C: {no calls to this sub - JHE} IF FaceTool? ThisOpEntryZCPC ELSE ThisOpEntryXCPC END RETURN doMillCP2C: IF FaceTool? ZOpCPC ELSE XOpCDC END RETURN doMillCP3C: IF FaceTool? ZOpECPC ELSE XOpECDC END RETURN doDrillCP: IF FaceTool? IF RetractToCP1? ThisOpEntryZCPC ELSE ZOpCPC END ELSE IF RetractToCP1? ThisOpEntryXCPC ELSE XOpCDC END END RETURN tagNext: {outputs the ASCII character that Retag uses} ASCII('62') {with Tag# to reference the sequence # stored with tagNext} RETURN tagNextRef: {outputs the ASCII character that Retag uses} ASCII('179') {with Tag# to reference the sequence # stored with tagNext} RETURN tagPrev: {outputs the ASCII character that Retag uses} ASCII('60') {with Tag# to store the previous sequence #} RETURN tagPrevRef: {outputs the ASCII character that Retag uses} ASCII('178') {with Tag# to reference the sequence # stored with tagPrev} 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 doSubComment: 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? IF TurningOp? AND NOT Drilling? '( TOOL ' Tool# ', ' ToolSize$ ' ' ToolType$ ' )' EOL ELSE '( TOOL ' Tool# ', ' ToolDiameter# ' DIA. ' ToolType$ ' )' EOL END END IF ToolComment? '( ' ToolComment$ ' )' EOL END restoreScale END RETURN psInit: {reset flags} OptCyc1F MasterOpF CallMasterOpF PalletInF ResetCool RETURN psStuff: IF PalletIn? SetFlag('21') { Spindle #2 } END RETURN doPostScript: psInit EachPS SeqLabC PostScript EOL {literals} psStuff NextPS RETURN doEndOpPS: psInit EachEOPS SeqLabC EndOpPS EOL {literals} psStuff NextPS RETURN doMoveSXC: IF AbsValue? MoveSXC ELSE IF SPXMove? 'U' SPX# END END RETURN doMoveSY: IF PolarInterpolation? IF AbsValue? 'C' SPY# ELSE 'H' SPY# END ELSE IF NOT Flag?('21') IF AbsValue? MoveSY ELSE 'V' SPY# END END END RETURN doMoveSYC: IF SPYMove? doMoveSY END RETURN doMoveSZC: IF AbsValue? MoveSZC ELSE IF SPZMove? 'W' SPZ# END END RETURN doMoveXC: IF AbsValue? MoveXC ELSE IF XMove? 'U' EPX# END END RETURN doMoveYC: IF PolarInterpolation? IF YMove? IF AbsValue? 'C' EPY# ELSE 'H' EPY# END END ELSE IF NOT Flag?('21') IF AbsValue? MoveYC ELSE IF YMove? 'V' EPY# END END END END RETURN doMoveZC: IF AbsValue? MoveZC ELSE IF ZMove? 'W' EPZ# END END RETURN doMoveCC: IF AbsValue? MoveCC ELSE IF CMove? 'H' MoveC# END END RETURN doStartPos: {called from g92Sub - JHE} IF RotaryMill? IF FaceTool? 'X' TrackX# SPX# 'C' TrackY# SPY# CalcSCAng TrackCNO# MoveC# ELSE 'Y0' TrackYNO# SPY# 'Z' TrackZ# SPZ# CalcSCAng MoveC END ELSE IF FaceTool? XSP MoveSY TrackCNO# Num#('0') ELSE MoveSY ZSP TrackCNO# Num#('0') END END RETURN doZIn: IF FaceTool? doMoveSZC ELSE doMoveSXC END RETURN entryMove: IF FirstOperation? OR NewTool? RapidF# { Forces FeedEnt/FeedRate } ELSE IF LAST Rotations? OR LAST Repeats? RapidF# END END IF FeedEntry? SeqLabC FeedC doZIn FeedEntC EOL ELSE SeqLabC pciRapidC doZIn pciRapidFC EOL END RETURN startSub: OpenSub SubID EOL doSubComment RETURN subWarning: IF NOT FeedConnect? IF AnyZshift? ' ' EOL '( WARNING; Z CLEARANCE WILL CHANGE WITH EACH CYCLE OF SUB REPEAT )' EOL ' ' EOL END END RETURN stdSub: SeqLabC SubCall CallLab RepLab RepCycs EOL startSub RETURN finishSub1: {part 1} IF NOT FeedConnect? SeqLabC CRCOffC pciRapidC doMillCP3C pciRapidFC EOL ELSE SeqLabC CRCOffC EOL END RETURN finishSubG92: {part 2} SeqLabC Preset ShiftRC EOL SeqLabC EndSub EOL CloseSub SeqLabC Preset UnshftRC EOL 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 resetAngle0: IF NotEqual? UnitAngle# Num#('0') {reset the C-axis to be 0} ResetAngle SeqLabC 'G28H' TrackC# Num#('0') EOL { C-Axis Reference Point Return } END RETURN setAngleUnder360: {sets status register and machine to current rotary position between -360 and 360 deg} IF NOT FirstOperation? IF LAST RotaryMill? OR LAST Rotations? IF GTEqual? MoveC# Num#('360') {reset the C-axis to be between 0 and 359.999} ResetAngle SeqLabC Preset 'C' TrackC# UnitAngle# EOL ELSE IF LTEqual? MoveC# Num#('-360') IF Equal? UnitAngle# Num#('0') {reset the C-axis to be 0} ResetAngle SeqLabC Preset 'C' TrackC# UnitAngle# EOL ELSE {reset the C-axis to be between -0.001 and -359.999} ResetAngle SeqLabC Preset 'C' TrackC# SUB# UnitAngle# Num#('360') EOL END END END END END RETURN doSpinOn: IF NOT TurningOp? AND NOT FaceTool? { Live OD Tool } InverseSpinOn ELSE SpinOn END RETURN doFeedRate: IF NOT EmptyLine? IF RotaryMill? IF PolarInterpolation? FeedRateC ELSE AngleFeedC END ELSE FeedRateC END END RETURN doAbsOrInc: IF Rotations? AND RotaryMill? SetInc ELSE IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated } IF FaceTool? AND ZMove? SetInc ELSE IF NOT FaceTool? AND XMove? SetInc ELSE SetAbs END END END END RETURN doACAbsOrInc: IF Rotations? AND CMove? SetInc ELSE SetAbs END RETURN doDrillAbsOrInc: IF Rotations? AND RotaryMill? SetInc ELSE IF Flag?('1') { DrillSubs activated } IF FaceTool? AND SPZMove? SetInc ELSE IF NOT FaceTool? AND SPXMove? SetInc ELSE SetAbs END END END END RETURN restoreAbsOrInc: IF Rotations? AND RotaryMill? AND NOT AutoCycle? SetAbs ELSE IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated } SetAbs END END RETURN ckCRC: IF LastFeat? CRCOffC ELSE IF TurningOp? IF XMove? OR ZMove? CRCOnC END ELSE IF FaceTool? AND NOT ZMove? CRCOnC ELSE IF NOT FaceTool? AND NOT XMove? CRCOnC END END END END RETURN tpLastFeat: {turning op's} IF Drilling? IF Tap? SeqLabC SpinOff EOL SeqLabC 'G4P500' EOL SeqLabC Speed InverseSpinOn EOL ELSE IF Dwell? SeqLabC 'G4P' Dwell# EOL END END ELSE IF CannedCycle? SeqLab END END RETURN doTPPeck: IF NOT EmptyLine? AND Peck? 'Q' Peck# END RETURN tpPointFeat: IF AutoCycle? IF RotaryMill? CalcSCAng IF FaceTool? SeqLabC doACAbsOrInc doMoveSXC doMoveCC EOL ELSE SeqLabC doACAbsOrInc doMoveSZC doMoveCC EOL END SetAbs ELSE IF FaceTool? SeqLabC doMoveSXC doMoveSYC EOL ELSE SeqLabC doMoveSYC doMoveSZC EOL END END IF Repeats? AND ZshiftOnly? SeqLabC SubCall CallLabB TRUNC# SUB# Program# Num#('1') EOL ELSE SeqLabC SubCall CallLab EOL END CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY} ELSE {implies Drilling} IF FirstFeat? SetFlagF('9') { For valid Drill Rotation Sub } IF Rotations? IF NOT LastFeat? IF NOT MasterOp? SetFlag('9') { valid Drill Rotation Sub } NewProg StartSub END END END ELSE CalcSCAng IF FaceTool? IF RotaryMill? SeqLabC doDrillAbsOrInc doMoveSXC doMoveSZC doMoveCC doTPPeck EOL ELSE SeqLabC doDrillAbsOrInc doMoveSXC doMoveSYC doMoveSZC doMoveCC doTPPeck EOL END ELSE {implies OD Tool} IF RotaryMill? SeqLabC doDrillAbsOrInc doMoveSXC doMoveSZC doMoveCC doTPPeck EOL ELSE SeqLabC doDrillAbsOrInc doMoveSXC doMoveSYC doMoveSZC doMoveCC doTPPeck EOL END END END IF LastFeat? IF Flag?('9') { valid Drill Rotation Sub } restoreAbsOrInc IF NOT MasterOp? SeqLabC EndSub EOL CloseSub END END END END RETURN tpRapidFeat: IF TurningOp? IF XMove? OR ZMove? IF NOT FirstFeat? AND LAST ThreadFeat? SeqLabC ckCRC Rapid MoveXC MoveZC EOL ELSE SeqLabC ckCRC RapidC MoveXC MoveZC EOL END END ELSE IF FaceTool? IF RotaryMill? IF XMove? OR YMove? OR ZMove? SeqLabC ckCRC pciRapidC doAbsOrInc doMoveXC doMoveYC doMoveZC pciRapidFC EOL END ELSE CalcCAng IF XMove? OR YMove? OR ZMove? OR CMove? SeqLabC ckCRC RapidC doAbsOrInc doMoveXC doMoveYC doMoveZC doMoveCC EOL END END ELSE {implies OD Tool} IF RotaryMill? CalcCAng IF XMove? OR ZMove? OR CMove? SeqLabC ckCRC RapidC doAbsOrInc doMoveXC doMoveZC doMoveCC EOL END ELSE CalcCAng IF XMove? OR YMove? OR ZMove? OR CMove? SeqLabC ckCRC RapidC doAbsOrInc doMoveXC doMoveYC doMoveZC doMoveCC EOL END END END END RETURN tpLineFeat: IF TurningOp? IF XMove? OR ZMove? SeqLabC ckCRC FeedC MoveXC MoveZC FeedRateC EOL END ELSE IF FaceTool? IF RotaryMill? IF XMove? OR YMove? OR ZMove? SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveYC doMoveZC doFeedRate EOL END ELSE IF XMove? OR YMove? OR ZMove? SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveYC doMoveZC doFeedRate EOL END END ELSE {implies OD Tool} IF RotaryMill? CalcCAng IF XMove? OR ZMove? OR CMove? SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveZC doMoveCC doFeedRate EOL END ELSE IF XMove? OR YMove? OR ZMove? SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveYC doMoveZC doFeedRate EOL END END END END RETURN formatArc: {Apply to milling only - JHE} IF ArcCW? CWArcC ELSE CCWArcC END doMoveXC doMoveYC doMoveZC IF FaceTool? ArcRC ELSE CircleJC CircleKC END RETURN tpArcFeat: IF TurningOp? EACHQuadrant { Do not use NOT, LAST, FIRST or NEXT modifiers in this loop } IF ArcCW? CWArcC ELSE CCWArcC END SeqLabC MoveXC MoveZC ArcRC FeedRateC EOL NEXTQuadrant ELSE IF FaceTool? IF RotaryMill? EACHQuadrant SeqLabC doAbsOrInc formatArc doFeedRate EOL NEXTQuadrant ELSE EACHQuadrant SeqLabC doAbsOrInc formatArc doFeedRate EOL NEXTQuadrant END ELSE {implies OD Tool} IF RotaryMill? EACHArcSegment CalcCAng IF XMove? OR ZMove? OR CMove? SeqLabC FeedC doAbsOrInc doMoveXC doMoveZC doMoveCC doFeedRate EOL END NEXTArcSegment ELSE EACHQuadrant SeqLabC doAbsOrInc formatArc doFeedRate EOL NEXTQuadrant END END END RETURN tpThreadFeat: IF Flag?('10') {IF Standard G-codes} SeqLabC 'G32' MoveXC MoveZC ThrdLead EOL ELSE {Special G-codes} SeqLabC 'G33' MoveXC MoveZC ThrdLead EOL END RETURN toolPath: EACHFeat IF FirstFeat? resetSP END IF TurningOp? GetToolTip IF LastFeat? tpLastFeat END END IF PointFeat? tpPointFeat ELSE IF RapidFeat? tpRapidFeat ELSE IF LineFeat? tpLineFeat ELSE IF ArcFeat? tpArcFeat ELSE IF TurningOp? AND ThreadFeat? tpThreadFeat END END END END END IF LastFeat? getEP END NEXTFeat restoreAbsOrInc RETURN checkRapid: IF LAST TurningOp? IF LAST CannedCycle? IF LAST Roughing? Rapid ELSE IF LAST Threading? Rapid END END ELSE IF LAST Threading? Rapid ELSE RapidC END END ELSE IF LAST Drilling? RapidC ELSE pciRapidC END END RETURN checkRapid2: IF TurningOp? IF CannedCycle? IF Roughing? Rapid ELSE IF Threading? Rapid END END ELSE IF Threading? Rapid ELSE RapidC END END ELSE IF Drilling? RapidC ELSE pciRapidC END END RETURN checkPass: Plane2 SetPass1 IF NOT TurningOp? IF Autocycle? SetPass2 END END RETURN autoCycCutSub1: {part 1} SaveSubStatus {save tool position} SetPass1 {element cut moves} startSub SetSRXYtoSP SetInc RETURN autoCycCutSub2: {part 2} toolPath SetAbs SeqLabC CRCOffC IF Repeats? AND FeedConnect? AND ZshiftOnly? ELSE pciRapidC doMillCP2 pciRapidFC END EOL SeqLabC EndSub EOL CloseSub SetSRSubXY {restore SR to 1st position value} SetSRSubMove RETURN autoCycPat: SetPass2 {position pattern} toolPath {call after NewProg for correct sub calls} SetPass1 {reset} RETURN doSepSubContour: SetPass1 IF FaceTool? TrackZNO# SPZ# ELSE {implies OD Tool} TrackXNO# SPX# END startSub RapidF# IF AutoCycle? NewProg autoCycCutSub1 {build element sub} IF FaceTool? TrackZNO# SPZ# ELSE {implies OD Tool} TrackXNO# SPX# END autoCycCutSub2 ELSE toolPath finishSub1 SeqLabC EndSub EOL CloseSub END SetPass1 SetStatusRapid RapidF# SetSRXYtoEP IF FaceTool? TrackZNO# ZOpCP# ELSE {implies OD Tool} TrackXNO# XOpCD# END TrackCNO# Recall# Num#('4') { cOpEP } RETURN doSepSubFeedConnect: IF FeedConnect? IF CMove? AngleFeedC ELSE FeedEntC END ELSE pciRapidFC END RETURN doSepSubSPMove: SetStatusOff IF RotaryMill? CalcSCAng IF FaceTool? IF SPXMove? OR CMove? IF Rotations? OR AutoCycle? SetInc END SeqLabC Connect doMoveSXC doMoveCC doSepSubFeedConnect EOL SetAbs ELSE Connect END ELSE {implies OD Tool} IF SPZMove? OR CMove? IF Rotations? OR AutoCycle? SetInc END SeqLabC Connect doMoveSZC doMoveCC doSepSubFeedConnect EOL SetAbs ELSE Connect END END ELSE IF FaceTool? IF SPXMove? OR SPYMove? IF AutoCycle? SetInc END SeqLabC pciConnect doMoveSXC doMoveSYC doSepSubFeedConnect EOL SetAbs ELSE Connect END ELSE {implies OD Tool} IF SPYMove? OR SPZMove? IF AutoCycle? SetInc END SeqLabC Connect doMoveSYC doMoveSZC doSepSubFeedConnect EOL SetAbs ELSE Connect END END END SetStatusOn RETURN doSepSubDMoves: IF FeedConnect? SeqLabC FeedC ZInPlusInc FeedEnt EOL ELSE IF FeedEntry? IF NOT FirstCycle? SeqLabC pciRapidC ZCP2PlusInc pciRapidFC EOL END SeqLabC Feed ZInPlusInc FeedEnt EOL ELSE IF FirstCycle? AND AutoCycle? pciRapid END SeqLabC pciRapidC ZInPlusInc pciRapidFC EOL END END SeqLabC SubCall CallLab EOL IF NOT FeedConnect? AND NOT AbsValue? IF FaceTool? TrackZNO# ZCP2PlusInc# IF NOT Equal? ZCP2PlusInc# ZOpCP# SeqLabC doMillCP2 EOL END IF NOT AutoCycle? TrackZNO# ZOpECP# END ELSE {implies OD Tool} TrackXNO# ZCP2PlusInc# IF NOT Equal? ZCP2PlusInc# XOpCD# SeqLabC doMillCP2 EOL END IF NOT AutoCycle? TrackXNO# XOpECD# END END END RETURN setSepSubD: SetAbs IF FaceTool? TrackZNO# ADD# SPZ# MUL# RepsLess1# RepeatZ# ELSE {implies OD Tool} TrackXNO# ADD# SPX# MUL# RepsLess1# RepeatX# END SetInc RETURN doSepSubExit: IF NOT AbsValue? setSepSubD END IF AutoCycle? SeqLabC pciRapid doMillCP2 pciRapidFC EOL ELSE pciRapid {Feed/Rapid Will be output at millingOp ZCP3 - DWB} END RETURN resetSepSubSR: SetPass1 SetStatusRapid RapidF# IF FaceTool? TrackXNO# Recall# Num#('1') { xOpEP } ELSE TrackZNO# Recall# Num#('3') { zOpEP } END TrackYNO# Recall# Num#('2') { yOpEP } TrackCNO# Recall# Num#('4') { cOpEP } RETURN doOnlyRepAutoCycle: doSepSubContour EachCycle IF NOT FirstCycle? doSepSubSPMove END doSepSubDMoves NextCycle IF FeedConnect? doSepSubExit END SeqLabC EndSub EOL CloseSub {Element shift, not pattern} autoCycPat {write pattern moves and main calls} resetSepSubSR IF FaceTool? TrackZNO# ZOpCP# ELSE {implies OD Tool} TrackXNO# XOpCD# END RETURN doOnlyRep: doSepSubContour EachCycle IF NOT FirstCycle? doSepSubSPMove END doSepSubDMoves NextCycle resetSepSubSR IF FeedConnect? doSepSubExit ELSE {implies OD Tool} IF FaceTool? TrackZNO# ZOpECP# ELSE TrackXNO# XOpECD# END END RETURN milling: IF AutoCycle? NewProg autoCycCutSub1 entryMove autoCycCutSub2 autoCycPat ELSE entryMove toolPath END RETURN g92Sub: subWarning stdSub SetAbs SeqLabC pciConnect doStartPos pciRapidFC EOL milling finishSub1 finishSubG92 RETURN millingOp: SeqLabC doMillCP2C EOL IF Repeats? NewProg IF ZshiftOnly? IF AutoCycle? {incremental Autocycle sub can have Z moves} doOnlyRepAutoCycle ELSE {Z shift only, NOT Auto Cycle} SetFlag('1') { Milling ZShiftOnly SepSubs activated } doOnlyRep SetFlagF('1') { Milling ZShiftOnly SepSubs deactivated } END {end Auto Cycle IF} ELSE {not Z only} g92Sub END {end Z only IF} ELSE {no repeat OPs} milling END IF AutoCycle? SeqLabC CRCOffC doMillCP3C EOL setSRXYtoACEP ELSE SeqLabC CRCOffC pciRapidC doMillCP3C pciRapidFC EOL END RETURN skipToLastFeat: EachFeat IF LastFeat? IF FaceTool? TrackXNO# SPX# ELSE TrackZNO# SPZ# END TrackYNO# SPY# CalcSCAng TrackCNO# MoveC# END NextFeat RETURN setDrillEndOpD: IF FaceTool? IF RetractToCP1? TrackZNO# ThisOpEntryZCP# ELSE TrackZNO# ZOpCP# END ELSE {implies OD Tool} IF RetractToCP1? TrackXNO# ThisOpEntryXCP# ELSE TrackXNO# XOpCD# END END RETURN doCycle: IF FaceTool? IF FIFO? 'G85' ELSE IF Tap? 'G84' ELSE 'G83' END END ELSE IF FIFO? 'G89' ELSE IF Tap? 'G88' ELSE 'G87' END END END RETURN doDrillStartPos: IF FaceTool? IF RotaryMill? XSP CalcSCAng MoveC ELSE XSP MoveSY CalcSCAng MoveC END ELSE {implies OD Tool} IF RotaryMill? ZSP CalcSCAng MoveC ELSE MoveSY ZSP CalcSCAng MoveC END END RETURN doDrillDepth: IF FaceTool? MoveSZC ELSE MoveSXC END RETURN doRLevel: {R level is the distance from Current Tool Position to CP2 - DWB} SetStatusOff IF RetractToCP1? XsAreRadii IF FaceTool? 'R' SUB# ZOpCP# ThisOpEntryZCP# ELSE 'R' SUB# XOpCD# ThisOpEntryXCP# END XsAreRadiiF ELSE 'R0' END SetStatusOn RETURN doPeck: IF Peck? 'Q' Peck# END RETURN doDwell: IF Dwell? 'P' Dwell# END RETURN drillingOp: SeqLabC doDrillCP EOL GetCycle IF Tap? IF NOT CWSpindle? SeqLabC 'M94' EOL { Change of Milling Motor Rotating Direction on RigidTap Cycle } END SeqLabC 'M29' Speed EOL { Rigid Tap SpinOn } END SeqLabC doCycle doDrillDepth doRLevel doPeck doDwell IF Tap? 'F' FeedTapIPR#('1') ELSE FeedEnt END EOL IF CallMasterOp? SeqLabC SubCall CallLabB CallMasterNum# EOL skipToLastFeat ELSE IF FaceTool? TrackZNO# SPZ# ELSE TrackXNO# SPX# END IF MasterOp? SetFlag('1') { DrillSubs activated } NewMasterProg SeqLabC SubCall CallLab EOL startSub toolPath SeqLabC EndSub EOL CloseSub SetFlagF('1') { DrillSubs deactivated } ELSE toolPath END END setDrillEndOpD IF NOT Rotations? SeqLabC DrillOff Rapid doMillCP3 EOL END RETURN rotateStartPosC: IF FaceTool? TrackXNO# Recall# Num#('1') { xOpEP } IF RotaryMill? MoveSXC CalcSCAng MoveC ELSE TrackYNO# Recall# Num#('2') { yOpEP } MoveSXC doMoveSYC CalcSCAng MoveC END ELSE {implies OD Tool} TrackZNO# Recall# Num#('3') { zOpEP } IF RotaryMill? MoveSZC CalcSCAng MoveC ELSE TrackYNO# Recall# Num#('2') { yOpEP } doMoveSYC MoveSZC CalcSCAng MoveC END END RETURN rotaryReps: {use the correct EndPos} EachRotation IF Milling? IF FirstRotation? NewProg SaveProgNum2 StartSub millingOp SeqLabC EndSub EOL CloseSub checkPass ELSE SeqLabC rotateStartPosC EOL END SeqLabC SubCall CallLabB Program2# EOL ELSE IF Drilling? IF FirstRotation? drillingOp checkPass ELSE IF FaceTool? AND RetractToCP1? AND Equal? ThisOpEntryZCP# ZOpECP# SeqLabC rotateStartPosC EOL ELSE IF FaceTool? AND NOT RetractToCP1? AND Equal? ZOpCP# ZOpECP# SeqLabC rotateStartPosC EOL ELSE IF NOT FaceTool? AND RetractToCP1? AND Equal? ThisOpEntryXCP# XOpECD# SeqLabC rotateStartPosC EOL ELSE IF NOT FaceTool? AND NOT RetractToCP1? AND Equal? XOpCD# XOpECD# SeqLabC rotateStartPosC EOL ELSE { Need to cancel Drill Cycle between Rotations } SeqLabC DrillOff Rapid doMillCP3 EOL SeqLabC rotateStartPosC EOL SeqLabC doDrillCP EOL SeqLabC doCycle doDrillStartPos doDrillDepth doRLevel doPeck doDwell FeedEnt EOL END END END END END IF CallMasterOp? IF NOT FirstRotation? SeqLabC SubCall CallLabB CallMasterNum# EOL END ELSE IF MasterOp? IF NOT FirstRotation? SeqLabC SubCall CallLab EOL END ELSE IF Flag?('9') { valid Drill Rotation Sub } SeqLabC SubCall CallLab EOL END END END IF LastRotation? SeqLabC DrillOff Rapid doMillCP3 EOL END END END IF LastRotation? EachFeat IF LastFeat? IF PointFeat? CalcSCAng ELSE CalcCAng END TrackCNO# MoveC# EOL END NextFeat END NextRotation IF FaceTool? TrackXNO# Recall# Num#('1') { xOpEP } TrackZNO# ZOpECP# ELSE TrackXNO# XOpECD# TrackZNO# Recall# Num#('3') { zOpEP } END TrackYNO# Recall# Num#('2') { yOpEP } RETURN roughingCycle: TagInc SetPass2 IF RoughContour? {1st block} {R is Pull out amount and I did it 1/4 of CutDepth} SeqLabC LCycle CutDepth 'R' MUL# CutDepth# Num#('0.25') EOL {2nd block} SeqLabC LCycle 'P' tagNextRef Tag# 'Q' tagPrevRef Tag# XStkLeft ZStkLeft FeedRate EOL tagNext Tag# EOL IF ApproachFace? SeqLab StepMove ZSP EOL SeqLabC FeedC XSP EOL ELSE {implies OD or ID} SeqLab StepMove XSP EOL SeqLabC FeedC ZSP EOL END ELSE IF RoughPatternShift? SeqLabC LCycle XminusU ZminusW NumCuts EOL SeqLabC LCycle 'P' tagNextRef Tag# 'Q' tagPrevRef Tag# XStkLeft ZStkLeft FeedRate EOL tagNext Tag# EOL SeqLab StepMove StrtPos EOL END END toolPath tagPrev Tag# EOL IF AutoFinish? SeqLabC 'G70' 'P' tagNextRef Tag# 'Q' tagPrevRef Tag# EOL END SetPass1 TrackXNO# CycleStartX# TrackZNO# CycleStartZ# RETURN threadCycle: IF Chamfer? SeqLabC 'M23' EOL END {1st block} SeqLabC LCycle 'P' SpringPasses# DIV# RunOutZ# FeedIPR# FORMAT(MUL#,9) MUL# InFeedAngle# Num#('2') FORMAT(MUL#,2) FORMAT(LastCutXRadius#,6) 'Q' LastCutXRadius# {min depth of cut = last cut} FORMAT(LastCutXRadius#,2) 'R' LastCutXRadius# EOL {2nd block} SeqLabC LCycle XatFinZ FinZ XTapAtZ ThrdHeight CutDepth ThrdLead EOL IF Chamfer? SeqLabC 'M24' EOL END RETURN drillingCycles: SeqLabC LCycle ZDepth RLevel Peck IF Dwell? 'P' Dwell# FeedRate EOL ELSE FeedRate EOL END SeqLabC DrillOff Rapid ZOpECP EOL RETURN latheOp: IF CannedCycle? StockOff IF Roughing? roughingCycle ELSE IF Threading? threadCycle ELSE IF Drilling? drillingCycles END END END ELSE StockOn SetPass1 toolPath IF Drilling? AND Tap? SeqLabC SpinOff EOL SeqLabC 'G4P500' EOL SeqLabC Speed SpinOn EOL END END RETURN opGuts: IF TurningOp? latheOp ELSE IF FaceTool? AND AutoCycle? AND RotaryMill? '*************************************' EOL 'WARNING!!! Patterns and Thread Milling are not supported' EOL ' in Face Operations !!!' EOL '*************************************' EOL END IF Rotations? rotaryReps ELSE IF Milling? millingOp ELSE IF Drilling? drillingOp END END END END RETURN toolSeqInit: { Tool Sequence Line Numbers } Save# Num#('21') Num#('-1') { Tool 1 } Save# Num#('22') Num#('-1') { Tool 2 } Save# Num#('23') Num#('-1') { Tool 3 } Save# Num#('24') Num#('-1') { Tool 4 } Save# Num#('25') Num#('-1') { Tool 5 } Save# Num#('26') Num#('-1') { Tool 6 } Save# Num#('27') Num#('-1') { Tool 7 } Save# Num#('28') Num#('-1') { Tool 8 } Save# Num#('29') Num#('-1') { Tool 9 } Save# Num#('30') Num#('-1') { Tool 10 } Save# Num#('31') Num#('-1') { Tool 11 } Save# Num#('32') Num#('-1') { Tool 12 } RETURN toolSeq: Save# ADD# Tool# Num#('20') ADD# Recall# ADD# Tool# Num#('20') Num#('1') IF TurningOp? AND CutOff? FORMAT(Recall#,9) ELSE FORMAT(Recall#,11) END 'N' Tool# Recall# ADD# Tool# Num#('20') FORMAT(Recall#,2) RETURN progStart: InitProg SetAbs PosSideLathe StandardXZArcs {XsAreRadii} SetFlood SetMaxRPM('8000') IF Metric? SetMaxFeed('12700') SetArcSegmentAccuracy('.0127') {Added - JHE} ELSE SetMaxFeed('500') SetArcSegmentAccuracy('.0005') {Changed from .001 - JHE} END PalletInF { Spindle #2 } Save# Num#('1') Num#('0') { xOpEP } Save# Num#('2') Num#('0') { yOpEP } Save# Num#('3') Num#('0') { zOpEP } Save# Num#('4') Num#('0') { cOpEP } SetFlagF('1') { Milling dShiftOnly SepSubs deactivated } SetFlagF('9') { For valid Drill Rotation Sub } SetFlag('10') { True for Fanuc Control with Standard G-codes } { False for Fanuc Control with Special G-codes } SetFlagF('21') { Spindle #2 } toolSeqInit IF PSComment? AND UseComments? 'Utility Data:' EOL ' At Op Start: All literals and commands will appear at the beginning of the operation.' EOL ' At Op End: All literals and commands will appear at the end of the operation.' 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 ' Pin(1) -' EOL ' This command will cause the Post Processor to output code related to the Right Unit.' EOL ' MistCoolant, MCool -' EOL ' This command will cause the Post Processor to output M06, Low Coolant On when' EOL ' entered in the At Op Start field of the Operation Data Dialog.' EOL ' This command will cause the Post Processor to output M07, Low Coolant Off when' EOL ' entered in the At Op End field of the Operation Data Dialog.' EOL END RETURN initOp: EOR EOL ':' Program# EOL IF UseComments? AND ProgramNameComment? '( ' ProgramName$ ' )' EOL END 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 OpenSub restoreScale RETURN getCoolOn: IF Mist? SeqLabC 'M6' EOL { Low Pressure } ELSE SeqLabC CoolOn EOL { High Pressure } END RETURN getCoolOff: IF Mist? SeqLabC 'M7' EOL { Low Pressure } ELSE SeqLabC CoolOff EOL { High Pressure } END RETURN firstOp1: StockOff SetHome doPostScript IF Flag?('21') { Spindle #2 } SeqLabC 'M100(SAFETY)' EOL { Waiting Code } SeqLabC 'G28U0W0M11' EOL { XZ-Axis Reference Point Return, Chuck Close } SeqLabC 'M74' EOL { Parts Catcher Retreat } SeqLabC 'M84' EOL { PartOff Checker Advance } SeqLabC 'M85' EOL { PartOff Checker Retreat } SeqLabC 'M91' EOL { Selection of the C-Axis } SeqLabC 'G28H0' EOL { C-Axis Reference Point Return } SeqLabC 'G50C0' EOL { Preset C-Axis to Zero } SeqLabC 'G0W0M20' EOL { Rapid Advance Spindle#2, Air Blow On } SeqLabC 'G1G98W0F50.M14' EOL { Feed Advance Spindle#2, Spindle Air Blow On } SeqLabC 'M15' EOL { Spindle Air Blow Off } SeqLabC 'M10' EOL { Chuck Open } SeqLabC 'G4U.5' EOL { Dwell } SeqLabC 'M101(GO LT)' EOL { Waiting Code } SeqLabC 'M102(WAIT)' EOL { Waiting Code } SeqLabC 'G1W0F100.' EOL { Feed Spindle/Stock into Position } SeqLabC 'M103(GO LT)' EOL { Waiting Code } SeqLabC 'M104(WAIT)' EOL { Waiting Code } SeqLabC 'M41' EOL { Selection of the Main Spindle, C-Axis Disengage } SeqLabC 'M96(SPINDLE SINK)' EOL { Synchronize Right Spindle to Left Spindle } SeqLabC 'M105(GO LT)' EOL { Waiting Code } SeqLabC 'M106(WAIT)' EOL { Waiting Code } SeqLabC 'G300W.04' EOL { PartOff Detection Advance } SeqLabC 'G28W0M97' EOL { Spindle#2 Reference Point Return, UnSynchronize Right Spindle } SeqLabC 'M107(GO LT)' EOL { Waiting Code } ELSE { Spindle #1 } SeqLabC 'G28U0W0' EOL { XZ-Axis Reference Point Return } END SeqLabC ProgStop EOL ' ' EOL toolSeq doOpComments EOL checkPass IF TurningOp? SeqLabC 'G18' EOL { ZXPlane } SeqLabC Rapid OpToolID LatheOffset EOL IF NOT Flag?('21') { Spindle #1 } SeqLabC 'M470' EOL { Y-Axis Lock } END SeqLabC 'M41' EOL { Selection of the Main Spindle, C-Axis Disengage } getCoolOn IF ConstantSurfaceFeed? SeqLabC Preset MaxRPM EOL SeqLabC CSSOn 'G96' ELSE SeqLabC CSSOff 'G97' END IF Flag?('10') {Standard G-codes} 'G99' { Inches Per Revolution } ELSE {Special G-codes} 'G95' { Inches Per Revolution } END Speed doSpinOn EOL ELSE IF FaceTool? SeqLabC 'G17' EOL { XYPlane } ELSE {implies OD Tool} SeqLabC 'G19' EOL { YZPlane } END SeqLabC Rapid OpToolID LatheOffset EOL IF NOT Flag?('21') { Spindle #1 } IF RotaryMill? SeqLabC 'M470' EOL { Y-Axis Lock } ELSE SeqLabC 'M471' EOL { Y-Axis UnLock } END END SeqLabC 'M91' EOL { Selection of the C-Axis } SeqLabC 'G28H0' EOL { C-Axis Reference Point Return } SeqLabC Preset 'C' TrackC# Num#('0') EOL { C-Axis Zero Reference Return } IF Drilling? GetCycle END getCoolOn SeqLabC CSSOff 'G97' IF Flag?('10') {IF Standard G-codes} IF Drilling? AND Tap? 'G99' { Inches Per Revolution } ELSE 'G98' Speed doSpinOn { Inches Per Minute } END ELSE {Special G-codes} 'G94' Speed doSpinOn { Inches Per Minute } END EOL END RETURN turnApproach: Rapid RapidF# { RapidF# Forces FeedRate } IF ApproachOD? SeqLabC StockOff ThisOpEntryXCP ELSE IF ApproachID? SeqLabC StockOff XOpCD ELSE {ApproachFace} SeqLabC stockOnNoCan XSP END END StockOff IF NOT CutOff? ThisOpEntryZCP { The Tool is already there } END EOL RETURN turnApproachSP: IF ApproachFace? SeqLabC stockOnNoCan XSPC EOL SeqLabC StockOff ZOpCPC EOL stockOnNoCan IF NotEqual? CycleStartZ# ZOpCP# SeqLabC feedNoCan ZSPC feedRateNoCan EOL END ELSE { OD/ID Approach } SeqLabC stockOnNoCan ZSPC EOL SeqLabC StockOff XOpCDC EOL stockOnNoCan IF NotEqual? CycleStartX# XOpCD# SeqLabC feedNoCan XSPC feedRateNoCan EOL END END RETURN millApproach: RapidF# { RapidF# Forces FeedRate } IF FaceTool? IF RotaryMill? IF Milling? pciOn SeqLabC pciRapid stockOn XSP doMoveSY StockOff ThisOpEntryZCP pciRapidF EOL CalcSCAng TrackCNO# MoveC# ELSE SeqLabC stockOn Rapid XSP doMoveSY StockOff ThisOpEntryZCP CalcSCAng MoveC TrackYNO# SPY# END ELSE SeqLabC Rapid stockOn XSP doMoveSY StockOff ThisOpEntryZCP CalcSCAng MoveC END ELSE {implies OD Tool} IF RotaryMill? SeqLabC Rapid StockOff ThisOpEntryXCP ThisOpEntryZCP CalcSCAng MoveC EOL TrackYNO# SPY# ELSE SeqLabC Rapid StockOff ThisOpEntryXCP doMoveSY ThisOpEntryZCP CalcSCAng MoveC EOL END END RETURN millApproachSP: IF FaceTool? IF RotaryMill? SeqLabC pciRapidC stockOn XSPC doMoveSYC pciRapidFC EOL ELSE SeqLabC stockOn RapidC XSPC doMoveSYC CalcSCAng MoveCC EOL TrackYNO# SPY# END setAngleUnder360 IF Milling? SeqLabC StockOff ZOpCPC EOL END ELSE {implies OD Tool} IF RotaryMill? SeqLabC StockOn RapidC doMoveSYC ZSPC CalcSCAng MoveCC EOL TrackYNO# SPY# ELSE SeqLabC StockOn RapidC doMoveSYC ZSPC CalcSCAng MoveCC EOL END setAngleUnder360 IF Milling? SeqLabC StockOff XOpCDC EOL END END StockOn RETURN newToolOp1: {Finish off last Operation} StockOff checkRapid IF LAST ApproachOD? SeqLabC LAST OpExitXCPC pciRapidFC EOL ELSE IF LAST ApproachID? SeqLabC LAST XOpECDC pciRapidFC EOL END END SeqLabC LAST OpExitZCPC pciRapidFC EOL pciOff RETURN newToolOp2: doEndOpPS getCoolOff IF LAST TurningOp? IF LAST ConstantSurfaceFeed? SeqLabC CSSOff 'G97' CalcRPM2 EOL END SeqLabC 'G28U0W0' EOL { XZ-Axis Reference Point Return } ELSE IF Flag?('21') { Spindle #2 } IF LAST Milling? SeqLabC 'G28U0W0M19' EOL { XZ-Axis Reference Point Return, Spindle Orientation On } ELSE SeqLabC 'G28U0W0H0M19' EOL { XZC-Axis Reference Point Return, Spindle Orientation On } END ELSE IF LAST RotaryMill? SeqLabC 'G28U0W0H0M19' EOL { XZC-Axis Reference Point Return, Spindle Orientation On } ELSE SeqLabC 'G28U0W0V0M19' EOL { XYZ-Axis Reference Point Return, Spindle Orientation On } resetAngle0 END END END IF LAST ProgStop? SeqLabC 'M0' EOL ELSE SeqLabC ProgStop EOL END RETURN newToolOp3: {Start new Operation} doPostScript ' ' EOL toolSeq doOpComments EOL checkPass IF TurningOp? SeqLabC 'G18' EOL { ZXPlane } SeqLabC Rapid OpToolID LatheOffset EOL IF NOT Flag?('21') { Spindle #1 } SeqLabC 'M470' EOL { Y-Axis Lock } END IF CutOff? SeqLabC 'M91' EOL { Selection of the C-Axis } SeqLabC 'G28H0' EOL { C-Axis Reference Point Return } SeqLabC Preset 'C' TrackC# Num#('0') EOL SeqLabC Rapid StockOff ThisOpEntryZCP EOL SeqLabC stockOnNoCan ZSPC EOL SeqLabC 'M75(CYCLE START RT)' EOL { Right Unit Auto Cycle Start } SeqLabC 'M100(SAFETY)' EOL { Waiting Code } SeqLabC 'M101(WAIT)' EOL { Waiting Code } SeqLabC 'M11' EOL { Chuck Close } SeqLabC 'G4U.5' EOL { Dwell } SeqLabC 'M102(GO RT)' EOL { Waiting Code } SeqLabC 'M103(WAIT)' EOL { Waiting Code } SeqLabC 'M10' EOL { Chuck Open } SeqLabC 'G4U.5' EOL { Dwell } END SeqLabC 'M41' EOL { Selection of the Main Spindle, C-Axis Disengage } IF CutOff? SeqLabC 'M104(GO RT)' EOL { Waiting Code } SeqLabC 'M105(WAIT)' EOL { Waiting Code } END getCoolOn IF ConstantSurfaceFeed? SeqLabC Preset MaxRPM EOL SeqLabC CSSOn 'G96' ELSE SeqLabC CSSOff 'G97' END IF Flag?('10') {IF Standard G-codes} 'G99' { Inches Per Revolution } ELSE {Special G-codes} 'G95' { Inches Per Revolution } END Speed doSpinOn EOL ELSE IF FaceTool? SeqLabC 'G17' EOL { XYPlane } ELSE {implies OD Tool} SeqLabC 'G19' EOL { YZPlane } END SeqLabC Rapid OpToolID LatheOffset EOL IF NOT Flag?('21') { Spindle #1 } IF RotaryMill? SeqLabC 'M470' EOL { Y-Axis Lock } ELSE SeqLabC 'M471' EOL { Y-Axis UnLock } END END SeqLabC 'M91' EOL { Selection of the C-Axis } SeqLabC 'G28H0' EOL { C-Axis Reference Point Return } SeqLabC Preset 'C' TrackC# Num#('0') EOL { C-Axis Zero Reference Return } IF Drilling? GetCycle END getCoolOn SeqLabC CSSOff 'G97' IF Flag?('10') {IF Standard G-codes} IF Drilling? AND Tap? 'G99' { Inches Per Revolution } ELSE 'G98' Speed doSpinOn { Inches Per Minute } END ELSE {Special G-codes} 'G94' Speed doSpinOn { Inches Per Minute } END EOL END RETURN sameToolOp1: StockOff doOpComments checkRapid checkPass IF ApproachOD? IF LAST ApproachOD? SeqLabC LAST XOpECDC pciRapidFC EOL ELSE {around} IF LAST ApproachID? SeqLabC LAST XOpECDC pciRapidFC EOL END SeqLabC LAST OpExitZCPC pciRapidFC EOL SeqLabC LAST OpExitXCPC pciRapidFC EOL END ELSE IF ApproachID? IF LAST ApproachID? SeqLabC LAST XOpECDC pciRapidFC EOL ELSE IF LAST ApproachOD? {around} SeqLabC LAST OpExitXCPC pciRapidFC EOL END SeqLabC LAST OpExitZCPC pciRapidFC EOL SeqLabC XOpCDC pciRapidFC EOL END ELSE {ApproachFace} IF LAST ApproachFace? SeqLabC LAST ZOpECPC pciRapidFC EOL ELSE IF LAST ApproachOD? {around} SeqLabC LAST OpExitXCPC pciRapidFC EOL ELSE {LAST ApproachID} SeqLabC LAST XOpECDC pciRapidFC EOL END SeqLabC LAST OpExitZCPC pciRapidFC EOL END END END IF NOT TurningOp? AND RotaryMill? AND FaceTool? pciOn ELSE pciOff END RETURN sameToolOp2: doEndOpPS IF LAST ProgStop? SeqLabC 'M0' EOL ELSE IF CoolOff? AND LAST NOT CoolOff? getCoolOff END END IF NewToolOffset? SeqLabC OpToolID '00' EOL SeqLabC OpToolID LatheOffset EOL END IF TurningOp? IF LAST ProgStop? IF ConstantSurfaceFeed? SeqLabC Preset MaxRPM EOL SeqLabC CSSOn 'G96' Speed SpinOn EOL ELSE SeqLabC CSSOff 'G97' Speed SpinOn EOL END getCoolOn ELSE IF ConstantSurfaceFeed? IF LAST ConstantSurfaceFeed? IF NotEqual? MaxRPM# LAST MaxRPM# SeqLabC Preset MaxRPM EOL END IF NotEqual? SpeedRPM# LAST SpeedRPM# SeqLabC 'G96' Speed EOL END ELSE SeqLabC Preset MaxRPM EOL SeqLabC CSSOn 'G96' Speed EOL END ELSE IF LAST ConstantSurfaceFeed? SeqLabC CSSOff 'G97' Speed EOL ELSE IF NotEqual? SpeedRPM# LAST SpeedRPM# SeqLabC 'G97' Speed EOL END END END IF LAST ProgStop? {Moved output up - JHE} ELSE IF NOT CoolOff? AND LAST CoolOff? getCoolOn END END END END doPostScript RETURN endOp1: {finish last operation} StockOff checkRapid2 IF ApproachOD? SeqLabC OpExitXCPC pciRapidFC EOL ELSE IF ApproachID? SeqLabC XOpECDC pciRapidFC EOL END END SeqLabC OpExitZCPC pciRapidFC EOL pciOff RETURN endOp2: doEndOpPS getCoolOff IF TurningOp? IF ConstantSurfaceFeed? SeqLabC CSSOff 'G97S' CalcEPRPM# EOL END IF CutOff? SeqLabC 'G28U0' EOL { X-Axis Reference Point Return } SeqLabC 'M106(GO RT)' EOL { Waiting Code } SeqLabC 'M107(WAIT)' EOL { Waiting Code } SeqLabC 'G28W0' EOL { Z-Axis Reference Point Return } SetLineStrtChr('/') SeqLabC 'M98P8000' EOL { BarFeed SubRoutine } SetLineStrtChr('') ELSE SeqLabC 'G28U0W0' EOL { XZ-Axis Reference Point Return } END ELSE IF Flag?('21') { Spindle #2 } IF Milling? SeqLabC 'G28U0W0M19' EOL { XZ-Axis Reference Point Return, Spindle Orientation On } ELSE SeqLabC 'G28U0W0H0M19' EOL { XZC-Axis Reference Point Return, Spindle Orientation On } END ELSE IF RotaryMill? SeqLabC 'G28U0W0H0M19' EOL { XZC-Axis Reference Point Return, Spindle Orientation On } ELSE SeqLabC 'G28U0W0V0M19' EOL { XYZ-Axis Reference Point Return, Spindle Orientation On } resetAngle0 END END END IF ProgStop? SeqLabC 'M0' EOL ELSE IF Flag?('21') { Spindle #2 } SeqLabC ProgStop EOL END END RETURN endOp3: IF Flag?('21') { Spindle #2 } ' ' EOL SeqLabC 'G28U0W0' EOL { XZ-Axis Reference Point Return } SeqLabC 'M73' EOL { Parts Catcher Advance } SeqLabC 'M11' EOL { Chuck Close } SeqLabC 'G4X.5' EOL { Dwell } SeqLabC 'M74' EOL { Parts Catcher Retreat } SeqLabC 'M31' EOL { WorkPiece Conveyor Start } END SeqLabC EOP EOL 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 RETURN {Start of executable Prog, Top Level ******************************} progStart EachOp GetLCycle IF FirstOperation? initOp firstOp1 IF TurningOp? turnApproach turnApproachSP ELSE millApproach millApproachSP END ELSE IF NewTool? newToolOp1 newToolOp2 newToolOp3 IF TurningOp? turnApproach turnApproachSP ELSE millApproach millApproachSP END ELSE sameToolOp1 sameToolOp2 IF TurningOp? turnApproachSP ELSE millApproachSP END END END opGuts NextOp endOp1 endOp2 endOp3

Wyszukiwarka