Fanuc 15M Krk [OT] NCQ16 16 2


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

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

{
10/24/94 [cwh]
B001.81.4 ( from B001.81.3 )

Made changes to zonlyRep and finishSub1 subs to properly handle
Feed connects and clearance moves.
}

{11/8/94
Modified: Fanuc 6M (FW) B001.81.4
For: Gibbs & Associates
Versions: Catalyst v2.14.12C/Compost 4.21.23
Changes made per Pete Jackson
Charles reported a problem involving operations that do not change coordinate systems from
previous operations.
Added ClearCSOffset at NotSameToolWFO and SameToolWFO subs.
DWB}

{
12/01/94
B001.81.6
Changed firstOp3 to call out A0B0 to move to the first CS.
When possible, this should be changed to check the MDD and only call out the axes that
make sense.

Added RecallWFO sub-routine to NotSameToolWFO and SameToolWFO to ouput the current fixture offset
and A0B0. Added for easier restarts at the machine. Both are only called from noMPs.
When possible, this should be changed to check the MDD and only call out the axes that
make sense.
}

{
12/02/94
Changed version number to .00 from .81
TH}

{
Format: Fanuc 6M (FW) B001.00.01
12/08/94
Added AAxisAvail? and BAxisAvail? checks to cSAngleA and cSAngleB subs
Added WFO1 and A0B0 if AxisAvail to end2:
TH}

{
Format: Fanuc 6M (FW) B001.00.01
12/09/94
Fixed RecalWFO to check AAxisAvail? and BAxisAvail?
Cleaned up firstOp3 to use new checks placed in cSAngleA and cSAngleB
TH}

{
Format: Fanuc 6M (FW) B001.00.03
12/19/94
Added ClearCSOffset to openMP: closeMP: and subCSMP:
Added if AChange? OR BChange? to home postition call-out in sameToolOp1
Started using Flag('3') to determine toggle between incrementing through MPs and decrementing through MPs
Changed closeMP to check Flag('3'). If true, the WFOs will increment from first to last. If false, the WFOs will
decrement from last to first.
Example:
TRUE for 4 parts: G54P1, G54P2, G54P3, G54P4
FALSE for 4 parts: G54P4, G54P3, G54P2, G54P1
This is most useful for tombstone machining on rotary tables. With this method, the code will machine part1, rotate, part2,
rotate, part3, rotate, part4, tool change, part4, part3, part2, part1, toolchange, etc. It minimizes the rotation and also
stops the machine from "winding up".
To do this a new sub was created called toggleIncDecWFO. The flag is set to true in progStart and toggled inside closeMP
after running through the parts
Replaced SetZRepInc and restoreAbsOrInc with one sub called doAbsOrInc. Any line with SetZRepInc now
has doAbsOrInc as the first command after the SeqC.
TH}

{
Format: Fanuc 6M (FW) B001.00.04
1/10/95
newToolOp3 now has an AbsOrInc on the line that calls out the Plane 'G80' CRCOff
newToolOp5 no longer has the AbsOrInc command
NewToolOp5b has been created and has the AbsOrInc command
Changed mP1ToollAllPfu to call NewToolOp5b
Added AbsOrInc and Rapid to the FirstOperation? section of mP1ToollAllPXcp
Added Rapid to the NewTool? section of mP1ToollAllPXcp
Started using Flag ('4') to turn on Inc/Dec wFO's (See above). True means use Inc/Dec wFO's.
mP1ToollAllPXcp, mP1ToollAllPfu, and mPallTools1P now output wFO if NOT WorkFixtureOffsets?
TH}

{
Format: Fanuc 6M (FW) B001.00.05
1/13/95
Replaced TrackZNO# ZDepth# with TrackZNO# FIRST SPZ# in the drilling section
Formatted TrackZNO# to #4
}

{
Format: Fanuc 6M (FW) B001.00.06
2/15/95
Fixed RecallWFO: to output correct wFO# if WFOCS
TH}

{ Added ClearCSOffset to subCSMP TH}

{
Format: Fanuc 6M (FW) B001.10
7/27/95
Added G52 style output for too many coordinate systems
Updated to .10 format
TH}

{1/17/96, Updated .10 to .11 version, MPK}

