K & T 800 Gmn [PP] NCT83 16


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

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

{3/30/89
Copied & modified: K & T Type C M127.58
For: Angelus Can
Machine: Kearney & Trecker 800
Control: Gemini D17
JR}

{5/17/89, added PostScript comments, deleted RunTime comments, JR}
{11/28/89, Updated: K & T 800 Gem D17 M186.57 to .61 format, JR}
{5/24/90, Updated: K & T 800 Gem D17 M186.61 to .72.1 format, JR}
{7/24/90, Replaced all occurances of SetSRXYZero with SetSRXYtoSP, DWB}
{3/2/92, Updated: K & T 800 Gem D17 M186.73 to .81 format, DWB}

{9/12/92
Modified: K & T 800 Gem D17 M186.81
For: Micron Machine
Updated to Version 4.1 per LongHand [AbsOrInc] M001.81.
This supports both Absolute and Incremental output.
This supports MultipleParts.
Using Var(1), Var(2) and Var(3) for logical control of Operations.
Changed ArcIJC to ArcIJ at formatArc.
DWB}

{2/17/93
Modified: K & T 800 Gem D17 M186.81.1
For: Micron Machine
Changes made per conversations with Jeff Baney and Donna Conley at Micron Machine.
Changed MoveXYZC to MoveXY MoveZC at formatArc.
Added ArcSegmentation for Helical Arcs at toolPath.
This is a temporary fix because QuadStops do not output ZMove correctly.
Added SetArcSegmentAccuracy('.001') at setup and initializations.
Added logic for handling Drilling Cycles AND RetractToCP1 at toolPath and IF Drilling.
Cancels Cycle followed by ZCP1 followed by re-definition of Cycle.
DWB}

{6/5/95
Updated & Modified: K & T 800 Gem D17 M186.81.2
For: Micron Machine
Versions: ncCad 4.33.01/ncCAM 4.33.01/ncPost 4.33.05/Catalyst v2.14.40/Compost 4.21.28
Changes made per fax from Mark Conley at Micron Machine
Customer requested update to current level of CutterRadiusCompensation.
Deleted LastFeatExtend at end of toolPath.
Added CRCOffC per version 4.2.
Added ckCRC sub.
Added logic to output CRCOnC in OneFeat, Non-ZMove toolPath.
Added logic to suppress output of CRCOnC on ZMove Feature.
CutterRadiusCompensation ExitLength will output G40 on LastFeat AND LineFeat at stdLine sub.
Added support of CRC during multiple pocket dog-bone operation.
Added condition to output CRCOnC for XMove OR YMove only at ckCRC sub.
Outputs G41/G42 on First LineFeat after Z Plunge.
Modified condition to output CRCOffC for LastFeat AND AutoCycle at toolPath RapidFeat.
Assures that G40 is not output prior to LastFeat.
Added CRCOffC to ZMoveOnly Feature at toolPath RapidFeat.
Outputs G40 at all Z Retract blocks.
Updated to Version 4.2 per LongHand M001.81.3h Format.
Changed logic of mpLoop sub to handle IF NewTool? and LastOp? situations.
Commented out doEndOpPS at mpLoop for OneToolAllParts, it does not work correctly.
Added Move to ZInC for Non-AutoCycle FeedConnect Repeats with ZMoves at exitMove sub.
Moved doCycleComment call to before StrtPos move in related subs.
Added badMPWFOReport sub.
Reports when MultipleParts AND WorkFixtureOffsets = TRUE AND EquallySpacedOffset values exist.
Added FORMAT #8, 'ą#bbbb.bbbb#', for PartShiftX#, PartShiftY# and PartShiftZ# commands.
Moved SeqC and EOL outside of IF ELSE condition at exitMove sub.
Moved SeqC AbsOrInc and EOL outside of IF ELSE condition at autoCycCutSub2 sub.
Deleted ReSetPass2 at end of zonlyRepAutoCycle sub.
Already executed at end of call to autoCycCutSub2 sub.
Changed First occurance of GetConnect to RapidC at zonlyRepAutoCycle sub.
FeedConnect only applies to Each Repeat, not Each Feature.
Deleted GetConnect sub, modified xyzRep, xyzRepAutoCycle and zonlyRepAutoCycle subs.
Deleted GetConnectFeed sub, modified xyzRep, xyzRepAutoCycle and zonlyRepAutoCycle subs.
Deleted PreTool at masterSub FirstOperation and NewTool.
Added OpToolID at masterSub NewTool.
Changed Segmented Helical Arcs with single block containing ArcZRads# rise per radian command.
DWB}

