Fanuc 0M Chiron M524 87


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

{10/20/92,
Copied & modified: Fanuc 0M M062.81.2
For: Superior Screw Products
Machine: Chiron
Control: Fanuc 0M
Added full support for WorkFixtureOffsets.
Deleted colon from all comments.
Added M11/M10 [ Open/Close ] Clamping Device for Rotary Axis.
Added ResetCRCNum at ToolPath.
Added CheckFIFO sub to output M19 [ Spindle Key Lock ] for Drilling FIFO type Operations.
Added SpinOff for SameTool Drilling FIFO type Operations at GetStartOfSameTool.
Added DoSpeed, DoSpeedC and DoSpinOn subs to suppress Speed SpinOn commands for Drilling FIFO
type Operations.
Added PreTool at FirstOperation and NewTool.
Added M29 [ Rigid Tap Cycle ] at IF Drilling.
Added G74 [ Left Hand Tap Cycle ] at IF Drilling.
DWB}

{4/1/93,
Modified: Fanuc 0M Chiron M524.81.2
For: Superior Screw Products
Changes made per Jeff Gens at Superior Screw Products.
HERE GOES!!!
Updated to Version 4.1 per Fanuc 6M M001.81.2 Format.
Changed all FORMATting of ';0.' to ';0'.
Added Tag# to FORMAT(5) '#######0'.
Tag# is initialized, incremented and output at OpenWFOIndex.
Added CallMasterNum# to FORMAT(5) '#######0'.
CallMasterNum# is output at CMOPOn sub.
Added Recall# to FORMAT(7) '0000'.
Recall# is output at OpenWFOIndex, CheckPallet AND CMOPOn subs.
Changed ProgID1 to ':' Program# at FirstOperation.
Added literal 'G20', Inch Mode at FirstOperation.
Moved safe start block to before MultipleParts AllToolsOnePart at FirstOperation.
Changed Plane to PlaneC at NewTool.
Deleted 'G80' CRCOffC at NewTool.
Added Rapid 'G49G54' AbsOrInc 'G94Z0' to safe start block at FirstOperation.
Added literal 'G54X0Y0' at FirstOperation.
Added literal 'M92', WorkHolder Loaded Scanner, at FirstOperation.
Moved call to DoPostScript to before MultipleParts AllToolsOnePart at FirstOperation.
Moved call to DoPostScript to before DoOpComments at NewTool.
Deleted PreTool at FirstOperation AND NewTool.
Suppressing WFOStuff at FirstOperation unless NewWFO, Pallet OR Rotate PostScript commands exist.
Deleted DoSpeed, DoSpeedC and DoSpinOn subs.
Deleted call to DoSpeed and DoSpinOn subs at FirstOperation AND NewTool.
Added Speed SpinOn at StrtPos block at FirstOperation AND NewTool.
Changed DoSpeedC DoSpinOn to SpeedC SpinOn at SameTool.
Moved call to DoOpComments prior to call to CheckFIFO sub at FirstOperation AND NewTool.
Changed all occurances of Rapid/Feed/Connect AbsOrInc to AbsOrInc Rapid/Feed/Connect.
Moved CoolOn to OfstOn block at FirstOperation, NewTool AND SameTool.
Moved CoolOff to IncValue OfstOff block at NewTool, SameTool AND end of Prog.
Added Rapid to IncValue OfstOff block at NewTool, SameTool AND end of Prog.
Added literal 'G54' to IncValue OfstOff block for Non MultipleParts AllToolsOnePart programs at
NewTool, SameTool AND end of Prog.
Moved IncValue OfstOff block to after MultipleParts OneToolAllParts FullUp at NewTool.
Changed IncValue OfstOff to literal 'G49Z0' at NewTool, SameTool AND end of Prog.
Deleted SpinOff for NOT ToolChangeAtHome at NewTool AND end of Prog.
Deleted SpinOff for LAST ProgStop at SameTool.
Deleted StrtPos from Canned Drill Cycle block at Drilling.
Changed literal 'M29' to 'M84' for Rigid Tapping at Drilling.
Jeff reported a bug with CWSpindle boolean.
Switched output of 'G74' and Cycle command based on CWSpindle boolean.
Added literal 'M95', SpinOff CoolOff for Tapping at 'G80' block at Drilling.
Changed all occurances of literal 'M98' to SubCall.
Moved all occurances of SubCall to follow Program# on same block.
Changed all occurances of 'P1' Program# to CallLab.
Changed all occurances of SubID to ':' Program#.
Added EOR between all subs.
Added Var(0).
Initially stored with Program# at setup and initializations.
Incremented at NumZeroInc sub.
Output at OpenWFOIndex sub IF Flag(4) is Set.
Output at CheckPallet sub IF Flag(2) is Set.
Added Flags(1-4).
Flag(1) is First Pallet Output.
Set FALSE at setup and initializations.
Set TRUE at PSStuff IF PalletIn = TRUE and Flag(1) is NOT Set.
Set FALSE at PSStuff IF PalletIn = TRUE and Flag(1) and Flag(2) are set.
Tested at CheckWFOIndex, PSStuff and WFOStuff subs.
Flag(2) is Second Pallet Needed.
Set FALSE at setup and initializations.
Set TRUE at PSStuff IF PalletIn = TRUE and Flag(1) is set.
Tested at CheckPallet and PSStuff subs.
Flag(3) is Pallet FourthAxis.
Set FALSE at setup and initializations.
Set TRUE at GetRotate IF FourthCW OR FourthCCW = TRUE.
Tested at CheckWFOIndex, FourthAxis, CheckMOPOn, CheckMOPOff, DoPostScript, WFOStuff, CMOPOn and
PSStuff subs and twice at end of Prog.
Flag(4) is Second Pallet Output.
Set FALSE at setup and initializations.
Set TRUE at CheckPallet sub IF Flag(2) is set.
Tested at OpenWFOIndex and FourthAxis subs.
Modified support of PostScript Rotate commands, specifically FourthAxis.
Purpose is to output Program to a SubProgram same as MultipleParts.
Non-MultiplePart Programs:
PSStuff calls GetRotate.
GetRotate contains Rotate booleans from PSStuff.
FourthCW and FourthCCW calls up FourthAxis.
FourthAxis tests Flag(3) and FlagF(4) and calls CloseWFOIndex for NewTool Operations.
CloseWFOIndex Closes SubProgam.
Changed 'M11' 'A' FourthDegree# 'M10' to 'M12' at FourthAxis.
Changed PostScript Comments for 4thAxisCW and 4thAxisCCW.
FourthAxis outputs ( Indexer at FourthDegree#Ą ) IF UseComments = TRUE.
No change to FifthCW OR FifthCCW.
GetRotate then Sets Flag(3) for both FourthCW OR FourthCCW.
DoPostScript then calls OpenWFOIndex IF FirstOperation OR NewTool = TRUE.
OpenWFOIndex executes TagInit followed by TagInc followed by an EachPart/NextPart loop.
Within this loop, TagInc is executed followed by:
'G10' AbsOrInc 'L2P' Tag# 'X0Y0Z0'.
FIRST value output of Tag# should always start at 2.
OpenWFOIndex sub then tests Flag(4), Second Pallet.
Flag(4) outputs 'P' Var(0) 'M98' followed by call to NumZeroInc.
FlagF(4) executes NewProg, outputs CallLab SubCall, executes OpenSub, outputs EOR,
outputs ':' Program# and calls DoSubComment.
NewTool calls CheckWFOIndex.
CheckWFOIndex tests for Flag(1) AND Flag(3), and calls CloseWFOIndex IF NOT CallMasterOp.
CheckWFOIndex is also called at end of Prog.
Flag(3) is tested at end of Prog and calls CloseWFOIndex.
EOP is then output at end of Prog.
MultiplePart WorkFixtureOffsets OneToolAllParts Programs:
Same as Non-MultiplePart Programs.
MultiplePart AllToolsOnePart Programs:
Same as Non-MultiplePart Programs except:
FirstOperation calls GetRotate after OpenMP, PSStuff only calls GetRotate for NewTool.
FirstOperation calls OpenWFOIndex after GetRotate, DoPostScript only calls OpenWFOIndex for
NewTool IF Flag(3) is Set.
Added support of PostScript MasterOp and CallMasterOp commands.
Purpose is to output Program to a SubProgram same as MultipleParts OneToolAllParts.
EachTool is output to seperate SubProgram.
MasterOp:
MasterOpF is Set at PSInit AND ClearPS subs.
FirstOperation AND SameTool calls CheckMOPOn.
NewTool calls CheckMOPOn IF NOT CallMasterOp.
CheckMOPOn calls MOPOn IF Flag(3) is Set AND MultipleParts AND AllToolsOnePart = TRUE.
CheckMOPOn calls MOPOn IF Flag(3) is NOT Set.
MOPOn executes NewProg, outputs CallLab SubCall, executes OpenSub, outputs EOR,
outputs ':' Program# and calls DoSubComment.
NewTool and end of Prog calls CheckMOPOff.
SameTool calls CheckMOPOff IF NOT CallMasterOp.
CheckMOPOff calls MOPOff IF MasterOp = TRUE AND Flag(3) is Set AND
MultipleParts AND AllToolsOnePart = TRUE.
CheckMOPOff calls MOPOff IF MasterOp = TRUE AND Flag(3) is NOT Set.
MOPOff Closes SubProgam.
Saves Var(Operation#) Program# at common point.
CallMasterOp:
CallMasterOpF is Set at DoPostScript sub for NewTool Operations.
CallMasterOpF is Set at ClearPS sub.
CheckWFOIndex will NOT call CloseWFOIndex IF CallMasterOp = TRUE.
OpenMP AND CloseMP subs are suppressed IF CallMasterOp = TRUE
NewTool calls CMOPOn.
CMOPOn outpus SeqC SetWFO 'P' Recall# CallMasterNum# SubCall EOL
SameTool, Milling and Drilling are suppressed IF CallMasterOp = TRUE
Added support of PostScript Pallet commands.
Purpose is to call all SubPrograms for second Pallet.
PalletInF is Set at PSStuff sub IF PalletIn = TRUE.
PalletIn is tested at PSStuff sub.
Added DoPallet sub, called at PSStuff IF Flag(1) is NOT Set.
DoPallet sub outputs M31 M61 M31 M111 IF Pallet# = Num(1).
DoPallet sub outputs M32 M62 M32 M211 IF Pallet# = Num(2).
Added CheckPallet sub, called at end of Prog IF Flag(3) is Set.
CheckPallet sub tests Falg(2)
IF Flag(2) is Set:
Flag(4) is Set, followed by EachOp/NextOp loop.
IF MultipleParts? AND AllToolsOnePart AND WorkFixtureOffsets = TRUE:
Executes PostScript followed by call to DoPallet and NumZeroInc subs.
This is followed by EachWFO/NextWFO loop.
Inside this loop, IncWFO is followed by SeqC SetWFO 'P' Recall# Num#('0') SubCall EOL
IF MultipleParts? AND AllToolsOnePart AND WorkFixtureOffsets = FALSE:
EachOp will call NumZeroInc IF CallMasterOp = FALSE.
EachOp will call NumZeroInc IF Repeats = FALSE.
EachOp will call NumZeroInc IF AutoCycle = FALSE.
Added call to ClearPS sub at end of Prog.
Resets all PostScript Flags
DWB}

{7/20/93,
Modified: Fanuc 0M Chiron M524.81.2ż1
For: Superior Screw Products
Changes made per Jeff Gens at Superior Screw Products.
Changed FORMAT for G and M addresses from '#0' to '00' in Mach Specs General FORMATs Dialog.
Changed literal 'M111' to 'M112' at DoPallet sub.
Changed literal 'M211' to 'M212' at DoPallet sub.
Added literal 'M12' at DoPallet sub.
Added literal 'G04P3000' at DoPallet sub.
Added DoSpeed and DoSpeedC subs back in.
This is for special handling of Rigid Tapping.
IF Drilling AND Tap = TRUE will output MUL# SpeedRPM# Num#(2)
All other Operations will output normally.
Added MUL# to FORMAT(5) '#######0'.
Added condition to satisfy SetMaxRPM(10000).
Changed End Of Program from 'M30' to 'M99' in Mach Specs Commands 4 Dialog.
Added ASCII(13) at all occurances of EOR EOL except at FirstOperation and end of Prog.
Added PostScript Comments for Fourth Axis, Pallet and MasterOp.
Added call to ClearPS sub at setup and initializations.
Resets all PostScript Flags
Changed RapidC ZCP3C to Rapid ZCP3 at IF Drilling.
Added literal 'X0Y0' for NOT ToolChangeAtHome at end of Prog.
Deleted literal 'G54' at 'X0Y0' block at FirstOperation.
Added Var(1) to Initialize Current Pallet Index Position.
Initially stored with Num#('0') at setup and initializations.
Stored with FourthDegree# at GetRotate sub.
Tested at CheckPallet sub.
DWB}

{2/9/96, Updated .81 version to .84, MPK}

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

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

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(ToolDiameter#,4) {.72}
FORMAT(MUL#,5)
FORMAT(Operation#,5) {.72}
FORMAT(Tool#,5) {.72}
FORMAT(NewWFO#,5) {.72}
FORMAT(Repeats#,5)
FORMAT(Parts#,5) {.72}
FORMAT(Tag#,5)
FORMAT(CallMasterNum#,5)
FORMAT(Dwell#,6) {.72}
FORMAT(Program#,7) {.72}
FORMAT(Recall#,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

DoSubComment:
IF UseComments? AND SubComment?
FORMAT(Program#,5)
'( SUB NUMBER ' Program# ' )' EOL
FORMAT(Program#,7)
END
RETURN

DoOpComments:
IF UseComments?
SetScale('1')
IF OperationIDComment?
'( OPERATION ' Operation# ' ' OperationType$ ' )' EOL
END
IF OperationComment?
'( ' OperationComment$ ' )' EOL
END
IF WorkGroupComment?
'( ' WorkGroupComment$ ' )' EOL
END
IF ToolTypeComment?
'( TOOL ' Tool# ' ' ToolDiameter# ' ' ToolType$ ' )' EOL
END
IF ToolComment?
'( ' ToolComment$ ' )' EOL
END
RestoreScale
END
RETURN

DoPallet:
IF Equal? Pallet# Num#('1')
SeqC 'M31' EOL
SeqC 'M61' EOL
SeqC 'M31' EOL
SeqC 'M112' EOL
END
IF Equal? Pallet# Num#('2')
SeqC 'M32' EOL
SeqC 'M62' EOL
SeqC 'M32' EOL
SeqC 'M212' EOL
END
SeqC 'M12' EOL
SeqC 'G04P3000' EOL
RETURN

NumZeroInc:
Save# Num#('0') ADD# Recall# Num#('0') Num#('1')
RETURN

OpenWFOIndex:
TagInit
TagInc
EachPart
TagInc
SeqC 'G10' AbsOrInc 'L2P' Tag# 'X0Y0Z0' EOL
NextPart
IF Flag?('4')
SeqC 'P' Recall# Num#('0') SubCall EOL
NumZeroInc
ELSE
NewProg
SeqC CallLab SubCall EOL
OpenSub
EOR ASCII('13') EOL
':' Program# EOL
DoSubComment
END
RETURN

CloseWFOIndex:
SeqC EndSub EOL
CloseSub
RETURN

CheckWFOIndex:
IF Flag?('1')
IF Flag?('3')
IF NOT MultipleParts?
IF NOT CallMasterOp?
CloseWFOIndex
END
END
END
END
RETURN

FourthAxis:
IF NewTool? AND Flag?('3')
IF NOT Flag?('4')
CloseWFOIndex
END
END
SeqC 'M12'
IF UseComments?
' ( Indexer at ' FourthDegree# 'Ą )'
END
EOL
RETURN

GetRotate:
IF FourthCW?
FORMAT(FourthDegree#,2)
FourthAxis
FourthCWF {reset flag}
SetFlag('3')
Save# Num#('1') FourthDegree#
END
IF FourthCCW?
FORMAT(FourthDegree#,3)
FourthAxis
FourthCCWF {reset flag}
SetFlag('3')
Save# Num#('1') FourthDegree#
END
IF FifthCW?
FORMAT(FifthDegree#,2)
SeqC 'M11' EOL
SeqC 'B' FifthDegree# EOL
SeqC 'M10' EOL
FifthCWF {reset flag}
END
IF FifthCCW?
FORMAT(FifthDegree#,3)
SeqC 'M11' EOL
SeqC 'B' FifthDegree# EOL
SeqC 'M10' EOL
FifthCCWF {reset flag}
END
RETURN

MOPOn:
NewProg
SeqC CallLab SubCall EOL
OpenSub
EOR ASCII('13') EOL
':' Program# EOL
DoSubComment
RETURN

MOPOff:
SeqC EndSub EOL
CloseSub
RETURN

CheckMOPOn:
IF MasterOp?
IF Flag?('3')
IF MultipleParts? AND AllToolsOnePart?
MOPOn
END
ELSE
MOPOn
END
END
RETURN

CheckMOPOff:
IF MasterOp?
IF Flag?('3')
IF MultipleParts? AND AllToolsOnePart?
MOPOff
END
ELSE
MOPOff
END
END
RETURN

ClearPS:
NewWFOF
RotateF
MasterOpF
CallMasterOpF
FourthCWF
FourthCCWF
FifthCWF
FifthCCWF
RETURN

PSInit: {reset flags}
NewWFOF
RotateF
MasterOpF
RETURN

PSStuff: {revised.72}
IF PalletIn?
IF Flag?('1')
IF Flag?('2')
SetFlagF('1')
END
SetFlag('2')
ELSE
SetFlag('1')
DoPallet
END
PalletInF
END
IF Rotate?
IF MultipleParts?
IF WorkFixtureOffsets?
IF OneToolAllParts?
GetRotate
ELSE
IF NewTool?
GetRotate
END
END
END
ELSE
GetRotate
END
END
RETURN

DoPostScript:
PSInit
IF NewTool? AND CallMasterOp?
CallMasterOpF
END
EachPS
SeqC PostScript EOL {literals}
PSStuff {commands}
NextPS
IF Rotate?
IF FirstOperation? OR NewTool?
IF Flag?('3')
OpenWFOIndex
END
END
END
RETURN

DoEndOpPS:
PSInit
EachEOPS
SeqC EndOpPS EOL {literals}
PSStuff {commands}
NextPS
RETURN

CheckPallet:
IF Flag?('2')
SetFlag('4')
IF NotEqual? Recall# Num#('1') Num#('0') { Restore 1st Pallet Index Position to Zero }
SeqC 'M12'
IF UseComments?
' ( Indexer at 0Ą )'
END
EOL
Save# Num#('1') Num#('0')
END
EachOp
IF MultipleParts? AND AllToolsOnePart? AND WorkFixtureOffsets?
IF FirstOperation?
PSInit
EachPS
SeqC PostScript EOL {literals}
NextPS
DoPallet
NumZeroInc
NewWFO
EachWFO
IncWFO
SeqC SetWFO 'P' Recall# Num#('0') SubCall EOL
NextWFO
END
ELSE
IF NOT CallMasterOp?
NumZeroInc
END
DoPostScript
IF Repeats?
NumZeroInc
END
IF AutoCycle?
NumZeroInc
END
END
NextOp
IF NotEqual? Recall# Num#('1') Num#('0') { Restore 2nd Pallet Index Position to Zero }
SeqC 'M12'
IF UseComments?
' ( Indexer at 0Ą )'
END
EOL
Save# Num#('1') Num#('0')
END
END
RETURN

EntryMove:
IF FeedEntry?
SeqC Feed ZIn FeedEnt EOL
ELSE
SeqC RapidC ZIn EOL
END
RETURN

StartSub:
OpenSub
EOR ASCII('13') EOL
':' Program# EOL
DoSubComment
RETURN

SubWarning:
IF NOT FeedConnect?
IF AnyZshift?
' ' EOL
'( WARNING Z CLEARANCE WILL CHANGE WITH EACH CYCLE OF SUB REPEAT )' EOL
' ' EOL
END
END
RETURN

StdSub:
SeqC 'P' Repeats# Program# SubCall EOL
StartSub
RETURN

FinishSub1: {part 1}
SeqC CRCOffC
IF NOT FeedConnect?
IF AutoCycle?
ZCP3C
ELSE
IF FIFO? {.81}
FeedC ZCP3C FeedEntC
ELSE
RapidC ZCP3C
END
END
END
EOL
RETURN

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

OpenMP:
IF NOT CallMasterOp?
NewProg
IF WorkFixtureOffsets?
NewWFO
EachWFO
IncWFO
SeqC SetWFO CallLab SubCall EOL
NextWFO
ELSE
SeqC 'P' Parts# Program# SubCall EOL
END
StartSub
END
RETURN

CloseMP:
IF NOT CallMasterOp?
IF WorkFixtureOffsets?
SeqC EndSub EOL
CloseSub
ELSE
SeqC Preset ShiftPC EOL
SeqC EndSub EOL
CloseSub
SeqC Preset UnshftPC EOL
END
END
RETURN

FormatArc:
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
MoveXYZC
IF ArcIJFormat?
ArcIJC
ELSE
ArcRC
END
RETURN

StdLine: {enables CRC on first call, .70}
IF Decelerate?
IF RoomToDecel?
DecelMove1
SeqC CRCOnC FeedC MoveXYZC FeedRateC CRCOffsetC EOL
DecelMove2
END
SeqC CRCOnC FeedC MoveXYZC DecelFeed CRCOffsetC EOL
ELSE
IF XMove? OR YMove? OR ZMove?
SeqC CRCOnC FeedC MoveXYZC FeedRateC CRCOffsetC EOL
END
END
RETURN

ToolPath:
ResetCRCNum {.72}
EACHFeat
IF PointFeat?
IF AutoCycle?
SeqC MoveSXYC EOL
SeqC CallLab SubCall EOL
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
ELSE
SeqC MoveSXYZC EOL {.80.01}
END
ELSE
IF RapidFeat?
IF LastFeat? AND AutoCycle? {.70}
SeqC CRCOffC RapidC MoveXYZC EOL
ELSE
IF XMove? OR YMove? OR ZMove?
SeqC RapidC MoveXYZC EOL
END
END
ELSE
IF LineFeat?
IF AutoCycle? {.70}
IF LastFeat?
SeqC CRCOffC FeedC MoveXYZC FeedRateC EOL
ELSE
IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps}
SeqC FeedC MoveXYZC FeedRateC EOL
ELSE
StdLine {enables CRC on first call}
END
END
ELSE
StdLine
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

WFOStuff:
IF NewWFO?
IF MultipleParts?
'*** WARNING *** DO NOT USE NEWWFO() WITH NCPOST MULTIPLE PARTS' EOL
ELSE
SeqC 'G' NewWFO# EOL
END
ELSE
IF Flag?('1')
IF Flag?('3')
IF NOT MultipleParts?
IF NOT CallMasterOp?
NewProg
SeqC 'G55' CallLab SubCall EOL
OpenSub
EOR ASCII('13') EOL
':' Program# EOL
DoSubComment
END
END
END
ELSE
IF NOT FirstOperation?
IF NewTool?
IF NeedWFO1?
SeqC 'G' NewWFO# EOL
END
ELSE { SameTool }
IF NotEqual? NewWFO# Num#('54')
IF LAST ProgStop?
SeqC 'G' NewWFO# EOL
ELSE
IF NewToolOffset?
SeqC 'G' NewWFO# EOL
END
END
END
END
END
END
END
RETURN

AutoCycCutSub1: {part 1}
SaveSubStatus {save tool position}
SetPass1 {element cut moves}
StartSub
SetSRXYtoSP
Seq IncValue EOL
RETURN

AutoCycCutSub2: {part 2}
ToolPath
SeqC
IF Repeats? AND FeedConnect? AND ZshiftOnly?
AbsOrInc {.69 removed RapidC} {.71.2 removed CRCOffC, gets turned off in ToolPath}
ELSE
IF FIFO? {.81}
FeedC AbsOrInc ZCP2 FeedEntC
ELSE
RapidC AbsOrInc ZCP2
END
END
EOL
SeqC EndSub EOL
CloseSub
SetSRSubXY {restore SR to 1st position value}
SetSRSubMove
RETURN

AutoCycPat:
SetPass2 {position pattern}
ToolPath {call after NewProg for correct sub calls}
SetPass1 {reset}
RETURN

Milling:
IF AutoCycle?
NewProg
AutoCycCutSub1
EntryMove
AutoCycCutSub2
AutoCycPat
ELSE
EntryMove
ToolPath
END
RETURN

G92Sub:
SubWarning
StdSub
SeqC Connect AbsOrInc StrtPos EOL
Milling
FinishSub1
FinishSubG92
RETURN

ZonlyRepAutoCycle:
AutoCycPat {write pattern moves and main calls}
StartSub
NewProg
EachCycle
SetSRXYtoEP
IF FeedConnect?
IF NOT FirstCycle?
IF SPXMove? OR SPYMove?
SeqC Feed IncValue StrtPosC EOL
SeqC AbsOrInc
ELSE
SeqC Feed
END
ELSE
SeqC Feed
END
ZInPlusInc FeedEnt EOL
ELSE
IF NOT FirstCycle?
IF SPXMove? OR SPYMove?
SeqC Rapid IncValue StrtPosC EOL
IF FeedEntry?
SeqC AbsOrInc ZCP2PlusInc EOL
SeqC Feed ZInPlusInc FeedEnt EOL
ELSE
SeqC AbsOrInc ZInPlusInc EOL
END
ELSE
IF FeedEntry?
SeqC Rapid ZCP2PlusInc EOL
SeqC Feed ZInPlusInc FeedEnt EOL
ELSE
SeqC Rapid ZInPlusInc EOL
END
END
ELSE
IF FeedEntry?
SeqC Feed ZInPlusInc FeedEnt EOL
ELSE
SeqC Rapid ZInPlusInc EOL
END
END
END
IF FirstCycle?
SetStatusOff {protect Z position for incremental sub}
END
SeqC CallLab SubCall EOL
NextCycle
SetStatusOn
AutoCycCutSub1 {build element sub}
AutoCycCutSub2
{.69, removed FinishSub1}
IF FeedConnect? {there is no Z up in the sub, .69}
IF FIFO? {.81}
SeqC Feed ZCP2 FeedEnt EOL {.69}
ELSE
SeqC Rapid ZCP2 EOL {.69}
END
END {.69}
SeqC EndSub EOL
CloseSub
{Element shift, not pattern}
RETURN

ZonlyRep:
EachCycle
IF NOT FirstCycle?
SeqC Connect StrtPos EOL {.71.2, added Connect}
END
IF FeedConnect?
SeqC FeedC ZInPlusInc FeedEnt EOL {.71.2, changed to FeedC}
ELSE {Entry/Exit Connect}
IF FeedEntry?
IF NOT FirstCycle?
SeqC RapidC ZCP2PlusIncC EOL {can't call for cycle =1} {.69 added Rapid, reads better} {.71.2, changed to RapidC, reads better}
END
SeqC Feed ZInPlusInc FeedEnt EOL
ELSE
SeqC RapidC ZInPlusInc EOL {.69 added Rapid, reads better} {.71.2, changed to RapidC, reads better}
END
END
SeqC CallLab SubCall EOL
NextCycle
StartSub
SkipZ
ToolPath
UnSkipZ { Moved from FinishSub1 }
FinishSub1
SeqC EndSub EOL
CloseSub
RETURN

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

DoSpeed:
IF Drilling? AND Tap?
IF GTEqual? SpeedRPM# Num#('5000')
'S10000'
ELSE
'S' MUL# SpeedRPM# Num#('2')
END
ELSE
Speed
END
RETURN

DoSpeedC:
IF Drilling? AND Tap?
DoSpeed
ELSE
SpeedC
END
RETURN

CMOPOn:
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CheckPass
SeqC Rapid AbsOrInc StrtPos DoSpeed SpinOn EOL
SeqC OfstOn CoolOn EOL
END
IF MultipleParts? AND AllToolsOnePart?
SeqC 'P' Recall# CallMasterNum# SubCall EOL
ELSE
IF Flag?('3')
NewWFO
EachWFO
IncWFO
SeqC SetWFO 'P' Recall# CallMasterNum# SubCall EOL
NextWFO
ELSE
SeqC 'P' Recall# CallMasterNum# SubCall EOL
END
END
RETURN

CheckFIFO:
IF Drilling?
GetCycle
IF FIFO?
SeqC 'M19' EOL { Spindle Key Lock }
END
END
RETURN

GetStartOfSameTool:
IF LAST NOT ProgStop?
IF Drilling?
GetCycle
IF FIFO?
SeqC SpinOff EOL
END
END
END
DoPostScript
DoOpComments
WFOStuff
CheckPass
CheckFIFO
CheckMOPOn
RETURN

{Start of executable Prog **************************************************}

{setup and initializations}
InitProg
ReverseXZArcs
InitWFONum
SetFlood
UseSeparateSubCalls
SetMaxSeparateSubCalls('50')
SetMaxRPM('10000')
SetMaxFeed('500')
Save# Num#('0') Program#
Save# Num#('1') Num#('0') { Initialize Current Pallet Index Position }
SetFlagF('1') { First Pallet Output }
SetFlagF('2') { Second Pallet Needed }
SetFlagF('3') { Pallet FourthAxis }
SetFlagF('4') { Second Pallet Output }
ClearPS
IF PSComment? AND UseComments?
'PostScript:' 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
' EndOP -' EOL
' all literals and commands before an ENDOP command' EOL
' will appear at the beginning of the operation. All ' EOL
' literals and commands after an ENDOP command will appear' EOL
' at the end of the operation. ' EOL
' NewWFO(56), NWFO(56) -' EOL
' The Work Fixture Offset # you specify will be used for all following operations.' EOL
' Do not use with the ncPost multiple part option.' EOL
' 4thAxisCW(12.5), 4ACW(12.5) -' EOL
' refer Superior Products V-331-1-P.' EOL
' Used for Pallet Indexing' EOL
' ouputs M12 ( INDEXER AT 12.5Ą ).' EOL
' The comment can be suppressed by turning off Comments in ncPost.' EOL
' 4thAxisCCW(22.5), 4ACCW(22.5) -' EOL
' refer Superior Products V-331-1-P.' EOL
' Used for Pallet Indexing' EOL
' ouputs M12 ( INDEXER AT -22.5Ą ).' EOL
' The comment can be suppressed by turning off Comments in ncPost.' EOL
' 5thAxisCW(30), 5ACW(30) -' EOL
' ouputs an M11 then' EOL
' generates a + B move of the value you specify' EOL
' then ouputs an M10' EOL
' 5thAxisCCW(22.5), 5ACCW(22.5) -' EOL
' ouputs an M11 then' EOL
' generates a - B move of the value you specify' EOL
' then ouputs an M10' EOL
' PalletIn(1), PIN(1) -' EOL
' PalletIn(2), PIN(2) -' EOL
' refer Superior Products V-331-1-P.' EOL
' Occurs prior to 4thAxisCW or 4thAxisCCW' EOL
' Outputs following:' EOL
' n = PalletIn Argument' EOL
' p = Work Fixture Number' EOL
' M3n' EOL
' M6n' EOL
' M3n' EOL
' Mn12' EOL
' M12' EOL
' G04P3000' EOL
' This will be followed by M12, output due to 4thAxisCW or 4thAxisCCW PostScript.' EOL
' commands.' EOL
' G10G90L2PpX0Y0Z0' EOL
' Multiple Parts will increment p and output G10 block for each part.' EOL
' This will be followed by M98 call to the next available subroutine.' EOL
' The balance of the output up to the Return From Sub code, M99, will be' EOL
' output to the called subroutine.' EOL
' The G10 and M98 blocks will be output again for any 4thAxisCW or.' EOL
' 4thAxisCCW PostScript commands after the First Operation.' EOL
' If 4thAxisCW Argument does not equal Zero at the end of the final Operation,' EOL
' the Post Processor will force an additional M12 for each Pallet to return to Zero.' EOL
' MasterOp(1), MOP(1) -' EOL
' CallMasterOp(1), CMOP(1) -' EOL
' refer Superior Products V-331-1-P.' EOL
' MasterOp command is used for storing operation output to a subroutine to be called' EOL
' by later Operations containing CallMasterOp PostScript command' EOL
' Example: A Drilling Pattern that can be called for Center or Spot Drilling,' EOL
' Peck Drilling, Boring and Tapping, without outputting the path for each Operation.' EOL
' Recommended usage, use MasterOp for First Drilling Operation process.' EOL
' Each additional Operation should contain CallMasterOp. The argument is what connects' EOL
' all the operations together. MasterOp will output the path to a subroutine, and then' EOL
' call that subroutine. CallMasterOp will call the subroutine only. The value of the' EOL
' argument can change or remain the same. If the second MasterOp Argument does not change,' EOL
' the first MasterOp will be canceled. This can be used for any type of Operation.' EOL
' But the Post Processor will update its registers per the condition following the' EOL
' MasterOp Command. It is also recommended to use low argument values. The limit is 25.' EOL
END
EachOp {Start of post processing *********************}
IF FirstOperation?
EOR EOL
':' Program#
IF UseComments? AND ProgramNameComment?
'( ' 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
OpenSub
RestoreScale
Seq 'G20' EOL { Inch Mode }
SeqC Rapid Plane CRCOff 'G49G54G80' AbsOrInc 'G94Z0' EOL
SeqC 'X0Y0' EOL
SeqC 'M92' EOL { WorkHolder Loaded Scanner }
DoPostScript
IF MultipleParts? AND AllToolsOnePart?
OpenMP
IF Rotate?
GetRotate
IF WorkFixtureOffsets?
OpenWFOIndex
END
END
END
DoOpComments
CheckFIFO
SeqC OpToolID ToolChng EOL
WFOStuff
CheckMOPOn
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
SeqC Rapid AbsOrInc StrtPos DoSpeed SpinOn EOL
SeqC OfstOn CoolOn EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
SeqC StrtPos EOL
END
ELSE
IF NewTool?

{Finish off last Operation}

IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CloseMP
END
IF MultipleParts? AND OneToolAllParts? AND FullUp?
CloseMP
END
CheckMOPOff
CheckWFOIndex
SeqC Rapid 'G49'
IF MultipleParts? AND AllToolsOnePart?
ELSE
'G54'
END
'Z0' CoolOff EOL
DoEndOpPS
IF ToolChangeAtHome?
SeqC Rapid AbsOrInc Home SpinOff EOL
END
IF LAST ProgStop?
SeqC 'M00' EOL
ELSE
SeqC ProgStop EOL
END

{Start new Operation}

DoPostScript
DoOpComments
CheckFIFO
Seq OpToolID ToolChng EOL
SeqC PlaneC EOL
WFOStuff
IF CallMasterOp?
CMOPOn
ELSE
CheckMOPOn
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
SeqC Rapid AbsOrInc StrtPos DoSpeed SpinOn EOL
SeqC OfstOn CoolOn EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
SeqC StrtPos EOL
END
END
ELSE
IF SameTool?
IF NOT CallMasterOp?
CheckMOPOff
DoEndOpPS
IF LAST ProgStop?
SeqC Rapid 'G49'
IF MultipleParts? AND AllToolsOnePart?
ELSE
'G54'
END
'Z0' CoolOff EOL
SeqC 'M00' EOL

{Start new Operation}

GetStartOfSameTool
SeqC Rapid PlaneC AbsOrInc StrtPos DoSpeedC SpinOn EOL
SeqC OfstOn CoolOn EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
IF NewToolOffset?
SeqC Rapid 'G49'
IF MultipleParts? AND AllToolsOnePart?
ELSE
'G54'
END
'Z0' EOL

{Start new Operation}

GetStartOfSameTool
SeqC Rapid PlaneC AbsOrInc StrtPos DoSpeedC EOL
SeqC OfstOn EOL
ELSE

{Start new Operation}

GetStartOfSameTool
SeqC Rapid PlaneC AbsOrInc StrtPos DoSpeedC EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqC CoolOn EOL
END
END
END
END
END
END {common point for all operations}
IF MasterOp?
Save# Operation# Program#
END
IF NOT CallMasterOp?
IF Milling?
SeqC ZCP2C EOL
IF Repeats?
NewProg
IF ZshiftOnly?
IF AutoCycle? {incremental Autocycle sub can have Z moves}
ZonlyRepAutoCycle
ELSE {Z shift only, NOT Auto Cycle}
IF UseSeparateSubCalls? AND CyclesLessThanMaxSubCalls?
FindAnyZMoves {for normal abs subroutine}
IF NoZMoves?
ZonlyRep
ELSE
G92Sub {pattern shift, not element}
END
ELSE {no sep subs desired}
G92Sub
END
END {end Auto Cycle IF}
ELSE {not Z only}
G92Sub
END {end Z only IF}
ELSE {no repeat OPs}
Milling
END
IF AutoCycle?
SeqC ZCP3C EOL
ELSE
IF FIFO? {.81}
SeqC FeedC CRCOffC ZCP3C FeedEntC EOL
ELSE
SeqC RapidC CRCOffC ZCP3C EOL
END
END
ELSE
IF Drilling?
IF Repeats?
NewProg
StdSub
SeqC Rapid AbsOrInc StrtPos EOL
END
SeqC DrillCP EOL
GetCycle
IF Tap?
SeqC 'M84' Speed EOL { Rigid Tap Cycle }
IF CWSpindle? { Bug with this Boolean }
SeqC 'G74' { Left Hand Tap Cycle }
ELSE
SeqC Cycle
END
ELSE
SeqC Cycle
END
FromCP ZDepth RLevel Dwell Peck Retract FeedEnt EOL
TrackZNO# FIRST SPZ# {.81.2}
ToolPath
IF RetractToCP1? {.81}
TrackZNO# ClearancePlane1#
ELSE
TrackZNO# ClearancePlane2#
END
SeqC 'G80'
IF Tap?
'M95' { SpinOff and CoolOff }
END
EOL
IF Repeats?
FinishSubG92
END
SeqC Rapid ZCP3 EOL
END
END
END
NextOp {loops back to EachOP until last Operation}

{End of program ************************************************************}

{finish last operation}
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CloseMP
END
IF MultipleParts? AND OneToolAllParts? AND FullUp?
CloseMP
END
CheckMOPOff
CheckWFOIndex
SeqC Rapid 'G49'
IF MultipleParts? AND AllToolsOnePart?
ELSE
'G54'
END
'Z0' CoolOff EOL
DoEndOpPS
IF FIRST ToolChangeAtHome? {.71.2 added FIRST modifier}
SeqC Rapid AbsOrInc FirstHome SpinOff EOL
ELSE
SeqC 'X0Y0' EOL
END
IF ProgStop?
SeqC 'M00' EOL
END
IF Flag?('3')
CloseWFOIndex
END
IF MultipleParts? AND AllToolsOnePart?
CloseMP
END
IF Flag?('3')
CheckPallet
END
SeqC EOP EOL
CloseSub
Post2 {organize Subs into one program}
EOR EOL
Close
ClearPS
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


Wyszukiwarka

Podobne podstrony:
Fanuc 0M [PP] M349 87
Fanuc 0M [HM] M629 87
Fanuc 0M Leadwell M075 87
Fanuc 0M [JMR] M733 87
Fanuc 0M Tongil M120 87
Fanuc 0M [PS] M465 87
Fanuc 0M MS M300L [ARC] M316 87
Fanuc 0M SH [UP] M927 87
Fanuc 0M Kit G54 NS M531 87
Fanuc 0M LW [BS] M890 87
Fanuc 0M Kit G54 [JR] M538 87
Fanuc 0M Supermax CGR MW21 87 1
Fanuc 6M [MC] M710 87
Fanuc 0M LH P&W [SP] CV84 16 3
Fanuc 0M Supermax [AM] MW17 89
Fanuc 11M Okuma M124 87
Fanuc 0M Wasino WM3 M525 81 2

więcej podobnych podstron