{2/26/96
Initial: Fanuc 6M (FW) B001.11
Created: Fanuc 6M (FW) B001.11.01
Develop: ComPost 4.21.34, Catalyst68K v3.02.02C
Comment: Corrections to Processor.
Corrected format of CSOffsetA# and CSOffsetB#.
To correct multiple parts output:
Added "OR Flag?('2')" to "IF WFOCS?" in "subCSMP:".
To Simplify prog subs and correct errors in mP1ToollAllPXcp:
Changed FirstOp3a/NewToolOp5a to FirstOp4/NewToolOp6
Deleted NewToolOp5b sub and changed call to newToolOp5 (they were identical!)
Deleted OfstOn and Cool On from firstOp3/newToolOp5
Added calls to FirstOp4/NewToolOp6 after calls to firstOp3/newToolOp5.
Changed StrtPos in mP1ToollAllPXcp to firstOp3/newToolOp5.
To correct a literal number 2 from being output when processing multiple parts:
Changed order of booleans from:
IF WFOCS? OR Flag?('2')
to:
IF Flag?('2') OR WFOCS?
Modified wFO Handling:
Changes:
Deleted RecallWFO sub. It was not used!
Deleted NotSameToolWFO & SameToolWFO subs.
Added wfoStuff sub.
Changed all wFO calls in main loops to wfoStuff.
Results:
Changes do not effect Multiple Parts output.
Correct wFO is output by default at the beginning of each tool.
G52, if used, is output by default at the beginning of each tool.
G52, without wFO, is output at SameTool only if there is a change.
Jim Radcliffe}

{4/17/96
Initial: Fanuc 6M (FW) B001.11.01
Created: Fanuc 6M (FW) B001.12.01
Comment: Changed version number to reflect new identification scheme.
Jim Radcliffe}

{6/14/96
Initial: Fanuc 6M (FW) B001.12.01
Created: Fanuc 6M (FW) B001.12.02
Comment: Modified CRC handling to reflect the way I do it and same as M001.89.
Jim Radcliffe}

{6/17/96
Initial: Fanuc 6M (FW) B001.12.02
Created: Fanuc 16M Kuraki Cxxx.12
ForUser: Patriot Precision Products
Control: Fanuc 16M
Machine: Kuraki KBM-2000
Develop: ComPost 4.21.37, Catalyst68K v3.04.10.C
Comment: New processor per sample readout from and conversation with Jeff Nelson.
Fanuc 0M style subs
W axis used for Drill Operations but set for all operations to fcilitate editing.
Jim Radcliffe}

{2/24/97
Initial: Fanuc 16M Kuraki C123.12
Created: Fanuc 16M Kuraki C123.14
Develop: ComPost2 68K 1.0b11, Virtual Gibbs 3.23
Comment: Updated to .14 format per Fanuc 6M (PW) C001.14
Jim Radcliffe}

{2/24/97
Initial: Fanuc 16M Kuraki C123.14
Created: Fanuc 16M Kuraki Cxxx.14
ForUser: 3M
Control: Fanuc 15M
Machine: Kuraki KBT-13PDX ( Horizontal )
Develop: ComPost2 68K 1.0b11, Virtual Gibbs 3.23
Comment: New processor per marked up readout.
Deleted the W axis.
Deleted T codes, manual tool changer!
Simplified handling of AbsOrInc/AbsValue/IncValue with OfstOff with created conditional calls!
Deleted OfstOff when followed by tool change, ToolChng retracts the spindle!
Deleted G30 Y0 at tool changes, ToolChng positions the Y axis!
Deleted move to machine home at end of program.
Jim Radcliffe}

{15Feb99
Original: Fanuc 15M Kuraki KBT CY32.14
Created: Fanuc 15M Kuraki [OT] NCQ16.16
For: Ort Tool
Changes made per: Jeff Burgard
Develop: Catalyst 5.03/ComPost2 1.7b15
Added Post Header Comment at the top of Prog.
NEW POST : FIRST DRAFT
Updated to Longhand C_Style per Fanuc 6M [PW] NCU99.16
Added W-Axis as default depth axis.
Post switches to Z-Axis with PostScript Pin(1) Command.
The Commands is NON-Modal.
Added Utility Data at InitProg.
Charles Winston}

