Fanuc 18T MS [PM] SML809 17 2


{
MILL=T
LATHE=T
ADV_MILL=F
SUBS=T
ROTARY_MILL=T
MILLTURN_POLAR-SEG=T
MILLTURN_Y-AXIS=F
METRIC=F
}

{Change Comments ***********************************************************}

{1/6/99,
Initial : Fanuc 16T [VG] YSML800.17
Created: Fanuc 16T [VG] SML800.17
Customer: Master Post for Gibbs & Associates

Changes to "Prog":

1. Removed all 'Y0.' output (6 times).
2. Removed all calls to MoveSY (8 times).
3. Under millApproach sub, removed TrackYNO# SPY# (2 times) and
moved it to the end of the sub.
JHE}

{1/20/99,
Initial : Fanuc 16T [VG] SML800.17
Created: Fanuc 16T [VG] SML800.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}

{1/25/99,
Initial : Fanuc 16T [VG] SML800.17.1
Created: Fanuc 18T MS [PM] SML809.17.1
Customer: Peterson Machine, Rex Jensen 801/876-2615
ComPost2: v1.7b15

Changes to "Form":

1. Under Default Format, changed O to 0000
2. Under Origins and Values, added G54 as the 1st WFO and G59 as the Last WFO.
3. Under Arcs, changed I-J Max Arc Radius to 0.000
4. Under Turn Rough - OD/ID, changed X Stock Left to Dia.
5. Under Turn Rough - Face, changed X Stock Left to Dia.
6. Under Pattern Shift, changed X Stock Left to Dia.
7. Under Threading, changed Finish X and X Taper to Dia.

Changes to "Prog":

1. Changed XsAreRadii to F (dia output).
2. Added WFO1 block and FORMAT to NewWFO#.
3. Under tpArcFeat, changed CircleIC CircleKC to ArcR.
4. Removed all Flag('10') checks.
5. Changed firstOp1, turnApproach, and millApproach per customer spec.
6. Changed newToolOp2, newToolOp3, and endOp2 per customer spec.
7. Changed G80 into 2 blocks.
8. Added TrackCNO# Num#('0') after G28H0 block.
9. Added openToolSub and closeToolSub subs. This customer wants every tool in
a separate sub.
JHE}

{2/15/99,
Initial : Fanuc 18T MS [PM] SML809.17.1
Created: Fanuc 18T MS [PM] SML809.17.2
Customer: Peterson Machine, Rex Jensen 801/876-2615
ComPost2: v1.7b15

Changes to "Prog":

1. Added doODID sub to output OD, ID or FACE inside ToolTypeComment.
2. Moved Preset MaxRPM to be output after restart block.
3. Moved SpinOff to be output before M46.
JHE}