{2/9/96, Updated .81 number to .84, no changes necessary, MPK}

{3/22/96, Tested ZOnlyRepAutCycle, Incremented number to .87, MPK}

{12/02/97,
Initial: K & T 800 Gem D17 MW57.87
Created: K & T 800 Gem D17 MW57.87.1
For: Boeing Aerospace
Changed all literal 'Z31.5M25' to 'Z21.5M25'.
CDH}

{01/20/99,
Initial: K & T 800 Gem D17 MW57.87.1
Created: K & T 800 Gem [PP] NCxxx.16
For: Pioneer Precision

Changes to Form:
1. Origins & Movement - Added First and Last Work fixture offsets.

Changes to Prog:
1. Changed post to handle Adv Mill C-style output.
2. Modified post to output Work Fixture Offsets.
MPK}

{Prog Numeric Format Definitions *******************************************}

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(CSOffsetA#,3)
FORMAT(CSOffsetB#,3)
FORMAT(ArcZRads#,4)
FORMAT(ToolDiameter#,4)
FORMAT(CSOffsetX#,4)
FORMAT(CSOffsetY#,4)
FORMAT(CSOffsetZ#,4)
FORMAT(TrackXNO#,4)
FORMAT(TrackYNO#,4)
FORMAT(TrackZNO#,4)
FORMAT(TrackZ#,4)
FORMAT(Dwell#,4)
FORMAT(Recall#,5)
FORMAT(ADD#,5)
FORMAT(CS#,5)
FORMAT(Tag#,5)
FORMAT(Program#,5)
FORMAT(PartNum#,5)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(NewWFO#,5)
FORMAT(Parts#,5)
FORMAT(RapidF#,5)

{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

cSPartNum#:
ADD# CS# MUL# NumOfCS# SUB# PartNum# Num#('1')
RETURN

cSWFO:
'H' cSPartNum#
RETURN

wFO:
'H' PartNum#
RETURN

wFOStuff:
IF Flag?('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF NOT SameTool?
IF WFOCS?
cSWFO
ELSE
IF MultipleParts? AND WorkFixtureOffsets?
wFO
ELSE
WFO1
END
END
ELSE
IF WFOCS?
IF ChangeCS?
cSWFO
END
END
END
END
SetFlagF('2') { Do not output WFO second time wFOStuff is called for MP-WFO-OTAP-ECP }
RETURN

cSG52:
SeqC 'G52X' CSOffsetX# 'Y' CSOffsetY# 'Z' CSOffsetZ# EOL
RETURN

g52Stuff:
IF NOT Flag?('7') AND NOT WFOCS?
IF FirstOperation? OR NewTool? OR ChangeCS?
IF MultipleParts?
IF WorkFixtureOffsets?
cSG52
END
ELSE
cSG52
END
END
END
RETURN

doCSComment:
'(MSG, CS#' CS# ' - ' CSComment$ ' )' EOL
RETURN

doCSWFOComment:
IF FirstOperation? OR NewTool? OR ChangeCS?
'(MSG, ' cSWFO ' = X' CSOffsetX# ' Y' CSOffsetY# ' Z' CSOffsetZ#
IF Flag?('6') { TRUE = B-Style Output, FALSE = C-Style Output }
IF AAxisAvail?
' A' CSOffsetA#
END
IF BAxisAvail?
' B' CSOffsetB#
END
END
' )' EOL
IF NOT Flag?('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
SetFlag('2') { Need to output wFOStuff }
END
END
RETURN

cSComments:
IF GreaterThan? NumOfCS# Num#('1')
doCSComment
IF WFOCS?
doCSWFOComment
END
END
RETURN

doPartCycleComment:
IF MultipleParts? AND UseComments? AND SubComment?
'(MSG, PART NO. ' PartNum# ' )' EOL
END
RETURN

doCycleComment:
IF UseComments? AND SubComment?
'(MSG, CYCLE START )' EOL
END
RETURN

doOpComments:
IF UseComments?
SetScale('1')
IF OperationIDComment?
'(MSG, OPERATION ' Operation# ': ' OperationType$ ' )' EOL
END
IF OperationComment?
'(MSG, ' OperationComment$ ' )' EOL
END
IF WorkGroupComment?
'(MSG, ' WorkGroupComment$ ' )' EOL
END
IF ToolTypeComment?
'(MSG, TOOL ' Tool# ': ' ToolDiameter# ' ' ToolType$ ' )' EOL
END
IF ToolComment?
'(MSG, ' ToolComment$ ' )' EOL
END
restoreScale
cSComments
END
RETURN

cSAngleA:
IF AAxisAvail?
IF Flag?('6') AND WFOCS? { TRUE = B-Style Output, FALSE = C-Style Output }
'A0.'
ELSE
'A' CSOffsetA#
END
END
RETURN

cSAngleAC:
IF AChange?
cSAngleA
END
RETURN

cSAngleB:
IF BAxisAvail?
IF Flag?('6') AND WFOCS? { TRUE = B-Style Output, FALSE = C-Style Output }
'B0.'
ELSE
'B' CSOffsetB#
END
END
RETURN

cSAngleBC:
IF BChange?
cSAngleB
END
RETURN

psInit: {reset flags}
NewWFOF
FourthCWF
FourthCCWF
FifthCWF
FifthCCWF
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
RETURN

psStuff: {revised.72}
RETURN

doPostScript:
psInit
EachPS
SeqC PostScript EOL
psStuff
NextPS
RETURN

doEndOpPS:
psInit
EachEOPS
SeqC EndOpPS EOL
psStuff
NextPS
RETURN

loadPRIMEZCP2:
IF NOT Flag?('7')
LoadFeat Num#('0') Num#('0') PRIME ClearancePlane2#
ELSE
LoadFeat Num#('0') Num#('0') ADD# CSOffsetZ# PRIME ClearancePlane2#
END
RETURN

pRIMEZCP2:
IF NOT Flag?('7')
PRIME ZCP2
ELSE
'Z' TrackZ# ADD# CSOffsetZ# PRIME ClearancePlane2#
END
RETURN

loadPRIMEZCP3:
IF NOT Flag?('7')
LoadFeat Num#('0') Num#('0') PRIME ClearancePlane3#
ELSE
LoadFeat Num#('0') Num#('0') ADD# CSOffsetZ# PRIME ClearancePlane3#
END
RETURN

pRIMEZCP3:
IF NOT Flag?('7')
PRIME ZCP3
ELSE
'Z' TrackZ# ADD# CSOffsetZ# PRIME ClearancePlane3#
END
RETURN

connectC:
IF FeedConnect?
FeedC
ELSE
RapidC
END
RETURN

absValueC:
IF NOT AbsValue?
AbsValue
END
RETURN

incValueC:
IF AbsValue?
IncValue
END
RETURN

absOrIncC:
IF AbsoluteMoves?
absValueC
ELSE
incValueC
END
RETURN

entryMove:
IF Repeats? AND ZShiftOnly? AND FeedConnect?
SeqC FeedC ZInC
IF NOT EmptyLine?
FeedEntC
END
EOL
ELSE
IF FeedEntry?
SeqC FeedC ZInC
IF NOT EmptyLine?
FeedEntC
END
EOL
ELSE
SeqC RapidC ZInC RapidFC EOL
END
END
RETURN

autoCycExitMove:
SeqC absOrIncC CRCOffC
IF FIFO?
FeedC pRIMEZCP2 FeedEntC
ELSE
RapidC pRIMEZCP2 RapidFC
END
EOL
RETURN

exitMove:
IF AutoCycle?
SeqC CRCOffC ZCP3C EOL
ELSE
IF FIFO?
SeqC CRCOffC FeedC ZCP3C FeedEntC EOL
ELSE
SeqC CRCOffC RapidC ZCP3C RapidFC EOL
END
END
RETURN

finishSub1:
SeqC CRCOffC
IF NOT FeedConnect?
loadPRIMEZCP3
IF ZMove?
IF AutoCycle?
pRIMEZCP3
ELSE
IF FIFO?
FeedC pRIMEZCP3 FeedEntC
ELSE
RapidC pRIMEZCP3 RapidFC
END
END
END
END
EOL
RETURN

formatArc:
IF ArcCW?
CWArc
ELSE
CCWArc
END
IF XYPlane?
MoveXY
IF ZMove?
MoveZ ArcIJ 'K' ArcZRads#
ELSE
ArcIJ
END
ELSE
IF XZPlane?
MoveX
IF YMove?
MoveY MoveZ ArcIJ 'J' ArcZRads#
ELSE
MoveZ ArcIJ
END
ELSE { YZPlane }
IF XMove?
MoveX MoveY MoveZ ArcIJ 'I' ArcZRads#
ELSE
MoveY MoveZ ArcIJ
END
END
END
RETURN

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

toolPath:
EACHFeat
IF PointFeat? { Drilling Only }
IF RetractToCP1? AND NOT FirstFeat?
SeqC DrillOff EOL
SeqC Rapid ZCP1 RapidF EOL
SeqC Cycle MoveSXYZC RLevel Peck FeedEnt EOL
ELSE
SeqC MoveSXYZC EOL
END
ELSE
IF RapidFeat?
IF XMove? OR YMove? OR ZMove?
SeqC ckCRC RapidC MoveXYZC RapidFC EOL
END
ELSE
IF LineFeat?
IF XMove? OR YMove? OR ZMove?
SeqC ckCRC FeedC MoveXYZC FeedRateC EOL
END
ELSE
IF ArcFeat?
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
SeqC formatArc ArcFeedC EOL
NEXTQuadrant
END
END
END
IF AutoCycle?
SetAbs
Save# Num#('6') SUB# EPX# CurOriginPosX#
Save# Num#('7') SUB# EPY# CurOriginPosY#
SetInc
END
END
NEXTFeat
RETURN

autoCycCutSub1: {part 1}
CalcACSRXY {calc tool position, CalcAutoCycleStatusRecordXY}
SaveSubStatus {save tool position}
SetPass1 {element cut moves}
SetSRXYtoSP
IF Repeats? AND ZShiftOnly?
entryMove
END
SeqC incValueC EOL
RETURN

autoCycCutSub2: {part 2}
SeqC absOrIncC CRCOffC
IF FIFO?
FeedC ZCP2C FeedEntC
ELSE
RapidC ZCP2C RapidFC
END
EOL
SetSRSubXY {restore SR to 1st position value}
ReSetPass2 {restore for positioning moves}
RETURN

cutAutoCycle:
IF Repeats? AND NOT ZShiftOnly?
EachRep
IF NOT FirstCycle?
IF FIFO?
Rapid
END
SeqC RapidC StrtPos
IF FIFO?
RapidF
END
EOL
IF NOT FeedConnect?
SeqC ZCP2C EOL
END
END
END
EACHFeat
doCycleComment
IF SPXMove? OR SPYMove?
IF FIFO?
Rapid
END
SeqC RapidC MoveSXYC
IF FIFO?
RapidF
END
EOL
END
autoCycCutSub1
IF Repeats? AND ZShiftOnly?
EachRep
IF NOT FirstCycle?
doCycleComment
IF FeedConnect?
IF SPXMove? OR SPYMove?
SeqC FeedC incValueC MoveSXYC FeedEntC EOL
END
ELSE
IF SPXMove? OR SPYMove?
SeqC RapidC incValueC MoveSXYC RapidFC EOL
END
END
absOrIncC
IF FeedConnect?
entryMove
ELSE
IF FeedEntry?
SeqC RapidC ZCP2C RapidFC EOL
END
entryMove
END
SeqC incValueC EOL
END
toolPath
IF NOT FeedConnect?
autoCycExitMove
END
NextRep
ELSE
entryMove
toolPath
END
autoCycCutSub2
NEXTFeat
IF Repeats? AND NOT ZShiftOnly?
finishSub1
NextRep
END
SetPass1
RETURN

milling:
IF Repeats?
EachRep
doCycleComment
IF SPXMove? OR SPYMove?
SeqC connectC MoveSXYC EOL
END
IF FeedConnect?
entryMove
ELSE
IF FeedEntry?
SeqC RapidC ZCP2C RapidFC EOL
END
entryMove
END
toolPath
finishSub1
NextRep
ELSE
entryMove
toolPath
END
RETURN

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

drilling:
GetCycle
Cycle StrtPos ZDepth RLevel Peck FeedEnt
TrackZNO# FIRST SPZ# {.81.2}
RETURN

checkPass: {use the correct StrtPos}
IF AutoCycle?
SetPass2
ELSE
SetPass1
END
IF NOT Flag?('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
ClearCSOffset
END
RETURN

opGuts:
ResetCRCNum
IF FirstOperation? OR NewTool?
FORMAT(RapidF#,7)
RapidF# { Forces FeedEntC/FeedRateC }
FORMAT(RapidF#,5)
END
IF Milling?
SeqC ZCP2C EOL
IF AutoCycle?
cutAutoCycle
ELSE
milling
END
exitMove
ELSE
IF Drilling?
toolPath
setDrillEndOpZ
SeqC DrillOff EOL
SeqC Rapid ZCP3 RapidF EOL
END
END
RETURN

getStartOfSameTool:
doPartCycleComment
doOpComments
doPostScript
checkPass
RETURN

progStart:
InitProg
ReverseXZArcs
InitWFONum
SetFlood
SetMaxRPM('10000')
IF Metric?
SetMaxFeed('12700')
ELSE
SetMaxFeed('500')
END
Save# Num#('1') Num#('0') { MultipleParts Current Tool FirstOp# }
Save# Num#('2') Num#('0') { MultipleParts ToolOp# Counter }
Save# Num#('3') Num#('0') { LongHand PeckCycle }
SetFlagF('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
SetFlag('3') { Incrementing WFOs in effect }
SetFlag('4') { This post supports IncWFO/DecWFO }
SetFlagF('6') { TRUE = B-Style Output, FALSE = C-Style Output }
SetFlagF('7') { TRUE = D-Style Output }
SetFlag('8') { TRUE = D-Style Output, FALSE = Local G52-WFO Coordinates }
SetArcSegmentAccuracy('.001')
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
' Commands: may be capital and/or lower case letters. Separate commands with a space.' EOL
END

IF NOT Flag?('7')
IF Equal? NumOfCS# Num#('1') { 3 Axis Part - Output M-Style }
SetFlag('7')
ELSE
IF MultipleParts?
IF WorkFixtureOffsets?
IF LTEqual? MUL# Parts# NumOfCS# Num#('30')
SetWFOCS { use WFO for CS changes }
ELSE
IF Flag?('8')
SetFlag('7')
END
IF UseComments?
'( Not enough Work Fixture Offsets to handle this part. )' EOL
'( Number of parts [ ' Parts# ' ] times CSs [ ' NumOfCS# ' ] )' EOL
'( exceeds the machine limit. Switching to '
IF Flag?('7')
'non'
ELSE
'G52'
END
'-wfo style output. )' EOL
END
END
ELSE
SetFlag('7')
END
ELSE
IF LTEqual? NumOfCS# Num#('30') {****}
SetWFOCS { use WFO for CS changes }
ELSE
IF Flag?('8')
SetFlag('7')
END
IF UseComments?
'( Not enough Work Fixture Offsets to handle this part. )' EOL
'( Number of CSs [ ' NumOfCS# ' ] exceeds the machine limit. )' EOL
'( Switching to '
IF Flag?('7')
'non'
ELSE
'G52'
END
'-wfo style output. )' EOL
END
END
END
END
END
RETURN

initOp:
EOR EOL
EachOp
IF FirstOperation?
IF ToolChangeAtHome?
SetHome
END
END
NextOp
IF UseComments?
IF ProgramNameComment?
'(NAM, ' ProgramName$ ' )' EOL
END
IF ProgramComment?
'(MSG, ' ProgramComment$ ' )' EOL
END
IF FormatNameComment?
'(MSG, FORMAT: ' FormatName$ ' )' EOL
END
IF TimeComment?
'(MSG, ' Date$ ' AT ' Time$ ' )' EOL
END
IF MovesComment?
'(MSG, OUTPUT IN ' MoveType$ ' INCHES )' EOL
END
IF PartsComment?
'(MSG, PARTS PROGRAMMED: ' Parts# ' )' EOL
END
IF StartToolComment?
'(MSG, FIRST TOOL NOT IN SPINDLE )' EOL
END
END
OpenSub
restoreScale
SeqC Plane 'G70' AbsOrInc 'G80G94' EOL
SeqC Rapid 'Z20.M25' RapidF EOL
RETURN

firstOp1:
IF ToolChangeAtHome?
SetHome
SeqC Home 'M25' EOL
END
doPartCycleComment
doOpComments
Seq OpToolID EOL
SeqC ToolChng EOL
doPostScript
RETURN

firstOp2:
checkPass
IF Milling?
SeqC AbsOrInc PlaneC Rapid StrtPos cSAngleA cSAngleB RapidF Speed SpinOn CoolOn wFOStuff EOL
ELSE
SeqC drilling cSAngleA cSAngleB Speed SpinOn CoolOn wfoStuff EOL
END
IF Milling?
SeqC ZCP1 EOL
END
RETURN

firstOp3:
RETURN

newToolOp1:
SeqC CoolOff EOL
SeqC RapidC 'Z20.M25' RapidFC EOL
RETURN

newToolOp2:
doEndOpPS
IF ToolChangeAtHome?
SeqC absOrIncC Rapid PRIME Home 'M25' RapidF EOL
END
IF LAST ProgStop?
SeqC 'M0' EOL
ELSE
SeqC ProgStop EOL
END
RETURN

newToolOp3: {Start new Operation}
doPartCycleComment
doOpComments
Seq OpToolID EOL
SeqC ToolChng EOL
doPostScript
checkPass
RETURN

newToolOp4:
IF Milling?
SeqC AbsOrInc PlaneC Rapid StrtPos cSAngleA cSAngleB RapidF Speed SpinOn CoolOn wFOStuff EOL
ELSE
SeqC drilling cSAngleA cSAngleB Speed SpinOn CoolOn wfoStuff EOL
END
IF Milling?
SeqC ZCP1 EOL
END
RETURN

newToolOp5:
RETURN

sameToolOp1:
IF SameTool?
doEndOpPS
IF LAST ProgStop?
SeqC CoolOff EOL
SeqC RapidC 'Z20.M25' RapidFC EOL
SeqC 'M0' EOL
ELSE
IF AChange? OR BChange?
SeqC ZCP1 EOL
END
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
END
END
RETURN

sameToolOp2: {Start new Operation}
doPartCycleComment
doOpComments
doPostScript
checkPass
RETURN

sameToolOp3: {Start new Operation}
IF SameTool?
IF LAST ProgStop?
IF Milling?
SeqC AbsOrInc PlaneC Rapid StrtPos cSAngleA cSAngleB RapidF Speed SpinOn CoolOn wFOStuff EOL
ELSE
SeqC drilling cSAngleA cSAngleB Speed SpinOn CoolOn wfoStuff
EOL
END
IF Milling?
SeqC ZCP1 EOL
END
ELSE
IF Milling?
SeqC AbsOrInc PlaneC Rapid StrtPos cSAngleA cSAngleB RapidF SpeedC wFOStuff EOL
ELSE
SeqC drilling cSAngleA cSAngleB SpeedC
END
IF NOT CoolOff? AND LAST CoolOff?
CoolOn
END
wfoStuff
EOL
END
END
RETURN

end1:
SeqC CoolOff EOL
SeqC RapidC 'Z20.M25' RapidFC EOL
RETURN

end2:
doEndOpPS
IF FIRST ToolChangeAtHome? {.71.2 added FIRST modifier}
SeqC absOrIncC Rapid PRIME FirstHome 'M25' RapidF EOL
END
IF ProgStop?
SeqC 'M0' EOL
ELSE
IF MultipleParts? AND AllToolsOnePart? AND NOT LastPart?
SeqC ProgStop EOL
END
END
RETURN

end3:
SeqC 'M0' EOL
SeqC EOP EOL
Post
Close
IF UseComments?
SetScale('1') {restore scale for comments}
Reopen
IF FileBytesComment?
'(MSG, FILE LENGTH: ' FileBytes# ' CHARACTERS )' EOL
END
IF FileFeetComment?
'(MSG, FILE LENGTH: ' FileFeet# ' FEET )' EOL
END
IF FileMetersComment?
'(MSG, FILE LENGTH: ' FileMeters# ' METERS )' EOL
END
Close
END
RETURN

mPallTools1P: {Multiple Parts, All Tools 1 Part}
IF FirstOperation? OR EquallySpacedOffsets?
SetFlag('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
IF FirstOperation?
firstOp1
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
newToolOp2
newToolOp3
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END
opGuts
RETURN

mP1ToollAllPfu: {Multiple Parts, 1 Tool all Parts, full up}
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
opGuts
RETURN

mP1ToollAllPXcp: {Multiple Parts, 1 Tool all Parts, exit Clearance plane}
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
opGuts
RETURN

noMPs: {no multiple parts}
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
opGuts
RETURN

masterSub:
IF MultipleParts?
IF AllToolsOnePart?
mPallTools1P
ELSE {implied OneToolAllParts?}
IF FullUp?
mP1ToollAllPfu
ELSE {implied ExitClearancePlane?}
mP1ToollAllPXcp
END
END
ELSE
noMPs
END
RETURN

endPartSub:
{End of program ************************************************************}

{finish last operation}
end1
end2
RETURN

newPart1: {Finish off last Part}
IF FullUp?
SeqC CoolOff EOL
SeqC Rapid 'Z20.M25' RapidF EOL
END
{doEndOpPS}
RETURN

newPart2: {Start new Part}
sameToolOp2
RETURN

newPart3: {Start new Part}
SetFlag('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF Milling?
SeqC AbsOrInc PlaneC Rapid StrtPos cSAngleA cSAngleB RapidF Speed SpinOn CoolOn wFOStuff EOL
ELSE
SeqC drilling cSAngleA cSAngleB Speed SpinOn CoolOn wfoStuff EOL
END
RETURN

toggleIncDecWFO:
IF Flag?('3') { Incrementing WFOs in effect }
SetFlagF('3')
ELSE { Decrementing WFOs in effect }
SetFlag('3')
END
RETURN

mPLoop:
Save# Num#('2') Recall# Num#('1')
IF WorkFixtureOffsets?
IF Flag?('3') { Incrementing WFOs in effect }
NewWFO
ELSE
LastWFO
END
EachWFO
ELSE
EachPart
END
IF AllToolsOnePart?
EachOp
masterSub
NextOp
endPartSub
ELSE { OneToolAllParts }
EachOp
IF Equal? Operation# Recall# Num#('2') { Valid Tool Op }
IF FirstOperation? OR NewTool?
IF FirstPart? AND Flag?('3') { Incrementing WFOs in effect }
masterSub
ELSE
IF LastPart? AND NOT Flag?('3') { Decrementing WFOs in effect }
masterSub
ELSE
newPart1
newPart2
newPart3
opGuts
END
END
ELSE
masterSub
END
IF LastOp?
IF LastPart? AND Flag?('3') { Incrementing WFOs in effect }
Save# Num#('1') Num#('0')
ELSE
IF FirstPart? AND NOT Flag?('3') { Decrementing WFOs in effect }
Save# Num#('1') Num#('0')
END
END
Save# Num#('2') Recall# Num#('1')
ELSE
IF NEXT SameTool?
Save# Num#('2') NEXT Operation#
ELSE
IF LastPart? AND Flag?('3') { Incrementing WFOs in effect }
Save# Num#('1') NEXT Operation#
Save# Num#('2') Num#('0')
ELSE
IF FirstPart? AND NOT Flag?('3') { Decrementing WFOs in effect }
Save# Num#('1') NEXT Operation#
Save# Num#('2') Num#('0')
ELSE
Save# Num#('2') Recall# Num#('1')
END
END
END
END
END
NextOp
END
IF WorkFixtureOffsets?
IF Flag?('3') { Incrementing WFOs in effect }
IncWFO
NextWFO
DecWFO
ELSE { Decrementing WFOs in effect }
DecWFO
NextPrevWFO
IncWFO
END
IF Flag?('4') { This post supports IncWFO/DecWFO }
toggleIncDecWFO
END
ELSE
NextPart
END
RETURN

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

progStart {setup and initializations}
initOp

IF MultipleParts?
IF WorkFixtureOffsets?
{'NOTE: This Post Processor does not support Work Fixture Offsets for Multiple Parts.' EOL
'It is recommended that you change your selection to Equally Spaced Offsets.' EOL}
END
IF AllToolsOnePart?
mPLoop
ELSE
EachOp
IF FirstOperation?
Save# Num#('1') Operation#
END
NextOp
mPLoop mPLoop mPLoop mPLoop mPLoop
mPLoop mPLoop mPLoop mPLoop mPLoop
mPLoop mPLoop mPLoop mPLoop mPLoop
mPLoop mPLoop mPLoop mPLoop mPLoop
mPLoop mPLoop mPLoop mPLoop mPLoop
endPartSub
END
ELSE
EachOp
masterSub
NextOp
endPartSub
END
end3


Wyszukiwarka