{17Feb99
Original: Fanuc 15M Kur [OT] NCQ16.16
Created: Fanuc 15M Kur [OT] NCQ16.16.1
For: Ort Tool
Changes made per: Jeff Burgard
Develop: Catalyst 5.03/ComPost2 1.7b15
Added Spaces between all Addresses
Added boolean for OPTCYC1 in pSStuff. Sets Flag('20')
Added SetFlagF('20') in progStart.
Deleted EOR and ProgID1 at initOp.
Deleted AbsOrInc WFO1 in firstOp1.
Deleted 'M0' in newToolOp2 and replaced with LAST ProgStop? Boolean.
Added 'M98 P9000' option in NewToolOp2 and End2. Uses Flag('20') ( Set with PostScript OptCyc1.)
Deleted incValueC OfstOff 'W0'and absOrIncC in End1.
Charles Winston}

{10Mar99
Original: Fanuc 15M Kur [OT] NCQ16.16.1
Created: Fanuc 15M Kur [OT] NCQ16.16.2
For: Ort Tool
Changes made per: Jeff Burgard
Develop: Catalyst 5.03/ComPost2 1.7b15
Moved OptionalStops to the line immediately following ToolChange in newToolOp2.
Charles Winston}

{Prog Numeric Format Definitions ****}

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(CSOffsetA#,3)
FORMAT(CSOffsetB#,3)
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(Recall#,5)
FORMAT(ClearancePlane1#,4)
FORMAT(ClearancePlane2#,4)
FORMAT(ClearancePlane3#,4)
FORMAT(ZInPlusInc#,4)
FORMAT(ZCP2PlusInc#,4)
FORMAT(SPZ#,4)
FORMAT(EPZ#,4)
FORMAT(ZDepth#,4)
FORMAT(ADD#,5)
FORMAT(CS#,5)
FORMAT(PartNum#,5)
FORMAT(Program#,7)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(ToolOffset#,5)
FORMAT(NewWFO#,5)
FORMAT(Parts#,5)
FORMAT(Dwell#,6)
FORMAT(RapidF#,8)

{W Axis Subroutines *****************}

depthAxis:
IF Equal? Pallet# Num#('0')
' W'
ELSE
' Z'
END
RETURN

DCP1:
depthAxis ClearancePlane1#
TrackZNO# ClearancePlane1#
RETURN

DCP1C:
LoadFeat Num#('0') Num#('0') ClearancePlane1#
IF ZMove?
DCP1
END
RETURN

DCP2:
depthAxis ClearancePlane2#
TrackZNO# ClearancePlane2#
RETURN

DCP2C:
LoadFeat Num#('0') Num#('0') ClearancePlane2#
IF ZMove?
DCP2
END
RETURN

DCP3:
depthAxis ClearancePlane3#
TrackZNO# ClearancePlane3#
RETURN

DCP3C:
LoadFeat Num#('0') Num#('0') ClearancePlane3#
IF ZMove?
DCP3
END
RETURN

DInPlusInc:
depthAxis ZInPlusInc#
RETURN

DCP2PlusInc:
depthAxis Sub# ZCP2PlusInc# ClearancePlane1#
TrackZNO# ZCP2PlusInc#
RETURN

DCP2PlusIncC:
LoadFeat Num#('0') Num#('0') ZCP2PlusInc#
DCP2PlusInc
END
RETURN

DInC:
LoadFeat Num#('0') Num#('0') FIRST SPZ#
IF ZMove?
depthAxis FIRST SPZ#
TrackZNO# FIRST SPZ#
END
RETURN

DIn:
depthAxis FIRST SPZ#
TrackZNO# FIRST SPZ#
RETURN

MoveDC:
IF ZMove?
depthAxis EPZ#
TrackZNO# EPZ#
END
RETURN

MoveSDC:
IF SPZMove?
depthAxis SPZ#
TrackZNO# SPZ#
END
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

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

cSWFO:
' G' ADD# cSPartNum# Num#('53')
RETURN

wFO:
' G' ADD# PartNum# Num#('53')
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:
' G52 X' CSOffsetX# ' Y' CSOffsetY# ' Z' CSOffsetZ#
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:
SeqC '( CS#' CS# ' - ' CSComment$ ' )' EOL
RETURN

doCSWFOComment:
IF FirstOperation? OR NewTool? OR ChangeCS?
'( ' 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:
doCSComment
IF WFOCS?
doCSWFOComment
END
RETURN

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

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

doOperationComment:
IF UseComments?
IF OperationComment?
SeqC '( ' OperationComment$ ' )' EOL
END
END
RETURN

doToolComment:
IF UseComments?
IF ToolComment?
SeqC '( ' ToolComment$ ' )' EOL
END
END
RETURN

doOpComments:
IF UseComments?
SetScale('1')
IF OperationIDComment?
SeqC '( OPERATION ' Operation# ': ' OperationType$ ' )' EOL
END
IF WorkGroupComment?
SeqC '( ' WorkGroupComment$ ' )' EOL
END
IF ToolTypeComment?
SeqC '( TOOL ' Tool# ': ' ToolDiameter# ' ' ToolType$ ' )' EOL
END
IF Equal? Pallet# Num#('1')
SeqC '( Operation Uses Z-Axis )' EOL
END
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:
NewWFOF
FourthCWF
FourthCCWF
FifthCWF
FifthCCWF
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
PalletInF
SetPalletIn('0')
RETURN

pSStuff:
IF FirstOperation?
IF OPTCYC1?
SetFlag('20')
END
END
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:
depthAxis
IF NOT Flag?('7')
PRIME ClearancePlane2#
ELSE
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:
depthAxis
IF NOT Flag?('7')
PRIME ClearancePlane3#
ELSE
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 DInC
IF NOT EmptyLine?
FeedEntC
END
EOL
ELSE
IF FeedEntry?
SeqC FeedC DInC
IF NOT EmptyLine?
FeedEntC
END
EOL
ELSE
SeqC RapidC DInC EOL
END
END
RETURN

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

exitMove:
IF AutoCycle?
SeqC CRCOffC DCP3C EOL
ELSE
IF FIFO?
SeqC CRCOffC FeedC DCP3C FeedEntC EOL
ELSE
SeqC CRCOffC RapidC DCP3C 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
END
END
END
END
EOL
RETURN

formatArc:
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
MoveXYC MoveDC
IF ArcIJFormat?
ArcIJC
ELSE
ArcRC
END
RETURN

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

ckCRCNum:
{ Not supported in ToolPath. Called in FirstOp3, NewToolOp5 & SameToolOp3 }
RETURN

doPeck: { longDrillStuff }
{ not supported }
RETURN

drillFeature: { longDrillStuff }
{ not supported }
RETURN

toolPath:
EACHFeat
IF PointFeat? { Drilling Only }
SeqC MoveSXYC MoveSDC EOL
ELSE
IF RapidFeat?
IF XMove? OR YMove? OR ZMove?
SeqC ckCRC RapidC MoveXY MoveDC ckCRCNum EOL
END
ELSE
IF LineFeat?
IF XMove? OR YMove? OR ZMove?
SeqC ckCRC FeedC MoveXY MoveDC FeedRateC ckCRCNum 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
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 DCP2C FeedEntC
ELSE
RapidC DCP2C
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 EOL
IF NOT FeedConnect?
SeqC DCP2C EOL
END
END
END
EACHFeat
doCycleComment
IF SPXMove? OR SPYMove?
IF FIFO?
Rapid
END
SeqC RapidC MoveSXYC EOL
END
autoCycCutSub1
IF Repeats? AND ZShiftOnly?
EachRep
IF NOT FirstCycle?
doCycleComment
IF SPXMove? OR SPYMove?
SeqC connectC incValueC MoveSXYC EOL
END
absOrIncC
IF FeedConnect?
entryMove
ELSE
IF FeedEntry?
SeqC RapidC DCP2C 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 DCP2C EOL
END
entryMove
END
toolPath
finishSub1
NextRep
ELSE
entryMove
toolPath
END
RETURN

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

drilling:
IF RetractToCP1?
SeqC DCP1C EOL
ELSE
SeqC DCP2C EOL
END
GetCycle
SeqC Cycle FromCP StrtPos DepthAxis ZDepth# RLevel Dwell Peck Retract FeedEnt EOL
TrackZNO# FIRST SPZ# {.81.2}
toolPath
setDrillEndOpZ
SeqC Rapid DrillOff DCP3 EOL
RETURN

longDrilling:
SeqC DrillCP EOL
GetCycle
SeqC StrtPosC EOL
toolPath
LoadFeat Num#('0') Num#('0') ClearancePlane3#
IF ZMove?
SeqC RapidC DCP3C EOL
END
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

doCRCOn:
IF CutterRadiusCompensation?
CRCOffsetC
END
RETURN

opGuts:
ResetCRCNum
IF FirstOperation? OR NewTool?
RapidF# { Forces FeedEntC/FeedRateC }
END
IF Milling?
SeqC DCP2C EOL
IF AutoCycle?
cutAutoCycle
ELSE
milling
END
exitMove
ELSE
IF Drilling?
drilling
END
END
RETURN

progStart:
InitProg
ReverseXZArcs
InitWFONum
SetFlood
SetMaxRPM('2000')
IF Metric?
SetMaxFeed('12700')
ELSE
SetMaxFeed('300')
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 }
SetFlagF('20') { for ToolChange }
SetPalletIn('0') { Sets Z or W axis }
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
' ' EOL
' The PIN(1) command can be entered into any operations Utility Data, At Op Start BOX.' EOL
' PIN(1) switches the post to Z-Axis. The command is NON-Modal.' EOL
' A Comment for the Operator is also output.' EOL
' The default axis used if no PIN number is entered is the W-Axis.' EOL
' ' 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#('6')
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#('6') {****}
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:
IF UseComments? AND ProgramNameComment?
'( PROGRAM: ' ProgramName$ ' )'
END
EOL
EachOp
IF FirstOperation?
IF ToolChangeAtHome?
SetHome
END
END
NextOp
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 IN SPINDLE )' EOL
END
END
restoreScale
RETURN

firstOp1:
doOpComments
Seq incValue Plane ' G28 Z0 W0' EOL
SeqC Rapid ' G20' CRCOff DrillOff EOL
doPartCycleComment
doToolComment
doPostScript
IF Equal? Pallet# Num#('1')
SeqC '( Operation Uses Z-Axis )' EOL
END
RETURN

firstOp2:
SeqC Speed SpinOn EOL
g52Stuff
checkPass
SeqC AbsOrInc wFOStuff RapidC StrtPos
IF Equal? Pallet# Num#('0')
DCP1
END
EOL
SeqC cSAngleA cSAngleB EOL
RETURN

firstOp3:
IF Equal? Pallet# Num#('0')
SeqC ' G43 Z0 H' ToolOffset# doCRCOn CoolOn EOL
ELSE
SeqC ' W0' EOL
SeqC OfstOn doCRCOn CoolOn EOL
END
doOperationComment
RETURN

newToolOp1:
RETURN

newToolOp2:
doEndOpPS
IF ToolChangeAtHome?
SeqC absOrIncC Rapid PRIME Home EOL
END
SeqC OpToolID
IF Flag?('20')
' M98 P9000'
ELSE
' M906'
END
EOL
IF LAST ProgStop?
SeqC ' M0' EOL
ELSE
SeqC ProgStop EOL
END
RETURN

newToolOp3: {Start new Operation}
doToolComment
Seq incValueC OfstOff ' W0' EOL { G91G28Z0W0 }
SeqC Rapid ' G20' CRCOff DrillOff AbsOrInc Speed SpinOn EOL
doPartCycleComment
doOpComments
doPostScript
IF Equal? Pallet# Num#('1')
SeqC '( Operation Uses Z-Axis )' EOL
END
RETURN

newToolOp4:
g52Stuff
checkPass
SeqC AbsOrInc wFOStuff RapidC StrtPos
IF Equal? Pallet# Num#('0')
DCP1
END
EOL
SeqC cSAngleA cSAngleB EOL
RETURN

newToolOp5:
IF Equal? Pallet# Num#('0')
SeqC ' G43 Z0 H' ToolOffset# doCRCOn CoolOn EOL
ELSE
SeqC ' W0' EOL
SeqC OfstOn doCRCOn CoolOn EOL
END
doOperationComment
RETURN

sameToolOp1:
doEndOpPS
IF LAST ProgStop?
SeqC incValueC OfstOff ' W0' CoolOff EOL { G91G28Z0W0 }
SeqC ' M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
IF NewToolOffset? OR ChangeCS?
SeqC incValueC OfstOff ' W0' EOL
END
END
RETURN

sameToolOp2: {Start new Operation}
doPartCycleComment
doOpComments
doPostScript
IF Equal? Pallet# Num#('1')
SeqC '( Operation Uses Z-Axis )' EOL
END
checkPass
RETURN

sameToolOp3: {Start new Operation}
g52Stuff
IF LAST ProgStop?
SeqC Speed SpinOn EOL
SeqC AbsOrInc wFOStuff RapidC RapidC StrtPos
IF Equal? Pallet# Num#('0')
DCP1
END
EOL
SeqC cSAngleA cSAngleB EOL
IF Equal? Pallet# Num#('0')
SeqC ' G43 Z0 H' ToolOffset# doCRCOn CoolOn EOL
ELSE
SeqC OfstOn doCRCOn CoolOn EOL
END
ELSE
SeqC SpeedC EOL
SeqC AbsOrInc wFOStuff RapidC RapidC StrtPos
IF Equal? Pallet# Num#('0')
DCP1
END
EOL
SeqC cSAngleA cSAngleB EOL
IF NewToolOffset? OR ChangeCS?
IF Equal? Pallet# Num#('0')
SeqC ' G43 Z0 H' ToolOffset# doCRCOn
ELSE
SeqC OfstOn doCRCOn
END
END
IF NOT CoolOff? AND LAST CoolOff?
CoolOn
END
EOL
END
doOperationComment
RETURN

end1:
RETURN

end2:
doEndOpPS
IF FIRST ToolChangeAtHome? {added FIRST modifier}
SeqC absOrIncC Rapid PRIME FirstHome EOL
END
IF NOT FirstTool?
SeqC UnTool
IF Flag?('20')
' M98 P9000'
ELSE
' M906'
END
EOL
END
IF Equal? CSOffsetA# Num#('0') AND Equal? CSOffsetB# Num#('0')
ELSE
SeqC absOrIncC
IF AAxisAvail?
cSAngleA
END
IF BAxisAvail?
cSAngleB
END
EOL
SeqC ' G92'
IF AAxisAvail?
' A0'
END
IF BAxisAvail?
' B0'
END
EOL
END
IF ProgStop?
SeqC ' M0' EOL
ELSE
IF MultipleParts? AND AllToolsOnePart? AND NOT LastPart?
SeqC ProgStop EOL
END
END
RETURN

end3:
SeqC EOP EOL
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}
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 incValueC OfstOff ' W0' 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 }
SeqC wFOStuff EOL
g52Stuff
SeqC absOrIncC PlaneC Rapid StrtPos SpeedC EOL
SeqC cSAngleA cSAngleB EOL
IF FullUp?
SeqC OfstOn doCRCOn CoolOn 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

Podobne podstrony:
Fanuc 15M Kit [OT] NMQ39 16 2
Fanuc 15M MTS [OT] NCQ32 16 1
Fanuc 15M MTS [OT] NCQ32 16 1
Fanuc 15M MTS [CP] NDU66 16 2m
Fanuc 15M Krk [CGB] CT73 14 4
Fanuc 15M Mon [SM] MT98 16 1
Fanuc 15M Kmura [PP] CX07 16
Fanuc 0M LH P&W [SP] CV84 16 3
Fanuc 15M Mitsui [EG] CW15 12
Fanuc 18M MS [CST] NCT81 16
Fanuc 16M Makino [EE] NMT56 16
Fanuc 15M Matsuura C695 12
Fanuc 15M [PIW] MW82 89 2
Fanuc 11M Tyd [CGB] CT37 16 4
Fanuc 15M Matsuura M695 87m
Fanuc 15M Mat [IH] B958 12
Fanuc 15M Matsuura C695 12m
Fanuc 15M [YTC] MY61 89 1m

więcej podobnych podstron