Meldas 500 Mit [SMP] PMX73 17 3


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

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

{5/24/96
Modified: Meldas 500M 0KK B970.12.2
Created: Meldas 500M 0KK B970.12.3
For: Armstrong Blum
Versions: ncCad 4.33.02/ncCAM 4.33.01/ncPost 4.33.09/Catalyst v3.04.05C/Compost 4.21.37/1.0a
Changes made per Jeff Myers of Gibbs & Associates.
Customer requested method of outputting true G10XYZ coordinate values.
Jeff instructed them to use machine coordinates in stock size dialogue and not use CS#1.
Added restriction of G10 Block for CS#1 at StartUpStuff sub.
Added CS#1 Warning at doOpComments.
DWB}

{5/30/96
Modified: Meldas 500M 0KK B970.12.3
Created: Meldas 500M 0KK B970.12.4
For: Armstrong Blum
Versions: ncCad 4.33.02/ncCAM 4.33.01/ncPost 4.33.09/Catalyst v3.04.05C/Compost 4.21.37/1.0a
Changes made per Lee Hensch of Armstrong Blum.
Customer reported that some Operations were not outputting a FeedRate.
This was caused by a Pocketing Operation with Rapid Entry whose FeedRate was identicle to
previous Operation.
Added FORMAT#9 at Prog Numeric Format Definitions.
Added RapidF# to FORMAT#9 at Prog Numeric Format Definitions.
Added RapidF# at start of OpGuts sub.
DWB}

{6/26/96
Updated: Meldas 500M 0KK B970.12.4
Modified: Meldas 500M 0KK B970.12.5
For: Armstrong Blum
Versions: ncCad 4.33.02/ncCAM 4.33.01/ncPost 4.33.09/Catalyst v3.05C/Compost 4.21.37/1.0a
Changes made per Lee Hensch of Armstrong Blum.
Customer reported problem of outputting true G10XYZ coordinate values, see 5/24/96.
Not sure, but I think it has to do with creating the CSOrigins in machine coordinates.
Distance from Machine Home to Center of Table Rotation is always the same.
Instructed user to us normal dimensions from center of table rotation.
Added SUB# to FORMAT#4 at Prog Numeric Format Definitions.
Subtracting 14.1732 from CSOffsetX# and 31.1023 from CSOffsetZ# at DoCSWFOComment and G10Block.
Deleted changes made on 5/24/96.
Deleted condition to output warning when CS#1 is current at doOpComments.
Deleted NotEqual CS#1 condition at StartUpStuff.
Customer reported bad CSOffsetB# values.
Changed CSOffsetB# from FORMAT#7 to FORMAT#8 at Prog Numeric Format Definitions.
Modified formulas at ModCSOffsetB.
Post was not calculating negative angles correctly.
Customer requested that Tapping Cycles output Speed and SpinOn at Cycle block, not StrtPos block.
Added GetSpeedOn sub to suppress from StrtPos block of Tapping Cycles.
GetSpeedOn sub is called from firstOp3, firstOp3a, newToolOp5, newToolOp5a and two places at
sameToolOp3
Added output of Speed SpinOn to Cycle block at OpGuts IF Drilling.
DWB}

{7/2/96
Modified: Meldas 500M 0KK B970.12.5
Created: Meldas 500M 0KK B970.12.6
For: Armstrong Blum
Versions: ncCad 4.33.02/ncCAM 4.33.01/ncPost 4.33.09/Catalyst v3.05C/Compost 4.21.37/1.0a
Changes made per Lee Hensch of Armstrong Blum.
Added call to getCoolOn for ChangeCS at sameToolOp3.
Indexing B-Axis causes CoolOff.
Calling sub allows to turn CoolOn back on.
DWB}

{8/8/97
Initial: Meldas 500M OKK [FR] CZ22.12
Created: Mitsubishi [SM]CXXX.12
For: Spacecraft Machine
Changed to standard Fanuc style sub calls,
Eliminated StartUpStuff calls,
Changed to standard Fanuc style WFOs,
Moved call to NotSameToolWFO into firstOp1,
Made output of Speed SpinOn in firstOp, NewTool, and SameTool conditional
upon Tap? being false, Speed SpinOn for tap is output on the block before the cycle call,
Added Rapid Plane DrillOff CRCOff block to FirstToolOp1,
Added IncValue to G30 blocks,
Moved G30 block in firstOp1 to before Tool call,
Added M11 (unclamp table) before all rotary table moves and M10 (clamp table) after,
MPK}