{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}

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(NewWFO#,3) {Added - JHE}
FORMAT(CalcEPRPM#,3)
FORMAT(Dwell#,4)
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)

{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

doODID:
IF ApproachOD?
' OD'
ELSE
IF ApproachID?
' ID'
ELSE {implies ApproachFace}
' FACE'
END
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$ doODID ' )' 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
RETURN

doPostScript:
psInit
EachPS
SeqLabC PostScript EOL {literals}
NextPS
RETURN

doEndOpPS:
psInit
EachEOPS
SeqLabC EndOpPS EOL {literals}
NextPS
RETURN

doMoveSXC:
IF AbsValue?
MoveSXC
ELSE
IF SPXMove?
'U' SPX#
END
END
RETURN

doMoveSYC:
IF AbsValue?
MoveSYC
ELSE
IF SPYMove?
'V' SPY#
END
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 AbsValue?
MoveYC
ELSE
IF YMove?
'V' EPY#
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# CalcSCAng MoveC
ELSE
'Z' TrackZ# SPZ# CalcSCAng MoveC
END
ELSE
IF FaceTool?
XSP TrackCNO# Num#('0')
ELSE
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 RapidC doZIn EOL
END
RETURN

startSub:
OpenSub
' ' EOL {Added space line - JHE}
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 RapidC doMillCP3C 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

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 TurningOp?
SpinOn
ELSE
IF CWSpindle?
'M13' {live tool CW}
ELSE
'M14' {live tool CCW}
END
END
RETURN

doFeedRate:
IF NOT EmptyLine?
IF RotaryMill?
AngleFeedC
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

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 EOL
ELSE
SeqLabC doDrillAbsOrInc doMoveSXC doMoveSYC doMoveSZC doMoveCC EOL
END
ELSE {implies OD Tool}
IF RotaryMill?
SeqLabC doDrillAbsOrInc doMoveSXC doMoveSZC doMoveCC EOL
ELSE
SeqLabC doDrillAbsOrInc doMoveSXC doMoveSYC doMoveSZC doMoveCC 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?
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
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?
EACHSpiralSeg
CalcCAng
IF XMove? OR ZMove? OR CMove?
SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveZC doMoveCC doFeedRate EOL
END
NEXTSpiralSeg
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 doMoveXC doMoveYC doMoveZC
ELSE
CCWArcC doMoveXC doMoveYC doMoveZC
END
IF FaceTool?
CircleIC CircleJC
ELSE
CircleJC CircleKC
END
RETURN

tpArcFeat:
IF TurningOp?
EACHQuadrant { Do not use NOT, LAST, FIRST or NEXT modifiers in this loop }
IF ArcCW?
SeqLabC CWArcC
ELSE
SeqLabC CCWArcC
END
MoveXC MoveZC ArcR FeedRateC EOL {Changed from CircleIC CircleKC - JHE}
NEXTQuadrant
ELSE
IF FaceTool?
IF RotaryMill?
{if the arc center and the rotary center coincide}
IF Equal? Num#('0') ArcCPH# AND Equal? Num#('0') ArcCPV#
CalcCAng
IF ZMove? OR CMove?
SeqLabC FeedC doAbsOrInc doMoveZC doMoveCC doFeedRate EOL
END
ELSE
EACHArcSegment
CalcCAng
IF XMove? OR ZMove? OR CMove?
SeqLabC FeedC doAbsOrInc doMoveXC doMoveZC doMoveCC doFeedRate EOL
END
NEXTArcSegment
END
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:
SeqLabC 'G32' MoveXC MoveZC ThrdLead EOL
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
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
RapidC doMillCP2
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
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 Connect 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 RapidC ZCP2PlusInc EOL
END
SeqLabC Feed ZInPlusInc FeedEnt EOL
ELSE
IF FirstCycle? AND AutoCycle?
Rapid
END
SeqLabC RapidC ZInPlusInc 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 Rapid doMillCP2 EOL
ELSE
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 Connect doStartPos 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 RapidC doMillCP3C 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 CalcSCAng MoveC
END
ELSE {implies OD Tool}
IF RotaryMill?
ZSP CalcSCAng MoveC
ELSE
ZSP CalcSCAng MoveC
END
END
RETURN

doDrillDepth:
IF FaceTool?
MoveSZC
ELSE
MoveSXC
END
RETURN

doRLevel:
{R level is the distance from CP1 to CP2 - JHE}
SetStatusOff
IF RetractToCP1?
IF FaceTool?
'R' SUB# ZOpCP# ThisOpEntryZCP#
ELSE
'R' SUB# XOpCD# ThisOpEntryXCP#
END
ELSE
'R0.'
END
SetStatusOn
RETURN

doPeck:
IF Peck?
'Q' Peck#
END
RETURN

doDwell:
IF Dwell?
'P' Dwell#
END
RETURN

drillingOp:
SeqLabC doDrillCP EOL
GetCycle
SeqLabC doCycle doDrillStartPos doDrillDepth doRLevel doPeck doDwell FeedEnt 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 EOL {Changed into 2 blocks - JHE}
SeqLabC 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 MoveSYC CalcSCAng MoveC
END
ELSE {implies OD Tool}
TrackZNO# Recall# Num#('3') { zOpEP }
IF RotaryMill?
MoveSZC CalcSCAng MoveC
ELSE
TrackYNO# Recall# Num#('2') { yOpEP }
MoveSYC 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 EOL {Changed into 2 blockd - JHE}
SeqLabC 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 EOL {Changed into 2 blocks - JHE}
SeqLabC 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 EOL {Changed into 2 blocks - JHE}
SeqLabC 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

openToolSub: {Added - JHE}
NewProg NewProg {Increment by 2 - JHE}
'N' Program# EOL
IF UseComments?
SetScale('1')
IF OperationComment?
'( ' OperationComment$ ' )' EOL
END
restoreScale
END
SeqLabC SubCall CallLab
IF UseComments?
SetScale('1')
IF ToolTypeComment?
IF TurningOp? AND NOT Drilling?
' ( ' ToolSize$ ' ' ToolType$ doODID ' )'
ELSE
' ( ' ToolDiameter# ' DIA. ' ToolType$ ' )'
END
END
restoreScale
END
EOL
startSub
RETURN

closeToolSub: {Added - JHE}
SeqLabC EndSub EOL
CloseSub
RETURN

progStart:
InitProg
SetAbs
PosSideLathe
StandardXZArcs
XsAreRadiiF {Changed to Dia output - JHE}
SetFlood
SetMaxRPM('8000')
NewWFOF {Added - JHE}
IF Metric?
SetMaxFeed('12700')
SetArcSegmentAccuracy('.0127')
ELSE
SetMaxFeed('500')
SetArcSegmentAccuracy('.0005')
END
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 }
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
END
RETURN

initOp:
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
OpenSub
restoreScale
RETURN

firstOp1:
StockOff
SetHome
doPostScript
checkPass
openToolSub {Added - JHE}
doOpComments
SeqLabC Rapid CRCOff DrillOff
IF TurningOp?
'G99' EOL {Inch per Rev Mode}
ELSE
'G98' EOL {Inch per Min Mode}
END
IF TurningOp?
IF ConstantSurfaceFeed?
SeqLabC Preset MaxRPM EOL {Moved to here - JHE 2/15}
END
END
IF NewWFO? {Added - JHE}
SeqLabC 'G' NewWFO# EOL
NewWFOF
ELSE
SeqLabC WFO1 EOL
END
SeqLabC 'G30U0.W0.' EOL {linear axes Home - JHE}
SeqLabC 'G28B0.' EOL {sub spindle Home - JHE}
IF TurningOp?
IF ConstantSurfaceFeed?
{*SeqLabC Preset MaxRPM EOL*}
SeqLabC CSSOff 'G97' CalcRPM1 doSpinOn OpToolID LatheOffset EOL
ELSE
SeqLabC CSSOff 'G97' Speed doSpinOn OpToolID LatheOffset EOL
END
ELSE
SeqLabC OpToolID LatheOffset EOL
SeqLabC 'M45' EOL {C-Axis Connection On - Milling Mode}
SeqLabC Rapid 'G28H0.' EOL {C-Axis Zero Reference Return}
TrackCNO# Num#('0') {Added - JHE}
SeqLabC CSSOff 'G97' Speed doSpinOn EOL
END
RETURN

turnApproach:
RapidF# { RapidF# Forces FeedRate }
IF ApproachOD?
SeqLabC StockOff Rapid ThisOpEntryXCP StockOff ThisOpEntryZCP CoolOn EOL
ELSE
IF ApproachID?
SeqLabC StockOff Rapid XOpCD StockOff ThisOpEntryZCP CoolOn EOL
ELSE {ApproachFace}
SeqLabC stockOnNoCan Rapid XSP StockOff ThisOpEntryZCP CoolOn EOL
END
END
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
IF ConstantSurfaceFeed? AND NOT SameTool?
SeqLabC CSSOn 'G96' Speed EOL
END
StockOn
RETURN

millApproach:
RapidF# { RapidF# Forces FeedRate }
IF FaceTool?
IF RotaryMill?
SeqLabC stockOn Rapid XSP StockOff ThisOpEntryZCP CalcSCAng MoveC CoolOn EOL
ELSE
SeqLabC stockOn Rapid XSP StockOff ThisOpEntryZCP CalcSCAng MoveC CoolOn EOL
END
ELSE {implies OD Tool}
IF RotaryMill?
SeqLabC StockOff Rapid ThisOpEntryXCP ThisOpEntryZCP CalcSCAng MoveC CoolOn EOL
ELSE
SeqLabC StockOff Rapid ThisOpEntryXCP ThisOpEntryZCP CalcSCAng MoveC CoolOn EOL
END
END
TrackYNO# SPY#
RETURN

millApproachSP:
IF FaceTool?
IF RotaryMill?
IF SameTool?
SeqLabC stockOn Rapid XSP CalcSCAng MoveC EOL
TrackYNO# SPY#
ELSE
SeqLabC StockOn RapidC XSPC MoveSYC CalcSCAng MoveCC EOL
END
ELSE
IF SameTool?
SeqLabC stockOn Rapid XSP CalcSCAng MoveC EOL
ELSE
SeqLabC stockOn RapidC XSPC MoveSYC CalcSCAng MoveCC EOL
END
END
setAngleUnder360
IF Milling?
SeqLabC StockOff ZOpCPC EOL
END
ELSE {implies OD Tool}
IF RotaryMill?
IF SameTool?
SeqLabC StockOn Rapid ZSP CalcSCAng MoveC EOL
TrackYNO# SPY#
ELSE
SeqLabC StockOn RapidC MoveSYC ZSPC CalcSCAng MoveCC EOL
END
ELSE
IF SameTool?
SeqLabC StockOn Rapid ZSP CalcSCAng MoveC EOL
ELSE
SeqLabC StockOn RapidC MoveSYC ZSPC CalcSCAng MoveCC EOL
END
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 EOL
ELSE
IF LAST ApproachID?
SeqLabC LAST XOpECDC EOL
END
END
SeqLabC LAST OpExitZCPC EOL
RETURN

newToolOp2:
doEndOpPS
IF LAST TurningOp?
IF NOT TurningOp?
SeqLabC 'G30U0.W0.' SpinOff EOL {stop spindle in next milling}
ELSE
SeqLabC 'G30U0.W0.' EOL {linear axes Home - JHE}
END
ELSE
SeqLabC SpinOff EOL
SeqLabC 'M46' EOL {C-Axis Connection Cancel}
SeqLabC 'G30U0.W0.' EOL {linear axes Home - JHE}
END
IF LAST ProgStop?
SeqLabC 'M0' EOL
ELSE
SeqLabC ProgStop EOL
END
closeToolSub {Added - JHE}
RETURN

newToolOp3: {Start new Operation}
doPostScript
checkPass
openToolSub {Added - JHE}
doOpComments
SeqLabC Rapid CRCOff DrillOff
IF TurningOp?
'G99' EOL {Inch per Rev Mode}
ELSE
'G98' EOL {Inch per Min Mode}
END
IF TurningOp?
IF ConstantSurfaceFeed?
SeqLabC Preset MaxRPM EOL {Moved to here - JHE 2/15}
END
END
IF NewWFO? {Added - JHE}
SeqLabC 'G' NewWFO# EOL
NewWFOF
ELSE
SeqLabC WFO1 EOL
END
SeqLabC 'G30U0.W0.' EOL {linear axes Home - JHE}
SeqLabC 'G28B0.' EOL {sub spindle Home - JHE}
IF TurningOp?
IF ConstantSurfaceFeed?
{*SeqLabC Preset MaxRPM EOL*}
SeqLabC CSSOff 'G97' CalcRPM1 doSpinOn OpToolID LatheOffset EOL
ELSE
SeqLabC CSSOff 'G97' Speed doSpinOn OpToolID LatheOffset EOL
END
ELSE
SeqLabC OpToolID LatheOffset EOL
SeqLabC 'M45' EOL {C-Axis Connection On - Milling Mode}
SeqLabC Rapid 'G28H0.' EOL {C-Axis Zero Reference Return}
TrackCNO# Num#('0') {Added - JHE}
SeqLabC CSSOff 'G97' Speed doSpinOn EOL
END
RETURN

sameToolOp1:
StockOff
doOpComments
checkRapid
checkPass
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
RETURN

sameToolOp2:
doEndOpPS
IF LAST ProgStop?
SeqLabC 'M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqLabC CoolOff EOL
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
SeqLabC CoolOn EOL
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?
SeqLabC CoolOn EOL
END
END
END
END
doPostScript
RETURN

endOp1: {finish last operation}
StockOff
IF ApproachOD?
SeqLabC Rapid OpExitXCP EOL
SeqLabC OpExitZCPC EOL
ELSE
IF ApproachID?
SeqLabC Rapid XOpECD EOL
SeqLabC OpExitZCPC EOL
ELSE {implies ApproachFace}
SeqLabC Rapid OpExitZCP EOL
END
END
RETURN

endOp2:
doEndOpPS
SeqLabC CoolOff EOL
IF NOT TurningOp?
SeqLabC SpinOff EOL
SeqLabC 'M46' EOL {C-Axis Connection Cancel}
SeqLabC 'G30U0.W0.' EOL {linear axes Home - JHE}
ELSE
SeqLabC 'G30U0.W0.' SpinOff EOL {linear axes Home - JHE}
END
IF ProgStop?
SeqLabC 'M0' EOL
ELSE
SeqLabC ProgStop EOL
END
closeToolSub {Added - JHE}
RETURN

endOp3:
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

Podobne podstrony:
Fanuc 16TC MS [DC] YSML816 17 1
Fanuc 5T MS [PM] L644 85 2
Fanuc 18T MS [ G54] L608 85
Fanuc 18T MS [ G54] L608 85
Fanuc 18T MS CL20 L535 85 2
Fanuc 6T MS [ PM] L251 85
Fanuc 18T MS [EI] L776 85
Fanuc 11M MS PM020 17 3
Fanuc 10T MS [2 G54] L066 82
Fanuc 11M MS [HM] M433 80
Fanuc 6T MS [SE] L683 85
Fanuc 10T MS [PT] L703 85 1
Fanuc 18M MS [CST] NCT81 16

więcej podobnych podstron