Fanuc 0M LH K&T [SP] CV95 16 1


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

{8/18/89
Modified: Fanuc 0M (G54) M107.54
For: Pete
Modified SubCall FORMAT.
JR}

{10/13/89, Updated: Fanuc OM (G54) M107.55, P.S. & SepSubs commented out, JR}
{7/24/90, Added InitProg globally to posts with this remark, DWB}
{5/14/91, Updated Fanuc 0M G54 M107.57 to .80 format, JR}

{10/29/91
Updated: Fanuc 0M G54 M107.80
For: Gibbs & Associates
Updated to Version 4.0 per Fanuc 6M M001.81 Format.
KM}

{10/20/92
Updated: Fanuc 0M G54 M107.81
For: Gibbs & Associates
Updated to Version 4.1 per Fanuc 6M M001.81.2 Format.
DWB}

{8/18/95, Updated Fanuc 0M G54 M107.81.2 to .85 format, JR}

{1/17/96, Updated .85 to .86 version, MPK}

{3/22/96, Tested ZonlyRepAutoCycle, Changed version # to .89, MPK}

{05/14/98,
Initial: Fanuc 0M G54 C107.13
Created: Fanuc 0M P & W [] Cxxx.13
For: Svedala

Changes to Form:
1) Arcs - Modified to "R"-type arcs.
2) Tool Offsets - Modified Tool Offset Cancel to G30.

Changes to Prog:
1) FirstOp1 - Added First 3 lines of code, per customer request.
2) FirstOp4/NewToolOp6 - Added Tooling.
3) WFOStuff - Per Customer request, added AbsValue and CSAngle A/B.
4) Tooling - New sub-routine that outputs PreTool, or UnTool.
5) NewToolOp1/End1 - Added literal 'H0' after OfstOff.
CDH}

{1Jul98
Original: Fanuc 0M K&T [SP] CV95.13
Created: Fanuc 0M LH K&T [SP] CV95.16
For: Svedala
Changes made per: Bill Pruitt
Created C_Style Advanced Mill Longhand Post per Fanuc 6M LH (PW) CV83.16_ż2
Changed CRC Address from H to D in MachSpec
Charles Winston}