{8/20/97,
Initial: Meldas 500 Mit MH5A [SMP] CX73.12
Created: Meldas 500 Mit MH5A [SMP] CX73.12.1
Changed the A axis to output 'B' and B to output 'A',
MPK}

{1/15/99
Initial: Meldas 500 Mit [SMP] CX73.12.1
Created: Meldas 500 Mit [SMP] PMX73.17.3
Created simple positioning post per Fanuc 6M PM001.17.3,
MPK }

{Prog Numeric Format Definitions ****}

#1 = '#.00'
#2 = '#####.###;0.'
#3 = '*#####.###;0.'
#4 = '####.####;0.'
#5 = '#######0'
#6 = '####^##0'
#7 = '#'

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(TrackC#,3)
FORMAT(TrackCNO#,3)
FORMAT(MoveC#,3)
FORMAT(UnitAngle#,3)
FORMAT(FourthDegree#,4) { Web Drill ZRapidStart OptCyc1 FIFO }
FORMAT(Recall#,4)
FORMAT(ADD#,4)
FORMAT(SUB#,4)
FORMAT(CalcZSurf#,4) { Web Drill ZRapidEnd OptCyc1 FIFO }
FORMAT(DIV#,4)
FORMAT(TrackZNO#,4)
FORMAT(ToolDiameter#,4)
FORMAT(TrackXNO#,4)
FORMAT(TrackYNO#,4)
FORMAT(TrackZNO#,4)
FORMAT(TRUNC#,5)
FORMAT(Program#,5)
FORMAT(Program2#,5)
FORMAT(CallMasterNum#,5)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(NewWFO#,5)
FORMAT(Parts#,5)
FORMAT(Dwell#,6)
FORMAT(RapidF#,7)

{Added Subroutines ****}

report:
IF PalletIn?
'------------------------------------' EOL
'Num#(1) xEP = ' Recall# Num#('1') EOL
'Num#(2) yEP = ' Recall# Num#('2') EOL
'------------------------------------' EOL
END
RETURN

resetSP: {update to the correct StartPos}
IF Rotations? OR Repeats? OR AutoCycle?
IF AbsValue?
TrackXNO# SPX#
TrackYNO# SPY#
ELSE
SetAbs
TrackXNO# SPX#
TrackYNO# SPY#
SetInc
END
END
RETURN

saveEP: {save the correct EndPos}
IF PointFeat?
IF AutoCycle?
SetACSPCompF
Save# Num#('1') ADD# Recall# Num#('1') SPX# { xOpEP }
Save# Num#('2') ADD# Recall# Num#('2') SPY# { yOpEP }
SetACSPComp
ELSE
Save# Num#('1') SPX# { xOpEP }
Save# Num#('2') SPY# { yOpEP }
END
ELSE
Save# Num#('1') EPX# { xOpEP }
Save# Num#('2') EPY# { yOpEP }
END
RETURN

getEP: {save the correct EndPos}
IF Rotations? OR Repeats? OR AutoCycle?
IF AbsValue?
saveEP
ELSE
SetAbs
saveEP
SetInc
END
report
END
RETURN

setSRXYtoACEP:
TrackXNO# Recall# Num#('1') { xOpEP }
TrackYNO# Recall# Num#('2') { yOpEP }
RETURN

{Prog Subroutines ****}

restoreScale:
IF Metric? {CAM file is in Metric, tools and tool path}
SetScale('.03937007874') { change to English, this is an English post}
END
RETURN

wfo:
'G' NewWFO#
RETURN

wfoStuff:
IF NewWFO?
IF MultipleParts? AND WorkFixtureOffsets?
EOL
'*** WARNING *** DO NOT USE NEWWFO() WITH MULTIPLE PARTS AND WORK FIXTURE OFFSETS' EOL
ELSE
wfo
END
ELSE
IF Flag?('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF NOT SameTool?
IF MultipleParts?
IF WorkFixtureOffsets?
WFO1
ELSE
wfo
END
ELSE
wfo
END
END
END
END
SetFlagF('2') { Do not output WFO second time wfoStuff is called for MP-WFO-OTAP-ECP }
RETURN

doSubComment:
IF UseComments? AND SubComment?
'( SUB NUMBER: ' Program# ' )' EOL
IF MultipleParts? AND OneToolAllParts? NOT SameTool?
'( TOOL ' Tool# ': ' ToolDiameter# ' ' ToolType$ ' )' EOL
END
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# ': ' ToolDiameter# ' ' ToolType$ ' )' EOL
END
IF ToolComment?
'( ' ToolComment$ ' )' EOL
END
restoreScale
END
RETURN

psInit:
NewWFOF
FourthCWF
FourthCCWF
FifthCWF
FifthCCWF
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
ResetCool
RETURN

psStuff:
IF FifthCW?
FORMAT(FifthDegree#,2)
SeqC 'B' FifthDegree# EOL
FifthCWF
END
IF FifthCCW?
FORMAT(FifthDegree#,3)
SeqC 'B' FifthDegree# EOL
FifthCCWF
END
RETURN

doPostScript:
psInit
EachPS
SeqC PostScript EOL
psStuff
NextPS
RETURN

doEndOpPS:
psInit
EachEOPS
SeqC EndOpPS EOL
psStuff
NextPS
RETURN

absValueC:
IF NOT AbsValue?
AbsValue
END
RETURN

incValueC:
IF AbsValue?
IncValue
END
RETURN

absOrIncC:
IF AbsoluteMoves?
absValueC
ELSE
incValueC
END
RETURN

setAngleUnder360: {sets status register and machine to current rotary position between -360 and 360 deg}
IF AAxisAvail?
SetAbs
IF GTEqual? MoveC# Num#('360') {reset the A-axis to be between 0 and 359.999}
ResetAngle
SeqC Preset 'A' TrackC# UnitAngle# EOL
ELSE
IF LTEqual? MoveC# Num#('-360')
IF Equal? UnitAngle# Num#('0') {reset the A-axis to be 0}
ResetAngle
SeqC Preset 'A' TrackC# UnitAngle# EOL
ELSE {reset the A-axis to be between -0.001 and -359.999}
ResetAngle
SeqC Preset 'A' TrackC# SUB# UnitAngle# Num#('360') EOL
END
END
END
SetInc { Because we call setAngleUnder360 right after incValueC OfstOff }
END
RETURN

doStartPos:
StrtPos
IF AAxisAvail?
CalcSCAng MoveC
ELSE
TrackCNO# Num#('0')
END
RETURN

entryMove:
IF FirstOperation? OR NewTool?
RapidF# { Forces FeedEnt/FeedRate }
ELSE
IF LAST Rotations? OR LAST Repeats?
RapidF# { Forces FeedEnt/FeedRate }
END
END
IF FeedEntry?
SeqC Feed ZIn FeedEntC EOL
ELSE
SeqC RapidC ZIn 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:
SeqC SubCall CallLab RepLab RepCycs EOL
startSub
RETURN

finishSub1: {part 1}
SeqC CRCOffC
IF NOT FeedConnect?
RapidC ZCP3C
END
EOL
RETURN

finishSubG92: {part 2}
SeqC Preset ShiftRC EOL
SeqC EndSub EOL
CloseSub
SeqC Preset UnshftRC EOL
RETURN

doWFOOps:
IF Flag?('5')
SetFlagF('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
ELSE
SeqC SetWFO EOL
END
SeqC SubCall CallLab RepLab OnePart EOL
RETURN

openMP:
NewProg
IF WorkFixtureOffsets?
IF OneToolAllParts? AND ExitClearancePlane?
SetFlag('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
END
NewWFO
EachWFO {simple eachPart}
doWFOOps
IncWFO
NextWFO {simple NextPart}
startSub
ELSE
SeqC SubCall CallLab RepLab Parts EOL
IF OneToolAllParts? AND ExitClearancePlane?
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
startSub
END
RETURN

closeMP:
IF WorkFixtureOffsets?
SeqC EndSub EOL
CloseSub
SeqC WFO1 EOL
ELSE
SeqC absOrIncC EOL
SeqC Preset ShiftPC EOL
SeqC EndSub EOL
CloseSub
SeqC Preset UnshftPC EOL
END
RETURN

doAbsOrInc:
IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated }
IF ZMove?
incValueC
ELSE
absOrIncC
END
END
RETURN

doDrillAbsOrInc:
IF Flag?('1') { DrillSubs activated }
IF SPZMove?
incValueC
ELSE
absOrIncC
END
END
RETURN

restoreAbsOrInc:
IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated }
SeqC absOrIncC EOL
END
RETURN

ckCRC:
IF LastFeat?
CRCOffC
ELSE
IF NOT ZMove?
CRCOnC
END
END
RETURN

ckCRCNum:
IF NOT LastFeat? AND Equal? SPZ# EPZ#
CRCOffsetC
END
RETURN

tpPointFeat:
IF AutoCycle?
SeqC MoveSXYC EOL
IF Repeats? AND ZshiftOnly?
SeqC SubCall CallLabB TRUNC# SUB# Program# Num#('1') EOL
ELSE
SeqC SubCall CallLab EOL
END
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
ELSE
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
SeqC doDrillAbsOrInc MoveSXYZC EOL
END
IF LastFeat?
IF Flag?('9') { valid Drill Rotation Sub }
restoreAbsOrInc
IF NOT MasterOp?
SeqC EndSub EOL
CloseSub
END
END
END
END
RETURN

tpRapidFeat:
IF XMove? OR YMove? OR ZMove?
SeqC doAbsOrInc ckCRC RapidC MoveXYZC ckCRCNum EOL
END
RETURN

tpLineFeat:
IF XMove? OR YMove? OR ZMove?
SeqC doAbsOrInc ckCRC FeedC MoveXYZC FeedRateC ckCRCNum EOL
END
RETURN

tpArcFeat:
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
SeqC doAbsOrInc
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
MoveXYZC
IF ArcIJFormat?
ArcIJC
ELSE
ArcRC
END
ArcFeedC EOL
NEXTQuadrant
RETURN

toolPath:
ResetCRCNum
EACHFeat
IF FirstFeat?
resetSP
END
IF PointFeat?
tpPointFeat
ELSE
IF RapidFeat?
tpRapidFeat
ELSE
IF LineFeat?
tpLineFeat
ELSE
IF ArcFeat?
tpArcFeat
END
END
END
END
IF LastFeat?
getEP
END
NEXTFeat
restoreAbsOrInc
RETURN

autoCycCutSub1: {part 1}
SaveSubStatus {save tool position}
SetPass1 {element cut moves}
startSub
SetSRXYtoSP
SeqC incValueC EOL
RETURN

autoCycCutSub2: {part 2}
toolPath
SeqC absOrIncC CRCOffC
IF Repeats? AND FeedConnect? AND ZshiftOnly?
ELSE
RapidC ZCP2
END
EOL
SeqC 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

milling:
IF AutoCycle?
NewProg
autoCycCutSub1
entryMove
autoCycCutSub2
autoCycPat
ELSE
entryMove
toolPath
END
RETURN

g92Sub:
subWarning
stdSub
SeqC AbsOrInc Connect StrtPos EOL
milling
finishSub1
finishSubG92
RETURN

doSepSubContour:
SetPass1
TrackZNO# SPZ#
startSub
RapidF#
IF AutoCycle?
NewProg
autoCycCutSub1 {build element sub}
TrackZNO# SPZ#
autoCycCutSub2
ELSE
toolPath
finishSub1
SeqC EndSub EOL
CloseSub
END
SetPass1
SetStatusRapid
RapidF#
SetSRXYtoEP
TrackZNO# ClearancePlane2#
RETURN

doSepSubFeedConnect:
IF FeedConnect?
FeedEntC
END
RETURN

doSepSubSPMove:
SetStatusOff
IF SPXMove? OR SPYMove?
IF AutoCycle?
incValueC
END
SeqC Connect StrtPosC doSepSubFeedConnect EOL
absOrIncC
ELSE
Connect
END
SetStatusOn
RETURN

doSepSubZMoves:
IF FeedConnect?
SeqC FeedC ZInPlusInc FeedEnt EOL
ELSE
IF FeedEntry?
IF NOT FirstCycle?
SeqC RapidC ZCP2PlusInc EOL
END
SeqC Feed ZInPlusInc FeedEnt EOL
ELSE
IF FirstCycle? AND AutoCycle?
Rapid
END
SeqC RapidC ZInPlusInc EOL
END
END
SeqC SubCall CallLab EOL
IF NOT FeedConnect? AND NOT AbsValue?
TrackZNO# ZCP2PlusInc#
SeqC ZCP2C EOL
IF NOT AutoCycle?
TrackZNO# ClearancePlane3#
END
END
RETURN

setSepSubZ:
SetAbs
TrackZNO# ADD# SPZ# MUL# RepsLess1# RepeatZ#
SetInc
RETURN

doSepSubExit:
IF NOT AbsValue?
setSepSubZ
END
IF AutoCycle?
SeqC Rapid ZCP2 EOL
ELSE
Rapid { Will be output at millingOp ZCP3 }
END
RETURN

resetSepSubSR:
SetPass1
SetStatusRapid
RapidF#
TrackXNO# Recall# Num#('1') { xOpEP }
TrackYNO# Recall# Num#('2') { yOpEP }
RETURN

zonlyRepAutoCycle:
doSepSubContour
EachCycle
IF NOT FirstCycle?
doSepSubSPMove
END
doSepSubZMoves
NextCycle
IF FeedConnect?
doSepSubExit
END
SeqC EndSub EOL
CloseSub
{Element shift, not pattern}
autoCycPat {write pattern moves and main calls}
resetSepSubSR
TrackZNO# ClearancePlane2#
RETURN

zonlyRep:
doSepSubContour
EachCycle
IF NOT FirstCycle?
doSepSubSPMove
END
doSepSubZMoves
NextCycle
resetSepSubSR
IF FeedConnect?
doSepSubExit
ELSE
TrackZNO# ClearancePlane3#
END
RETURN

millingOp:
SeqC ZCP2C EOL
IF Repeats?
NewProg
IF ZshiftOnly?
IF AutoCycle? {incremental Autocycle sub can have Z moves}
zonlyRepAutoCycle
ELSE {Z shift only, NOT Auto Cycle}
SetFlag('1') { Milling ZShiftOnly SepSubs activated }
zonlyRep
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?
SeqC CRCOffC ZCP3C EOL
setSRXYtoACEP
ELSE
SeqC CRCOffC RapidC ZCP3C EOL
END
RETURN

skipToLastFeat:
EachFeat
IF LastFeat?
TrackXNO# SPX#
TrackYNO# SPY#
END
NextFeat
RETURN

SetDrillEndOpZ:
IF RetractToCP1?
TrackZNO# ClearancePlane1#
ELSE
TrackZNO# ClearancePlane2#
END
RETURN

drillingOp:
SeqC DrillCP EOL
GetCycle
IF FIFO? AND OptCyc1? AND FourthCW? { Web Drill Cycle }
EachFeat
IF NOT FirstFeat?
SeqC RapidC MoveSXYC EOL
SeqC RapidC ZCP2C EOL
END
SeqC FeedC 'Z' FourthDegree# FeedEnt EOL
SeqC RapidC 'Z' CalcZSurf# EOL
SeqC FeedC ZDepth FeedEnt EOL
SeqC SpinOff EOL
SeqC 'M19' EOL
SeqC IncValue Feed 'Y-.005' EOL
SeqC AbsOrInc EOL
IF RetractToCP1?
SeqC RapidC ZCP1 EOL
ELSE
SeqC RapidC ZCP2 EOL
END
SeqC SpinOn EOL
NextFeat
ELSE
IF Tap?
SeqC Speed SpinOn EOL
END
IF Tap? AND NOT CWSpindle?
'G74'
ELSE
IF FIFO? AND NOT Dwell?
'G76'
ELSE
Cycle
END
END
SeqC FromCP StrtPos ZDepth RLevel Dwell Peck Retract
IF FIFO? AND NOT Dwell?
'J-.005' { Shift away from wall }
END
IF Tap?
'E' DIV# Num#('1') FeedTapIPR#('1') { # of Threads per Inch }
ELSE
FeedEnt
END
EOL
IF CallMasterOp?
SeqC SubCall 'P' CallMasterNum# EOL
skipToLastFeat
ELSE
TrackZNO# FIRST SPZ#
IF MasterOp?
SetFlag('1') {std sep sub Zreps in effect}
NewMasterProg
SeqC SubCall CallLab EOL
startSub
toolPath
SeqC EndSub EOL
CloseSub
SetFlagF('1') {not std sep sub Zreps in effect}
ELSE
toolPath
END
END
SetDrillEndOpZ
END
IF NOT Rotations?
SeqC DrillOff Rapid ZCP3 EOL
END
RETURN

checkPass:
IF AutoCycle? {use the correct StrtPos}
SetPass2
ELSE
SetPass1
END
RETURN

rotateStartPosC:
TrackXNO# Recall# Num#('1') { xOpEP }
MoveSXC
TrackYNO# Recall# Num#('2') { yOpEP }
MoveSYC
CalcSCAng MoveC
RETURN

rotaryReps: {use the correct EndPos}
EachRotation
IF Milling?
IF FirstRotation?
NewProg
SaveProgNum2
StartSub
millingOp
SeqC EndSub EOL
CloseSub
checkPass
ELSE
SeqC 'M11' EOL {unclamp table}
SeqC rotateStartPosC EOL
SeqC 'M10' EOL {clamp table}
END
SeqC SubCall CallLabB Program2# EOL
ELSE
IF Drilling?
IF FirstRotation?
drillingOp
checkPass
ELSE
IF RetractToCP1? AND Equal? ClearancePlane1# ClearancePlane3#
SeqC 'M11' EOL {unclamp table}
SeqC rotateStartPosC EOL
SeqC 'M10' EOL {clamp table}
ELSE
IF NOT RetractToCP1? AND Equal? ClearancePlane2# ClearancePlane3#
SeqC 'M11' EOL {unclamp table}
SeqC rotateStartPosC EOL
SeqC 'M10' EOL {clamp table}
ELSE { Need to cancel Drill Cycle between Rotations }
SeqC DrillOff Rapid ZCP3 EOL
SeqC 'M11' EOL {unclamp table}
SeqC rotateStartPosC EOL
SeqC 'M10' EOL {clamp table}
SeqC DrillCP EOL
SeqC Cycle FromCP rotateStartPosC ZDepth RLevel Dwell Peck Retract FeedEnt EOL
END
END
END
IF CallMasterOp?
IF NOT FirstRotation?
SeqC SubCall CallLabB CallMasterNum# EOL
END
ELSE
IF MasterOp?
IF NOT FirstRotation?
SeqC SubCall CallLab EOL
END
ELSE
IF Flag?('9') { valid Drill Rotation Sub }
SeqC SubCall CallLab EOL
END
END
END
IF LastRotation?
SeqC DrillOff Rapid ZCP3 EOL
END
END
END
NextRotation
TrackXNO# Recall# Num#('1') { xOpEP }
TrackYNO# Recall# Num#('2') { yOpEP }
TrackZNO# ClearancePlane3#
RETURN

opGuts:
IF Rotations?
rotaryReps
ELSE
IF Milling?
millingOp
ELSE
IF Drilling?
drillingOp
END
END
END
RETURN

getCoolOn:
IF NOT CoolOff?
IF ThruSpin?
'M58'
SetFlag('21') { For SameTool }
ELSE
CoolOn
SetFlagF('21') { For SameTool }
END
END
RETURN

progStart:
InitProg
ReverseXZArcs
InitWFONum
SetFlood
SetMaxRPM('10000')
IF Metric?
SetMaxFeed('12700')
ELSE
SetMaxFeed('500')
END
Save# Num#('1') Num#('0') { Status Register Variable for X Axis }
Save# Num#('2') Num#('0') { Status Register Variable for Y Axis }
Save# Num#('21') Num#('0') { Starting A axis Value }
SetFlagF('1') { Milling ZShiftOnly SepSubs/DrillSubs deactivated }
SetFlagF('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
SetFlagF('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
SetFlagF('9') { For valid Drill Rotation Sub }
SetFlagF('21') { SameTool getCoolOn }
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
' SetFlood, SF' EOL
' This is a modal command affecting all operations.' EOL
' Outputs flood coolant, M8, for all following operations.' EOL
' This is the default setting.' EOL
' FloodCoolant, FCool' EOL
' This is a non-modal command affecting the current operation only.' EOL
' Outputs flood coolant, M8, for the current operation.' EOL
' SetThruSpindle, STS' EOL
' This is a modal command affecting all operations.' EOL
' Outputs thru-the-spindle coolant, M58, for all following operations.' EOL
' ThruSpindleCoolant, TSCool' EOL
' This is a non-modal command affecting the current operation only.' EOL
' Outputs thru-the-spindle coolant, M58, for the current operation.' EOL
' OptionalCycle1, OptCyc1' EOL
' This command, combined with now-obsolete 4thAxisCW(n) command will cause Post' EOL
' to output a non-Canned LongHand Web Drilling Cycle.' EOL
' NewWFO(56), NWFO(56) -' EOL
' The Work Fixture Offset # you specify will be used for all following operations.' EOL
' Do not use with the ncPost multiple part option.' EOL
' 4thAxisCW(-1.25), 4ACW(-1.25) -' EOL
' This command, combined with OptionalCycle1 command will cause the Post Processor to' EOL
' output a non-Canned LongHand Web Drilling Cycle. Argument should contain ZRapidStart' EOL
' value. For this example, ZRapidStart value is equal to Z-1.25. In addition to this,' EOL
' Post Processor uses the the ZSurface Edit Field for ZRapidEnd position.' EOL
END
RETURN

initOp:
EOR EOL
ProgID1 EOL
IF UseComments? AND ProgramNameComment?
'( PROGRAM: ' 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 ' MoveType$ ' INCHES )' EOL
END
IF PartsComment?
'( PARTS PROGRAMMED: ' Parts# ' )' EOL
END
IF StartToolComment?
'( FIRST TOOL NOT IN SPINDLE )' EOL
END
END
OpenSub
restoreScale
RETURN

firstOp1:
IF ToolChangeAtHome?
SetHome
END
SeqC Rapid Plane DrillOff CRCOff EOL
SeqC 'G30' IncValue 'X0.Y0.Z0.' EOL
SeqC wfoStuff EOL
SeqC OpToolID EOL
CalcSCAng
IF NOT Equal? Recall# Num#('21') MoveC#
SeqC 'M11' EOL
SeqC Rapid AbsOrInc MoveC EOL
SeqC 'M10' EOL
Save# Num#('21') MoveC#
END
SeqC ToolChng EOL
SeqC ProgStop EOL
doOpComments
doPostScript
RETURN

firstOp2:
checkPass
SeqC Rapid AbsOrInc StrtPos
IF NOT Tap?
Speed SpinOn
END
EOL
RETURN

firstOp3:
SeqC OfstOn PreTool getCoolOn EOL
RETURN

newToolOp1:
SeqC CoolOff EOL
setAngleUnder360
RETURN

newToolOp2:
doEndOpPS
SeqC 'G30' IncValue 'X0.Y0.Z0.' SpinOff EOL
CalcSCAng
IF NOT Equal? Recall# Num#('21') MoveC#
SeqC 'M11' EOL
SeqC Rapid AbsOrInc MoveC EOL
SeqC 'M10' EOL
Save# Num#('21') MoveC#
END
SeqC ToolChng EOL
IF LAST ProgStop?
SeqC 'M0' EOL
ELSE
SeqC ProgStop EOL
END
RETURN

newToolOp3: {Start new Operation}
Seq ' ' EOL
SeqC PlaneC EOL
doOpComments
doPostScript
RETURN

newToolOp4:
SeqC wfoStuff EOL
checkPass
SeqC Rapid AbsOrInc StrtPos
IF NOT Tap?
Speed SpinOn
END
EOL
RETURN

newToolOp5:
SeqC OfstOn PreTool getCoolOn EOL
RETURN

sameToolOp1:
doEndOpPS
CalcSCAng
IF LAST ProgStop?
SeqC CoolOff EOL
SeqC 'G30' IncValue 'X0.Y0.Z0.' SpinOff EOL
IF NOT Equal? Recall# Num#('21') MoveC#
SeqC 'M11' EOL
SeqC Rapid AbsOrInc MoveC EOL
SeqC 'M10' EOL
Save# Num#('21') MoveC#
END
SeqC 'M0' EOL
ELSE
IF NewToolOffset? OR ChangeCS?
SeqC CoolOff EOL
SeqC SpinOff EOL
SeqC 'G30' IncValue 'X0.Y0.Z0.' SpinOff EOL
IF NOT Equal? Recall# Num#('21') MoveC#
SeqC 'M11' EOL
SeqC Rapid AbsOrInc MoveC EOL
SeqC 'M10' EOL
Save# Num#('21') MoveC#
END
ELSE
IF NOT Equal? Recall# Num#('21') MoveC#
SeqC 'M11' EOL
SeqC Rapid AbsOrInc MoveC EOL
SeqC 'M10' EOL
Save# Num#('21') MoveC#
END
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
END
END
setAngleUnder360
RETURN

sameToolOp2: {Start new Operation}
doOpComments
doPostScript
checkPass
RETURN

sameToolOp3: {Start new Operation}
SeqC wfoStuff EOL
IF LAST ProgStop?
SeqC PlaneC AbsOrInc Rapid StrtPos
IF NOT Tap?
Speed SpinOn
END
getCoolOn EOL
SeqC OfstOn EOL
ELSE
SeqC PlaneC AbsOrInc Rapid StrtPos
IF ChangeCS?
Speed SpinOn getCoolOn
ELSE
IF Drilling?
GetCycle
IF NOT Tap?
SpeedC
END
END
IF NOT CoolOff? AND LAST CoolOff?
getCoolOn
ELSE
IF ThruSpin? AND NOT Flag?('21')
getCoolOn
ELSE
IF NOT ThruSpin? AND Flag?('21')
getCoolOn
END
END
END
END
EOL
IF NewToolOffset?
SeqC OfstOn EOL
END
END
RETURN

end1:
SeqC CoolOff EOL
SeqC 'G30X0.Y0.Z0.' SpinOff EOL
setAngleUnder360
IF NotEqual? UnitAngle# Num#('0')
SeqC absOrIncC RapidC 'A' TrackC# Num#('0') EOL
END
RETURN

end2:
doEndOpPS
IF AAxisAvail?
SeqC 'M11' EOL
SeqC 'G28A0' EOL
SeqC 'M10' EOL {Clamp Table}
END
SeqC 'M60' EOL { Change Pallets }
IF ProgStop?
SeqC 'M0' EOL
END
RETURN

end3:
SeqC EOP EOL
CloseSub
Post2 {organize Subs into one program}
EOR EOL
Close
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

mpAllTools1P: {Multiple Parts, All Tools 1 Part}
EachOp {Start of post processing}
IF EquallySpacedOffsets?
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
IF FirstOperation?
openMP
firstOp1
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
newToolOp2 {to tool change, CS problem}
newToolOp3
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
end1
end2
closeMP
end3
RETURN

mp1ToollAllPfu: {Multiple Parts, 1 Tool all Parts, full up}
EachOp {Start of post processing}
IF EquallySpacedOffsets?
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
IF FirstOperation?
firstOp1
openMP
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
closeMP
newToolOp2 {to tool change, CS problem}
newToolOp3
openMP
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
end1
closeMP
end2
end3
RETURN

mp1ToollAllPXcp: {Multiple Parts, 1 Tool all Parts, exit Clearance plane}
EachOp {Start of post processing}
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF FirstOperation?
firstOp1
firstOp2
firstOp3
openMP
firstOp2 {need StrtPos in Sub}
ELSE
IF NewTool?
closeMP
newToolOp1
newToolOp2 {to tool change, CS problem}
newToolOp3
newToolOp4
newToolOp5
openMP
newToolOp4 {need StrtPos in Sub}
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
closeMP
end1
end2
end3
RETURN

noMPs: {no multiple parts}
EachOp {Start of post processing}
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF FirstOperation?
firstOp1
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
newToolOp2
newToolOp3
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
end1
end2
end3
RETURN

{Start of executable Prog, Top Level ****}

progStart {setup and initializations}
initOp

IF MultipleParts?
IF AllToolsOnePart?
mpAllTools1P
ELSE {implied OneToolAllParts?}
IF FullUp?
mp1ToollAllPfu
ELSE {implied ExitClearancePlane?}
mp1ToollAllPXcp
END
END
ELSE
noMPs
END


Wyszukiwarka