Fanuc 11M LH [RM] CU59 16 1


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

{added separate sub call code and warning for not separate, 7/5/88 WFG}
{separate sub calls turned off in this post- 'UseSeparateSubCalls' commented out}
{ncPost3ż24 or better}
{added IF ToolChangeAtHome?, & SetHome 9/26/88 WFG}
{added PostScript commands 3/11/89 WFG}
{added PostScript command comments 5/9/89, WFG, use ncPost 3.10Ś9 or better}
{removed run time comments, 5/9/89, WFG}
{added "must be all capital letters when typed in" to Postscript Command comment, 5/17/89, JR}
{added metric, 6/5/89, WFG}
{suppressed first cycle StrtPos for sep subs,7/17/89 WFG}
{last tool now goes to FirstHome when finished, 7/26/89, WFG}
{changed to Sep Sub standard}
{.65, corrected Sep sub problem if 1st cut <> Z step, 9/14/89 WFG, requires ncPost 3.19Ś5}
{.66, added name comment to Prog ID # line, 10/30/89, WFG}
{.67, new prog commands, 11/20/89, WFG}
{*.68, AutoCycles and 3.2 support, 12/4/89, WFG (Good luck on the upgrades to other posts)}
{.69, corrected 2 repeat op/autocycle problems, 12/21/89, WFG}

{1/8/90-2/7/90
Changes to M001.69
Moved DoPostScript command to very beginning of NewTool & SameTool op's, same as FirstOp.
Deleted last line of NewWFO PostScript comment, it no longer applies.
Move DoEndOpPS command in NewTool & end of prog to end of operation outside of Full-up MP.
Restucture to have M01 or M00 in New Tool.
Deleted ProgStop? from end of prog, not neccesary.
Check for ProgStop at beginning AND end of operation does not work, it comes out both places,
only using for end of operation. Reflected in PSComments.
Deleted StopProg sub.
Re-wrote SameTool section for many reasons.
Deleted ClearancePlane3# prog format it is no longer needed.
New sub CheckPass to replace statement in main for SetPass.
Modified WFOStuff sub to include SameTool.
Deleted StrtPos from OpenMP sub and added to main where needed.
Updated to .70 format.
Jim Radcliffe}

{.71.1, added InitProg, 4/11/90, JR}
{.71.2, FIRST modifier, no CRCOffC in AutoCycCutSub2, add Connect for ZOnlyRep, 4/23/90, JR}
{.72.1, New PS subs, formats, CoolOff?, ProgStop to start of NewTool & SameTool, 5/23/90, JR}
{.72.2, modified subroutine stuff (same effect), 7/1/90, DWB}
{.73, Replaced SetSRXYZero with SetSRXYtoSP, CoolOff, new formaters, 7/24/90, DWB}
{.74, ResetCRCNum, modified PostScript comments, 8/1/90, JR}
{.76, corrected AutoCycle SP and EP Status Record errors}
{.76.2, removed beginning Op ProgStop capability and Get Coolant, 2/6/91, WFG}

{2/15/91,
Updated to new 4.0 Version Fanuc 6M M001.80:
Added Coolant checking for SameTool.
Added ProgStop checking for final Operation.
DWB}

{5/17/91, M001.80.01 added drill Z's, WFG}

{9/13/91,
Modified: Fanuc 6M M001.80.01
Added IF FIFO? for Milling.
Added TrackZNO# ZDepth# at IF Drilling? section to allow for conditionality of MoveSXYZC command.
DWB}

{7/24/92,
Modified: Fanuc 6M M001.81
Corrected FORMAT for Dwell# from '####^###;' to '####^##0'.
Moved UnSkipZ from FinishSub1 to ZOnlyRep where SkipZ is set.
Changed FeedRateC to FeedEntC to FIFO Exit Moves.
Added RestoreScale Sub per 4-Axis Post Processor.
DWB}

{6/8/93
Copied & modified: Fanuc 6M M001.81.2
For: Gibbs & Associates
As an updated processor for Fanuc 11M AS KM1800 M092.71
Put ToolChng on same line as OpToolID
Added Spaces between codes
Changed CoolOn to be an M7
Jim Radcliffe}

{31 Oct97
Original: Fanuc 11M AS KM1800 M092.81.2
Created: Fanuc 11M AS KM1800 B092.15
For: IC Enterprises
Changes made per: Rocky Levian
Deleted old version numbers and comments e.g. {.62}, {commands}, {literals}, etc
Updated to .89 and Created B style post per Fanuc 6M (FW) B001.15
Charles Winston}

{14Aug98
Original: Fanuc 11M AS KM1800 B092.15
Created: Fanuc 11M LH [RM] CU59.16
For: Rocon Mfg
Changes made per: Jeff Crews
Machines/Controls: Custmer is using this Generic Post with the following Machining centres:
Matsuura 600H Horizontal Pallet M/c, Yasnak MX3, Okuma Howa, Matsushita-Seiki 15M and others.
NEW POST: FIRST DRAFT
Custom post per Converstaions and Faxes from Jeff Crews.
Customised FirstOperation, NewTool, SameTool and NewPart
Customised Drill Cycles
Added Clamp and UnClamp Subs
Created C_Style .16 Advanced Mill Longhand Post per Fanuc 6M LH (PW) CV83ż2
Charles Winston}

{18Aug98
Original: Fanuc 11M LH [RM] CU59.16
Created: Fanuc 11M LH [RM] CU59.16.1
For: Rocon Mfg
Changes made per: Jeff Crews
Changed OffstOff to Literal 'G28 Z0' ( Customer did not want a decimal point after 'Z0' )
Added AbsOrInc in SameToolOp1
Deleted Spindle Off and C oolant Off with SameTool
Changed FORMAT#3 from '####0.0##;0.0' to '*####0.0##;0.0' Affects CSOffsetA#. Customer has his indexer setup to X-.
Charles Winston}

{Prog Numeric Format Definitions ****}

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

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(CalcZSurf#,4)
FORMAT(Recall#,5)
FORMAT(ADD#,5)
FORMAT(CS#,5)
FORMAT(PartNum#,5)
FORMAT(Program#,5)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(NewWFO#,5)
FORMAT(Parts#,5)
FORMAT(Dwell#,6)
FORMAT(RapidF#,7)

{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:
'( 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
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

Clamp:
IF AAxisAvail? OR BAxisAvail?
SeqC ' M21' EOL
END
RETURN

UnClamp:
IF AAxisAvail? OR BAxisAvail?
SeqC ' M22' EOL
END
RETURN

ClampC:
IF AChange? OR BChange?
Clamp
END
RETURN

UnClampC:
IF AChange? OR BChange?
UnClamp
END
RETURN

CSAngleA:
IF AAxisAvail?
IF Flag?('6') AND WFOCS? { TRUE = B-Style Output, FALSE = C-Style Output }
' A0.0'
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.0'
ELSE
' B' CSOffsetB#
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 }
FeedEnt
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
ArcRC
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:
SeqC DrillCP EOL
GetCycle
SeqC StrtPosC EOL
ToolPath
LoadFeat Num#('0') Num#('0') ClearancePlane3#
IF ZMove?
SeqC RapidC ZCP3C EOL
END
RETURN

DrillStuff:
GetCycle
SeqC Cycle StrtPos ZDepth
IF NOT FIRO?
RLevel
END
Dwell Peck Retract FeedEnt FromCP ' R' CalcZSurf# 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 DrillOff ZCP3 EOL
END
END
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?
'( ' 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 NOT IN SPINDLE )' EOL
END
END
RestoreScale
RETURN

FirstOp1:
Seq Plane DrillOff CRCOff Rapid EOL
SeqC IncValue ' G28 Z0 M19' EOL
SeqC ' G28 Y0' CoolOff EOL
SeqC ' G30 X0' EOL
SeqC ' G20' AbsOrInc EOL
SeqC ' ( Tool-Change ) M01' EOL
SeqC OpToolID ToolChng EOL
DoPartCycleComment
DoOpComments
DoPostScript
RETURN

FirstOp2:
G52Stuff
SeqC Speed SpinOn EOL
CheckPass
SeqC PreTool EOL
UnClamp
SeqC CSAngleA CSAngleB EOL
Clamp
SeqC AbsOrInc Rapid StrtPos WFOStuff EOL
RETURN

FirstOp3:
SeqC CoolOn EOL
SeqC OfstOn EOL
RETURN

NewToolOp1:
Seq DrillOff CRCOff Plane Rapid EOL
SeqC IncValueC ' G28 Z0 M19' EOL
SeqC ' G28 Y0' CoolOff EOL
SeqC ' G30 X0' EOL
RETURN

NewToolOp2:
DoEndOpPS
SeqC AbsOrInc EOL
IF ToolChangeAtHome?
SeqC Rapid Home EOL
END
IF LAST ProgStop?
SeqC ' M0' EOL
ELSE
SeqC ' ( Tool-Change ) M01' EOL
END
RETURN

NewToolOp3: {Start new Operation}
SeqC OpToolID ToolChng EOL
DoPartCycleComment
DoOpComments
DoPostScript
RETURN

NewToolOp4:
G52Stuff
SeqC Speed SpinOn EOL
CheckPass
SeqC PreTool EOL
UnClamp
SeqC CSAngleA CSAngleB EOL
Clamp
SeqC AbsOrInc Rapid StrtPos WFOStuff EOL
RETURN

NewToolOp5:
SeqC CoolOn EOL
SeqC OfstOn EOL
RETURN

SameToolOp1:
DoEndOpPS
IF LAST ProgStop?
Seq DrillOff CRCOff Plane Rapid EOL
SeqC IncValueC ' G28 Z0 M19' EOL
SeqC ' G28 Y0' CoolOff EOL
SeqC ' G30 X0' EOL
SeqC AbsOrInc EOL
SeqC SpinOff EOL
SeqC ' M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
IF NewToolOffset? OR AChange? OR BChange?
SeqC IncValueC ' G28 Z0' EOL
SeqC ' G28 Y0' EOL
SeqC ' G30 X0' EOL
SeqC AbsOrInc EOL
END
END
RETURN

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

SameToolOp3: {Start new Operation}
G52Stuff
IF LAST ProgStop?
UnClamp
SeqC CSAngleA CSAngleB EOL
Clamp
SeqC Plane AbsOrInc Rapid StrtPos WFOStuff SpeedC SpinOn EOL
SeqC OfstOn EOL
SeqC CoolOn EOL
ELSE
IF AChange? OR BChange?
UnClamp
SeqC CSAngleA CSAngleB EOL
Clamp
END
SeqC PlaneC AbsOrInc Rapid StrtPos WFOStuff SpeedC EOL
IF NewToolOffset? OR AChange? OR BChange?
SeqC OfstOn EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqC CoolOn EOL
END
END
RETURN

End1:
Seq DrillOff CRCOff Plane Rapid EOL
SeqC IncValueC ' G28 Z0 M19' EOL
SeqC ' G28 Y0' CoolOff EOL
SeqC ' G30 X0' EOL
SeqC AbsOrInc EOL
RETURN

End2:
DoEndOpPS
IF FIRST ToolChangeAtHome? {added FIRST modifier}
SeqC AbsOrIncC Rapid PRIME 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?
Seq DrillOff CRCOff Plane Rapid EOL
SeqC IncValueC ' G28 Z0 M19' EOL
SeqC ' G28 Y0' CoolOff EOL
SeqC ' G30 X0' 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 }
G52Stuff
IF AChange? OR BChange?
UnClamp
SeqC CSAngleA CSAngleB EOL
Clamp
END
SeqC PlaneC AbsOrInc Rapid StrtPos WFOStuff Speed 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 11M Tyd [CGB] CT37 16 4
Fanuc 11M Mat [AM] C820 16
Fanuc 11M MS [EE] NMT57 16 2
Fanuc 0M LH [RI] MU55 16 1
Fanuc 11M MS [EE] NMT57 16 2m
Fanuc 0M LH K&T [SP] CV95 16 1
Fanuc 11M LH [JBT] DW53 15
Fanuc 11M LH [JBT] DW53 15
Fanuc 11M Mazak [PSI] CT77 16
Fanuc 11M [TM] CQ07 16 2
Fanuc 11M MTS LH M059 13 1
Fanuc 0M LW LH [RI] CU58 16
Fanuc 11M D007 16
Fanuc 11M B007 16
Fanuc 11M Demo LH [TI] MU21 89
Fanuc 11M [BC] MT27 16 1
Fanuc 11M C007 16
Fanuc 0M LH NMU16 16

więcej podobnych podstron