{8Jul98
Original: Fanuc 0M LH K&T [SP] CV95.16
Created: Fanuc 0M LH K&T [SP] CV95.16.1
For: Svedala
Changes made per: Bill Pruitt
Moved SpinOff to OfstOff line in NewToolOp1, SameToolOp1 and End1
Moved Speed SpinOn after CSAngleBC line in NewToolOp4, SameToolOp3
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(DIV#,4)
FORMAT(Recall#,5)
FORMAT(ADD#,5)
FORMAT(CS#,5)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(NewWFO#,5)
FORMAT(Parts#,5)
FORMAT(Repeats#,5)
FORMAT(Dwell#,6)
FORMAT(Program#,7)
FORMAT(PartNum#,7)
FORMAT(CallMasterNum#,7)
FORMAT(CSSubID#,7)
FORMAT(RapidF#,8)

{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:
SeqC 'G52X' CSOffsetX# 'Y' CSOffsetY# 'Z' CSOffsetZ# EOL
RETURN

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

DoCSComment:
IF FirstOperation? OR NewTool? OR ChangeCS?
'( CS#' CS# ' - ' CSComment$ ' )' EOL
END
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
END
RETURN

CSComments:
DoCSComment
IF WFOCS?
DoCSWFOComment
END
RETURN

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

DoCycleComment:
IF UseComments? AND SubComment?
'( CYCLE START )' 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?
'( TOOL ' Tool# ': ' ToolDiameter# ' ' ToolType$ ' )' EOL
END
IF ToolComment?
'( ' 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
SeqC 'G53X-20.276' EOL {Move to rotary location}
SeqC 'M55' EOL {Unclamp rotary}
SeqC IncValue EOL {Switch to Incremental}
{ (CSOffsetA# - Var#1) / 10 }
SeqC 'G60X' DIV# SUB# CSOffsetA# Recall# Num#('7') Num#('10') EOL
SeqC AbsValue EOL {Switch back to absolute}
SeqC 'M56' EOL {Clamp rotary}
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
SeqC 'G53X-20.276' EOL {Move to rotary location}
SeqC 'M55' EOL {Unclamp rotary}
SeqC IncValue EOL {Switch to Incremental}
{ (CSOffsetB# - Var#2) / 10 }
SeqC 'G60X' DIV# SUB# CSOffsetB# Recall# Num#('8') Num#('10') EOL
SeqC AbsValue EOL {Switch back to absolute}
SeqC 'M56' EOL {Clamp rotary}
END
END
RETURN

CSAngleBC:
IF BChange?
CSAngleB
END
RETURN

PSInit:
NewWFOF
FourthCWF
FourthCCWF
FifthCWF
FifthCCWF
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
RETURN

PSStuff:
RETURN

DoPostScript:
PSInit
EachPS
SeqC PostScript EOL
PSStuff
NextPS
RETURN

DoEndOpPS:
PSInit
EachEOPS
SeqC EndOpPS EOL
PSStuff
NextPS
RETURN

EntryMove:
IF FeedEntry?
SeqC FeedC ZInC
IF NOT EmptyLine? { Mostly for FeedConnect ZShiftOnly with ZMove }
FeedEntC
END
EOL
ELSE
SeqC RapidC ZInC EOL
END
RETURN

PRIMEZCP2C:
IF Flag?('7')
PRIME ZCP2C
ELSE
'Z' TrackZ# ADD# CSOffsetZ# PRIME ClearancePlane2#
END
RETURN

ExitMove:
IF NOT FeedConnect?
CRCOffC
IF FIFO?
FeedC PRIMEZCP2C FeedEntC
ELSE
RapidC PRIMEZCP2C
END
END
RETURN

ExitMove2:
LoadFeat Num#('0') Num#('0') ClearancePlane3#
IF ZMove?
IF FIFO?
FeedC ZCP3C FeedEntC
ELSE
RapidC ZCP3C
END
END
RETURN

AbsValueC:
IF NOT AbsValue?
AbsValue
END
RETURN

IncValueC:
IF AbsValue?
IncValue
END
RETURN

AbsOrIncC:
IF AbsoluteMoves?
AbsValueC
ELSE
IncValueC
END
RETURN

FormatArc:
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
MoveXYZC
IF ArcIJFormat?
ArcIJC
ELSE
ArcR
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

DoPeck: { LongDrillStuff }
{ Not supported }
RETURN

DrillFeature: { LongDrillStuff }
{ Not supported }
RETURN

ToolPath:
EACHFeat
IF PointFeat? { Drilling Only }
SeqC MoveSXYZC EOL
ELSE
IF RapidFeat?
IF XMove? OR YMove? OR ZMove?
SeqC ckCRC RapidC MoveXYZC ckCRCNum EOL
END
ELSE
IF LineFeat?
IF XMove? OR YMove? OR ZMove?
IF Decelerate?
IF RoomToDecel?
DecelMove1
SeqC ckCRC FeedC MoveXYZC FeedRateC ckCRCNum EOL
DecelMove2
END
SeqC ckCRC FeedC MoveXYZC DecelFeed ckCRCNum EOL
ELSE
SeqC ckCRC FeedC MoveXYZC FeedRateC ckCRCNum EOL
END
END
ELSE
IF ArcFeat?
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
IF LastQuadrant? AND Decelerate?
IF RoomToDecel?
DecelMove1
SeqC FormatArc ArcFeedC EOL
DecelMove2
END
SeqC FormatArc DecelFeed EOL
ELSE
SeqC FormatArc ArcFeedC EOL
END
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 IncValue EOL
RETURN

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

Milling:
EntryMove
ToolPath
RETURN

CutAutoCycle:
EACHFeat
DoCycleComment
IF SPXMove? OR SPYMove?
IF FIFO?
Rapid
END
SeqC RapidC MoveSXYC EOL
END
AutoCycCutSub1
IF Repeats?
IF ZShiftOnly?
EachRep
IF NOT FirstCycle?
IF FeedConnect?
DoCycleComment
IF SPXMove? OR SPYMove?
SeqC FeedC MoveSXYC FeedEntC EOL
END
AbsOrInc
ELSE
SeqC AbsOrInc ExitMove EOL
DoCycleComment
IF SPXMove? OR SPYMove?
SeqC IncValue RapidC MoveSXYC EOL
AbsOrInc
END
IF FeedEntry? AND NOT FIFO?
SeqC RapidC ZCP2 EOL
END
END
EntryMove
SeqC IncValue EOL
END
ToolPath
NextRep
END
ELSE
Milling
END
AutoCycCutSub2
NEXTFeat
RETURN

ZonlyRep:
{ NOTE: This Post Processor takes care of Z Clearance. }
EachRep
DoCycleComment
IF NOT FirstCycle?
CRCOffC
IF SPXMove? OR SPYMove?
IF FeedConnect?
FeedC
ELSE
RapidC
END
SeqC MoveSXYC EOL
END
IF FeedEntry? AND NOT FeedConnect?
SeqC ZCP2C EOL
END
END
EntryMove
ToolPath
SeqC ExitMove EOL
NextRep
RETURN

LongDrillStuff:
{ Not supported }
RETURN

DrillStuff:
SeqC DrillCP EOL
GetCycle
SeqC Cycle FromCP StrtPos ZDepth RLevel Dwell Peck Retract FeedEnt EOL
TrackZNO# FIRST SPZ# {.81.2}
RETURN

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

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

OpGuts:
ResetCRCNum
RapidF# { No Output }
IF Milling?
SeqC ZCP2C EOL
IF AutoCycle?
CutAutoCycle
IF Repeats? AND FeedConnect?
ELSE
SeqC ExitMove2 EOL
END
SetPass1
ELSE { NOT AutoCycle }
IF Repeats? AND ZShiftOnly?
ZonlyRep
ELSE
Milling
END
SeqC CRCOffC ExitMove2 EOL
END
ELSE
IF Drilling?
DrillStuff
ToolPath
SetDrillEndOpZ
SeqC Rapid 'G80' ZCP3 EOL
END
END
Save# Num#('7') CSOffsetA# {Rotary absolute location}
Save# Num#('8') CSOffsetB# {Rotary absolute location}
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 }
SetFlag('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
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 Flag?('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
IF Equal? NumOfCS# Num#('1') { 3 Axis Part - Output M-Style }
SetFlagF('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
ELSE
IF MultipleParts?
IF WorkFixtureOffsets?
IF LTEqual? MUL# Parts# NumOfCS# Num#('6')
SetWFOCS { use WFO for CS changes }
ELSE
SetFlagF('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
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') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
'G52'
ELSE
'non-WFO'
END
' style output. )' EOL
END
END
ELSE
SetFlagF('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
END
ELSE
IF LTEqual? NumOfCS# Num#('6') {****}
SetWFOCS { use WFO for CS changes }
ELSE
SetFlagF('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
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') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
'G52'
ELSE
'non-WFO'
END
' style output. )' EOL
END
END
END
END
END
RETURN

InitOp:
EOR EOL
ProgID1
IF UseComments? AND ProgramNameComment?
'( PROGRAM: ' ProgramName$ ' )'
END
EOL
IF ToolChangeAtHome?
SetHome
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
RestoreScale
RETURN

FirstOp1:
SeqC Rapid AbsOrInc OfstOff 'H0' OpToolID EOL
SeqC Home 'S350' SpinOn EOL
SeqC SpinOff EOL
Seq OpToolID ToolChng EOL
DoPartCycleComment
DoOpComments
SeqC Plane CRCOff 'G80' EOL
DoPostScript
RETURN

FirstOp2:
SeqC WFOStuff EOL
G52Stuff
SeqC Speed SpinOn EOL
CheckPass
SeqC Rapid AbsOrInc StrtPos EOL
Save# Num#('9') CSOffsetA# {Rotary absolute location @ start}
Save# Num#('10') CSOffsetB# {Rotary absolute location @ start}
RETURN

FirstOp3:
SeqC OfstOn EOL
SeqC CoolOn PreTool EOL
RETURN

NewToolOp1:
SeqC CoolOff EOL
SeqC RapidC OfstOff 'H0' SpinOff EOL
RETURN

NewToolOp2:
DoEndOpPS
IF ToolChangeAtHome?
SeqC RapidC Home EOL
END
IF LAST ProgStop?
SeqC 'M0' EOL
ELSE
SeqC ProgStop EOL
END
RETURN

NewToolOp3: {Start new Operation}
Seq OpToolID ToolChng EOL
DoPartCycleComment
DoOpComments
SeqC Plane CRCOff 'G80' EOL
DoPostScript
RETURN

NewToolOp4:
SeqC WFOStuff EOL
G52Stuff
CheckPass
CSAngleAC CSAngleBC
SeqC Speed SpinOn EOL
SeqC Rapid AbsOrInc StrtPos EOL
RETURN

NewToolOp5:
SeqC OfstOn EOL
SeqC CoolOn PreTool EOL
RETURN

SameToolOp1:
DoEndOpPS
IF LAST ProgStop?
SeqC CoolOff EOL
SeqC RapidC OfstOff 'H0' SpinOff EOL
SeqC 'M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
IF NewToolOffset? OR ChangeCS?
SeqC RapidC OfstOff 'H0' SpinOff EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqC CoolOn EOL
END
END
RETURN

SameToolOp2: {Start new Operation}
DoPartCycleComment
DoOpComments
DoPostScript
CheckPass
RETURN

SameToolOp3: {Start new Operation}
SeqC WFOStuff EOL
G52Stuff
IF LAST ProgStop?
CSAngleAC CSAngleBC
SeqC Speed SpinOn EOL
SeqC Rapid PlaneC AbsOrInc StrtPos EOL
SeqC OfstOn EOL
SeqC CoolOn EOL
ELSE
IF NewToolOffset? OR ChangeCS?
CSAngleAC CSAngleBC
SeqC Speed SpinOn EOL
SeqC Rapid PlaneC AbsOrInc StrtPos EOL
SeqC OfstOn EOL
ELSE
SeqC Rapid PlaneC AbsOrInc StrtPos SpeedC EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqC CoolOn EOL
END
END
RETURN

End1:
SeqC CoolOff EOL
SeqC RapidC OfstOff 'H0' SpinOff EOL
RETURN

End2:
DoEndOpPS
{Moves rotary to starting location}
IF AAxisAvail? {Vertical Machine}
IF NOT Equal? Recall# Num#('7') Recall# Num#('9')
SeqC 'G53X-20.276' EOL {Move to rotary location}
SeqC 'M55' EOL {Unclamp rotary}
SeqC IncValue EOL {Switch to Incremental}
{ (Var#3 - Var#1) / 10 }
SeqC 'G60X' DIV# SUB# Recall# Num#('9') Recall# Num#('7') Num#('10') EOL
SeqC AbsValue EOL {Switch back to absolute}
SeqC 'M56' EOL {Clamp rotary}
END
END
IF BAxisAvail? {Horizontal Machine}
IF NOT Equal? Recall# Num#('8') Recall# Num#('10')
SeqC 'G53X-20.276' EOL {Move to rotary location}
SeqC 'M55' EOL {Unclamp rotary}
SeqC IncValue EOL {Switch to Incremental}
{ (Var#4 - Var#2) / 10 }
SeqC 'G60X' DIV# SUB# Recall# Num#('10') Recall# Num#('8') Num#('10') EOL
SeqC AbsValue EOL {Switch back to absolute}
SeqC 'M56' EOL {Clamp rotary}
END
END
IF FIRST ToolChangeAtHome? {added FIRST modifier}
SeqC RapidC AbsOrInc FirstHome 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 CoolOff EOL
SeqC IncValueC OfstOff 'H0' SpinOff 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
CSAngleAC CSAngleBC
SeqC Speed SpinOn EOL
SeqC PlaneC AbsOrInc Rapid StrtPos EOL
IF FullUp?
SeqC OfstOn EOL
SeqC 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 0M LH P&W [SP] CV84 16 3
Fanuc 0M LH [RI] MU55 16 1
Fanuc 0M LH NMU16 16
Fanuc 11M LH [RM] CU59 16 1
Fanuc 0M Tkswa [PP] CX06 16
Fanuc 0M LeBlond [WDI] BW11 16
Fanuc 0M Tkswa [PP] CX04 16
Fanuc 0M Supermax AM MQ49 16 1
Fanuc 0M LW LH [RI] CU58 16
Fanuc 0M [JS] NMQ10 16
Fanuc 0M [GRL] NMU94 16
Fanuc 0M [SP] M455 81 2
Fanuc 0M Mate BP [SSC] NMQ43 16
Fanuc 15M MTS [CP] NDU66 16 2m
Fanuc 0M Supermax [AM] MW17 89
Fanuc 0M Wasino WM3 M525 81 2

więcej podobnych podstron