Bostomatic SPC II PM947 17 3


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

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

{4/12/91
Copied & modified: Bostomatic SPC-II M081.79
For: C.S. Draper Labs
Changed value for SetMaxRPM & added SetMinRPM this corrects the output of ProSpeed.
Added 'G26 line to beginning of program.
Changed tool change code to M0 in MachSpec and moved to line after OpToolID.
Added EOR to end of program.
Added UnTool to end of program.
Moved ProSpeed line to be inside MPFU sub as it contains the CoolOn command.
Jim Radcliffe}

{7/8/91
Modified: Bosto SPC-II M411.79
For: C.S. Draper Labs
Changed SetMaxRPM & SetMinRPM to 7000 & 700
Change ZCP2C to ZCP2 in Milling.
Jim Radcliffe}

{5/11/92
Modified: Bosto SPC-II M411.80
For: C.S. Draper Labs
Changes made per John Mahoney at C.S. Draper Lab.
Changed Maximum Spindle RPM from 4000 to 7000 in Mach Spec.
Changed 3 occurances of SeqC to SeqLabC.
DWB}

{5/17/94
Modified: Bostomatic SPC-II M411.80.1
For: CS Draper
Per John Mahoney at C.S. Draper
When in incremental, IJK values must be unsigned.
Modified FormatArc to handle with numeric commands for AutoCycles.
The value of the V60 register in drilling should be the incremental depth from the drill surface.
Changed ZDepth# to CalcZFmSurf#, user must enter the drill surface in ncCAM.
Jim Radcliffe}

{6/23/94
Modified: Bostomatic SPC-II M411.80.2
For CS Draper
Updated to .81.2 format.
The Drilling V64 register should be distance between the drill surface and ClearancePlane.
Added 'SUB# CalcZSurf#' to ClearancePlane1# or ClearancePlane2# commands.
Jim Radcliffe}

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

{2/28/96,
Initial: Bostomatic SPC-II M411.84
Created: Bostomatic SPC-II MXXX.84
For: CS Draper Labs
Deleted 'G26XYZ0' line at program start, added M6 at tool change, deleted prog stop after tool change,
Moved CoolOn to cuttercomp line, revmoved call to tool#1 at prog end, output StartPos at before drill cycles,
MPK}
{2/29/96, Created: Bostomatic SPC-II [CSD] M947.84.1, MPK}
{3/5/96, Created: Bostomatic SPC-II [CSD] M947.84.2, Fixed previous problem of outputting toolchange at same tool, MPK}
{3/21/96,
Initial: Bostomatic SPC-II [CSD] M947.84.2
Created: Bostomatic SPC-II [CSD] M947.84.3
Added macros before drill cycle calls as per John Mahoney, MPK}

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

{11/19/96
Initial: Bostomatic SPC-II CSD M947.87
Created: Bostomatic SPC-II CSD M947.87.1
ForUser: CS Draper Labs
Develop: ComPost2 68k v1.0b4, Catalyst68K v3.09.05C
Comment: Modified CRC Handling per marked up readout.
Modified ToolPath to output CRCOff on Last linear feature.
Suppressed output of LastFeatExtend if CRCOffC does not output.
Jim Radcliffe}

{3/3/97
Initial: Bostomatic SPC-II CSD M947.87.1
Created: Bostomatic SPC-II CSD M947.87.2
For: CS Draper per John Mahoney
Added test for Xmove or Ymove before making an arc move to prevent small moves beyond a quadrant boundary.
WS}

{6/26/97
Updated: Bostomatic SPC-II CSD M947.87.2
Created: Bostomatic SPC-II CSD M947.89
For: CS Draper
Versions: Catalyst v3.33C/ComPost2 MSL 68K
Changes made per John Mahoney of CS Draper.
Updated for Catalyst v3.33C per Fanuc 6M M001.89b Format.
Changed FORMAT#2 from ###.###;0. to #####.###;0. at Prog Numeric Format Definitions.
Changed FORMAT#3 from *###.###;0. to *#####.###;0. at Prog Numeric Format Definitions.
Deleted version comments.
Added SetMaxFeed(12700) for Metric VNC files at setup and initializations.
Added ProSpeed SpinOn 'G4X3.' for MP-OTAP-ECP condition at FirstOperation and NewTool.
Added ckCRC sub.
Changed FeedRateC to FeedEntC for support of FIFO Exit at FinishSub1, AutoCycCutSub2,
ZonlyRepAutoCycle subs and end of IF Milling.
Added support of ZOnlyRep SepSubs.
Added TrackZNO# to FORMAT#4 at Prog Numeric Format Definitions.
Added DoAbsOrInc and RestoreAbsOrInc subs.
Changed SkipZ to TrackZNO# FIRST SPZ# and deleted UnSkipZ at ZOnlyRep sub.
Added Flag(1) at setup and initializations.
Corrected MultipleParts output when WorkFixtureOffsets is selected.
Post does not support WorkFixtureOffsets.
Limited MP Subs and output to EquallySpacedOffsets at OpenMP and CloseMP.
Limited output of second StrtPos block at MP-OTAP-ECP condition at FirstOperation and NewTool.
Moved LastFeatExtend from Milling and ZOnlyRep subs to end of ToolPath.
Rewrote ZonlyRepAutoCycle sub.
To make it easier to comment out SetSRXYtoEP and IF SPXMove? OR SPYMove? boolean because this
post will be used to create Gibbs System only post.
NOTE: This post does not support Drill Subs.
DWB}

{3/17/99
Initial: Bostomatic SPC-II CSD M947.89
Created: Bostomatic SPC-II PM947.17.3
ForUser: Seymour
Develop: Compost2 PPC 1.7b15, Virtual Gibbs 5.05
Comment: Simple A Axis per Fanuc 6M PM001.17.3
Jim Radcliffe}

{Prog Numeric Format Definitions ****}

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(TrackC#,3)
FORMAT(TrackCNO#,3)
FORMAT(MoveC#,3)
FORMAT(UnitAngle#,3)
FORMAT(ABS#,4)
FORMAT(Recall#,4)
FORMAT(ADD#,4)
FORMAT(ToolDiameter#,4)
FORMAT(TrackXNO#,4)
FORMAT(TrackYNO#,4)
FORMAT(TrackZNO#,4)
FORMAT(TRUNC#,5)
FORMAT(Program#,5)
FORMAT(Program2#,5)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(Parts#,5)
FORMAT(Dwell#,6)
FORMAT(FeedEntry#,7)
FORMAT(SUB#,8)
FORMAT(CalcZFmSurf#,8)
FORMAT(Peck#,8)
FORMAT(RapidF#,9)

{Added Subroutines ****}

report:
IF PalletIn?
'------------------------------------' EOL
'Num#(1) xEP = ' Recall# Num#('1') EOL
'Num#(2) yEP = ' Recall# Num#('2') EOL
'------------------------------------' EOL
END
RETURN

resetSP: {update to the correct StartPos}
IF Rotations? OR Repeats? OR AutoCycle?
IF AbsValue?
TrackXNO# SPX#
TrackYNO# SPY#
ELSE
SetAbs
TrackXNO# SPX#
TrackYNO# SPY#
SetInc
END
END
RETURN

saveEP: {save the correct EndPos}
IF PointFeat?
IF AutoCycle?
SetACSPCompF
Save# Num#('1') ADD# Recall# Num#('1') SPX# { xOpEP }
Save# Num#('2') ADD# Recall# Num#('2') SPY# { yOpEP }
SetACSPComp
ELSE
Save# Num#('1') SPX# { xOpEP }
Save# Num#('2') SPY# { yOpEP }
END
ELSE
Save# Num#('1') EPX# { xOpEP }
Save# Num#('2') EPY# { yOpEP }
END
RETURN

getEP: {save the correct EndPos}
IF Rotations? OR Repeats? OR AutoCycle?
IF AbsValue?
saveEP
ELSE
SetAbs
saveEP
SetInc
END
report
END
RETURN

setSRXYtoACEP:
TrackXNO# Recall# Num#('1') { xOpEP }
TrackYNO# Recall# Num#('2') { yOpEP }
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

wfo:
{ Not Supported }
RETURN

wfoStuff:
IF NewWFO?
{Note: This processor does not support work fixture offsets.}
ELSE
IF Flag?('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
{Note: This processor does not support work fixture offsets.}
END
END
SetFlagF('2') { Do not output WFO second time wfoStuff is called for MP-WFO-OTAP-ECP }
RETURN

doSubComment:
IF UseComments? AND SubComment?
' ( SUB NUMBER: ' Program# ' )' 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
END
RETURN

psInit:
NewWFOF
FourthCWF
FourthCCWF
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
PalletInF
RETURN

psStuff:
IF FifthCW?
FORMAT(FifthDegree#,2)
SeqLabC 'B' FifthDegree# EOL
FifthCWF
END
IF FifthCCW?
FORMAT(FifthDegree#,3)
SeqLabC 'B' FifthDegree# EOL
FifthCCWF
END
RETURN

doPostScript:
psInit
EachPS
SeqLabC PostScript EOL
psStuff
NextPS
RETURN

doEndOpPS:
psInit
EachEOPS
SeqLabC EndOpPS EOL
psStuff
NextPS
RETURN

absValueC:
IF NOT AbsValue?
AbsValue
END
RETURN

incValueC:
IF AbsValue?
IncValue
END
RETURN

absOrIncC:
IF AbsoluteMoves?
absValueC
ELSE
incValueC
END
RETURN

setAngleUnder360: {sets status register and machine to current rotary position between -360 and 360 deg}
IF AAxisAvail?
SetAbs
IF GTEqual? MoveC# Num#('360') {reset the A-axis to be between 0 and 359.999}
ResetAngle
SeqLabC Preset 'A' TrackC# UnitAngle# EOL
ELSE
IF LTEqual? MoveC# Num#('-360')
IF Equal? UnitAngle# Num#('0') {reset the A-axis to be 0}
ResetAngle
SeqLabC Preset 'A' TrackC# UnitAngle# EOL
ELSE {reset the A-axis to be between -0.001 and -359.999}
ResetAngle
SeqLabC Preset 'A' TrackC# SUB# UnitAngle# Num#('360') EOL
END
END
END
SetInc { Because we call setAngleUnder360 right after incValueC OfstOff }
END
RETURN

doStartPos:
StrtPos
IF AAxisAvail?
CalcSCAng MoveC
ELSE
TrackCNO# Num#('0')
END
RETURN

doR: {Rapid moves need 'R'}
IF NOT EmptyLine?
'R'
END
RETURN

entryMove:
IF FirstOperation? OR NewTool?
RapidF# { Forces FeedEnt/FeedRate }
ELSE
IF LAST Rotations? OR LAST Repeats?
RapidF# { Forces FeedEnt/FeedRate }
END
END
IF FeedEntry?
SeqLabC FeedC ZIn FeedEntC EOL
ELSE
SeqLabC FeedC ZIn doR EOL
END
RETURN

startSub:
OpenSub
doSubComment
SeqLab 'G92' SubID EOL
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:
SeqLabC SubCall CallLab RepLab RepCycs EOL
startSub
RETURN

finishSub1: {part 1}
SeqLabC CRCOffC
IF NOT FeedConnect?
FeedC ZCP3C doR
END
EOL
RETURN

finishSubG92: {part 2}
SeqLabC Preset ShiftRC EOL
SeqLabC EndSub EOL
CloseSub
SeqLabC Preset UnshftRC EOL
RETURN

doWFOOps:
IF Flag?('5')
SetFlagF('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
ELSE
SeqLabC SetWFO EOL
END
SeqLabC SubCall CallLab RepLab OnePart EOL
RETURN

openMP:
IF EquallySpacedOffsets?
NewProg
SeqLabC SubCall CallLab RepLab Parts EOL
IF OneToolAllParts? AND ExitClearancePlane?
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
startSub
END
RETURN

closeMP:
IF EquallySpacedOffsets?
SeqLabC absOrIncC EOL
SeqLabC Preset ShiftPC EOL
SeqLabC EndSub EOL
CloseSub
SeqLabC Preset UnshftPC EOL
END
RETURN

doAbsOrInc:
IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated }
IF ZMove?
incValueC
ELSE
absOrIncC
END
END
RETURN

doDrillAbsOrInc:
{ Not Supported }
RETURN

restoreAbsOrInc:
IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated }
SeqLabC absOrIncC EOL
END
RETURN

checkOptCyc: { Drilling Only }
IF OptCyc1? {call subroutine already in memory}
IF FIFO?
'G94D249' {for single direction positioning}
ELSE
IF Tap?
'G94D252' {for tap cycle}
END
END
END
RETURN

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

ckCRCNum:
{ Not Supported }
RETURN

tpPointFeat:
IF AutoCycle?
SeqLabC MoveSXYC doR EOL
IF Repeats? AND ZshiftOnly?
SeqLabC SubCall CallLabB TRUNC# SUB# Program# Num#('1') EOL
ELSE
SeqLabC SubCall CallLab EOL
END
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
ELSE
IF FirstFeat?
SetFlagF('9') { For valid Drill Rotation Sub }
IF Rotations?
IF NOT LastFeat?
IF NOT MasterOp?
SetFlag('9') { valid Drill Rotation Sub }
NewProg
StartSub
END
END
END
ELSE
SeqLabC MoveSXYC doR checkOptCyc EOL
END
IF LastFeat?
IF Flag?('9') { valid Drill Rotation Sub }
restoreAbsOrInc
IF NOT MasterOp?
SeqLabC EndSub EOL
CloseSub
END
END
END
END
RETURN

tpRapidFeat:
IF XMove? OR YMove? OR ZMove?
SeqLabC doAbsOrInc ckCRC FeedC MoveXYZC ckCRCNum doR EOL
END
RETURN

tpLineFeat:
IF XMove? OR YMove? OR ZMove?
SeqLabC doAbsOrInc ckCRC FeedC MoveXYZC FeedRateC ckCRCNum EOL
END
RETURN

tpArcFeat:
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
SeqLabC doAbsOrInc
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
IF XYPlane?
MoveX MoveY MoveZC
ELSE
IF XZPlane?
MoveX MoveYC MoveZ
ELSE
MoveXC MoveY MoveZ
END
END
IF ArcIJFormat?
IF AbsValue?
ArcIJ
ELSE
IF XYPlane?
'I' ABS# ArcI# 'J' ABS# ArcJ#
ELSE
IF XZPlane?
'I' ABS# ArcI# 'K' ABS# ArcJ#
ELSE
'J' ABS# ArcI# 'K' ABS# ArcJ#
END
END
END
ELSE
ArcR
END
ArcFeedC EOL
NEXTQuadrant
RETURN

toolPath:
ResetCRCNum
EACHFeat
IF FirstFeat?
resetSP
END
IF PointFeat?
tpPointFeat
ELSE
IF RapidFeat?
tpRapidFeat
ELSE
IF LineFeat?
tpLineFeat
ELSE
IF ArcFeat?
tpArcFeat
END
END
END
END
IF LastFeat?
getEP
CRCOffC
IF NOT EmptyLine?
SeqLabC FeedC LastFeatExtend EOL
{getExtendedEP} {** Need new command **}
END
END
NEXTFeat
restoreAbsOrInc
RETURN

autoCycCutSub1: {part 1}
SaveSubStatus {save tool position}
SetPass1 {element cut moves}
startSub
SetSRXYtoSP
SeqLabC incValueC EOL
RETURN

autoCycCutSub2: {part 2}
toolPath
SeqLabC absOrIncC CRCOffC
IF Repeats? AND FeedConnect? AND ZshiftOnly?
ELSE
FeedC ZCP2 doR
END
EOL
SeqLabC 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
SeqLabC absOrIncC Feed doStartPos
IF NOT FeedConnect?
doR
END
EOL
milling
finishSub1
finishSubG92
RETURN

doSepSubContour:
SetPass1
TrackZNO# SPZ#
startSub
RapidF#
IF AutoCycle?
NewProg
autoCycCutSub1 {build element sub}
TrackZNO# SPZ#
autoCycCutSub2
ELSE
toolPath
finishSub1
SeqLabC EndSub EOL
CloseSub
END
SetPass1
SetStatusRapid
RapidF#
SetSRXYtoEP
TrackZNO# ClearancePlane2#
RETURN

doSepSubFeedConnect:
IF FeedConnect?
FeedEntC
ELSE
doR
END
RETURN

doSepSubSPMove:
SetStatusOff
IF SPXMove? OR SPYMove?
SeqLabC Feed
IF AutoCycle?
incValueC
END
StrtPosC doSepSubFeedConnect EOL
absOrIncC
ELSE
Feed
END
SetStatusOn
RETURN

doSepSubZMoves:
IF FeedConnect?
SeqLabC FeedC ZInPlusInc FeedEnt EOL
ELSE
IF FeedEntry?
IF NOT FirstCycle?
SeqLabC FeedC ZCP2PlusInc doR EOL
END
SeqLabC Feed ZInPlusInc FeedEnt EOL
ELSE
IF FirstCycle? AND AutoCycle?
Feed
END
SeqLabC FeedC ZInPlusInc doR EOL
END
END
SeqLabC SubCall CallLab EOL
IF NOT FeedConnect? AND NOT AbsValue?
TrackZNO# ZCP2PlusInc#
SeqLabC ZCP2C EOL
IF NOT AutoCycle?
TrackZNO# ClearancePlane3#
END
END
RETURN

setSepSubZ:
SetAbs
TrackZNO# ADD# SPZ# MUL# RepsLess1# RepeatZ#
SetInc
RETURN

doSepSubExit:
IF NOT AbsValue?
setSepSubZ
END
IF AutoCycle?
SeqLabC Feed ZCP2 doR EOL
ELSE
Feed { Will be output at millingOp ZCP3 }
END
RETURN

resetSepSubSR:
SetPass1
SetStatusRapid
RapidF#
TrackXNO# Recall# Num#('1') { xOpEP }
TrackYNO# Recall# Num#('2') { yOpEP }
RETURN

zonlyRepAutoCycle:
doSepSubContour
EachCycle
IF NOT FirstCycle?
doSepSubSPMove
END
doSepSubZMoves
NextCycle
IF FeedConnect?
doSepSubExit
END
SeqLabC EndSub EOL
CloseSub
{Element shift, not pattern}
autoCycPat {write pattern moves and main calls}
resetSepSubSR
TrackZNO# ClearancePlane2#
RETURN

zonlyRep:
doSepSubContour
EachCycle
IF NOT FirstCycle?
doSepSubSPMove
END
doSepSubZMoves
NextCycle
resetSepSubSR
IF FeedConnect?
doSepSubExit
ELSE
TrackZNO# ClearancePlane3#
END
RETURN

millingOp:
SeqLabC FeedC ZCP2C DoR EOL
IF Repeats?
NewProg
IF ZshiftOnly?
IF AutoCycle? {incremental Autocycle sub can have Z moves}
zonlyRepAutoCycle
ELSE {Z shift only, NOT Auto Cycle}
SetFlag('1') { Milling ZShiftOnly SepSubs activated }
zonlyRep
SetFlagF('1') { Milling ZShiftOnly SepSubs deactivated }
END {end Auto Cycle IF}
ELSE {not Z only}
g92Sub
END {end Z only IF}
ELSE {no repeat OPs}
milling
END
IF AutoCycle?
SeqLabC CRCOffC ZCP3C doR EOL
setSRXYtoACEP
ELSE
SeqLabC CRCOffC FeedC ZCP3C doR EOL
END
RETURN

skipToLastFeat:
{ Not Supported }
RETURN

setDrillEndOpZ:
{ Not Supported }
RETURN

drillingOp:
SeqLabC Feed doStartPos doR EOL
SeqLabC { needs unconditional output of Z position here, Z not yet output }
IF RetractToCP1?
ZCP1
ELSE
ZCP2
END
doR EOL
GetCycle
SeqLabC 'V60D' CalcZFmSurf# EOL
SeqLabC 'V64D' {unsigned incremental distance from current Z position to drill surface}
IF RetractToCP1?
SUB# ClearancePlane1# CalcZSurf#
ELSE
SUB# ClearancePlane2# CalcZSurf#
END
EOL
SeqLabC 'V67D' FeedEntry# EOL
IF Peck?
SeqLabC 'V63D' Peck# EOL
END
IF FIRO?
SeqLabC 'M2007' EOL
ELSE
IF FIDRO?
SeqLabC 'M2008' EOL
ELSE
IF FIFO?
SeqLabC 'M2009' EOL
ELSE
IF PeckChipBreaker?
SeqLabC 'M2001' EOL
ELSE
IF PeckFullRetract?
SeqLabC 'M2000' EOL
END
END
END
END
END
SeqLabC Cycle EOL
SeqLabC doStartPos doR checkOptCyc EOL
toolPath
setDrillEndOpZ
IF NOT Rotations?
SeqLabC DrillOff EOL
SeqLabC FeedC ZCP3C doR EOL
END
RETURN

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

rotateStartPosC:
TrackXNO# Recall# Num#('1') { xOpEP }
MoveSXC
TrackYNO# Recall# Num#('2') { yOpEP }
MoveSYC
CalcSCAng MoveC
RETURN

rotaryReps: {use the correct EndPos}
EachRotation
IF Milling?
IF FirstRotation?
NewProg
SaveProgNum2
StartSub
millingOp
SeqLabC EndSub EOL
CloseSub
checkPass
ELSE
SeqLabC rotateStartPosC EOL
END
SeqLabC SubCall CallLabB Program2# EOL
ELSE
IF Drilling?
IF FirstRotation?
drillingOp
checkPass
ELSE
IF RetractToCP1? AND Equal? ClearancePlane1# ClearancePlane3#
SeqLabC rotateStartPosC EOL
ELSE
IF NOT RetractToCP1? AND Equal? ClearancePlane2# ClearancePlane3#
SeqLabC rotateStartPosC EOL
ELSE { Need to cancel Drill Cycle between Rotations }
SeqLabC DrillOff EOL
SeqLabC FeedC ZCP3C doR EOL
SeqLabC rotateStartPosC EOL
SeqLabC DrillCP EOL
SeqLabC Cycle FromCP rotateStartPosC ZDepth RLevel Dwell Peck Retract FeedEnt EOL
END
END
END
IF CallMasterOp?
IF NOT FirstRotation?
SeqLabC SubCall CallLabB CallMasterNum# EOL
END
ELSE
IF MasterOp?
IF NOT FirstRotation?
SeqLabC SubCall CallLab EOL
END
ELSE
IF Flag?('9') { valid Drill Rotation Sub }
SeqLabC SubCall CallLab EOL
END
END
END
IF LastRotation?
SeqLabC DrillOff EOL
SeqLabC FeedC ZCP3C doR EOL
END
END
END
NextRotation
TrackXNO# Recall# Num#('1') { xOpEP }
TrackYNO# Recall# Num#('2') { yOpEP }
TrackZNO# ClearancePlane3#
RETURN

opGuts:
IF Rotations?
rotaryReps
ELSE
IF Milling?
millingOp
ELSE
IF Drilling?
drillingOp
END
END
END
RETURN

progStart:
InitProg
ReverseXZArcs
ArcsNeedXYZ
InitWFONum
SetFlood
SetMaxRPM('10000')
SetMinRPM('700')
IF Metric?
SetMaxFeed('12700')
ELSE
SetMaxFeed('500')
END
Save# Num#('1') Num#('0') { Status Register Variable for X Axis }
Save# Num#('2') Num#('0') { Status Register Variable for Y Axis }
SetFlagF('1') { Milling ZShiftOnly SepSubs/DrillSubs deactivated }
SetFlagF('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
SetFlagF('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
SetFlagF('9') { For valid Drill Rotation Sub }
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
' 5thAxisCW(30), 5ACW(30) -' EOL
' generates a + B move of the value you specify' EOL
' 5thAxisCCW(22.5), 5ACCW(22.5) -' EOL
' generates a - B move of the value you specify' EOL
' OptionalCycle1, OptCyc1 -' EOL
' when used in a drilling cycle all positioning moves will be output' EOL
' with a G94D249 on the same line if FI-FO is selected,' EOL
' or G94D252 if Tap is selected.' EOL
END
RETURN

initOp:
EOR EOL
IF UseComments?
IF ProgramNameComment?
' ( PROGRAM: ' ProgramName$ ' )' EOL
END
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
RETURN

firstOp1:
IF ToolChangeAtHome?
SetHome
END
IF UseComments?
' ( START OF MAIN PROGRAM )' EOL
END
SeqLab Feed AbsOrInc Plane CRCOff 'G49' EOL
doOpComments
SeqLabC OpToolID ToolChng EOL
doPostScript
RETURN

firstOp2:
SeqLabC wfoStuff EOL
SeqLabC ProSpeed SpinOn 'G4X3.' EOL
checkPass
IF Milling?
SeqLabC doStartPos doR EOL
END
RETURN

firstOp3:
SeqLabC OpToolID 'G48R' CoolOn EOL { OfstOn }
RETURN

newToolOp1:
SeqLabC CoolOff EOL
SeqLabC 'G49R' EOL { OfstOff }
setAngleUnder360
RETURN

newToolOp2:
doEndOpPS
IF ToolChangeAtHome?
SeqLabC absOrIncC Feed Home doR EOL
END
SeqLabC SpinOff 'G4X2.' EOL
IF LAST ProgStop?
SeqLabC 'M0' EOL
ELSE
SeqLabC ProgStop EOL
END
RETURN

newToolOp3: {Start new Operation}
doOpComments
SeqLab OpToolID ToolChng EOL
doPostScript
RETURN

newToolOp4:
SeqLabC wfoStuff EOL
SeqLabC Plane ProSpeed SpinOn 'G4X3.' EOL
checkPass
IF Milling?
SeqLabC Feed AbsOrInc doStartPos doR EOL
END
RETURN

newToolOp5:
SeqLabC OpToolID 'G48R' CoolOn EOL { OfstOn }
RETURN

sameToolOp1:
doEndOpPS
IF LAST ProgStop?
SeqLabC CoolOff EOL
SeqLabC 'G49R' EOL { OfstOff }
SeqLabC SpinOff 'G4X2.' EOL
SeqLabC 'M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqLabC CoolOff EOL
END
IF NewToolOffset?
SeqLabC 'G49R' EOL { OfstOff }
END
END
setAngleUnder360
RETURN

sameToolOp2: {Start new Operation}
doOpComments
doPostScript
checkPass
RETURN

sameToolOp3: {Start new Operation}
SeqLabC wfoStuff EOL
IF LAST ProgStop?
SeqLabC PlaneC ProSpeed SpinOn 'G4X3.' EOL
IF Milling?
SeqLabC Feed AbsOrInc doStartPos doR EOL
END
SeqLabC OpToolID 'G48R' CoolOn EOL { OfstOn }
ELSE
IF Milling?
SeqLabC Feed AbsOrInc PlaneC ProSpeed doStartPos doR EOL
ELSE
SeqLabC PlaneC ProSpeed EOL
END
IF NewToolOffset?
SeqLabC OpToolID 'G48R' EOL { OfstOn }
END
IF NOT CoolOff? AND LAST CoolOff?
SeqLabC CoolOn EOL
END
END
RETURN

end1:
SeqLabC CoolOff EOL
SeqLabC 'G49R' EOL { OfstOff }
setAngleUnder360
IF NotEqual? UnitAngle# Num#('0')
SeqLabC absOrIncC FeedC 'A' TrackC# Num#('0') doR EOL
END
RETURN

end2:
doEndOpPS
IF ToolChangeAtHome?
SeqLabC absOrIncC Feed FirstHome doR EOL
END
SeqLabC SpinOff 'G4X2.' EOL
IF ProgStop?
SeqLabC 'M0' EOL
END
RETURN

end3:
SeqLabC EOP EOL
CloseSub
Post2 {organize Subs into one program}
EOR EOL
Close
Retag
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}
EachOp {Start of post processing}
IF EquallySpacedOffsets?
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
IF FirstOperation?
openMP
firstOp1
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
newToolOp2 {to tool change, CS problem}
newToolOp3
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
end1
end2
closeMP
end3
RETURN

mp1ToollAllPfu: {Multiple Parts, 1 Tool all Parts, full up}
EachOp {Start of post processing}
IF EquallySpacedOffsets?
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
IF FirstOperation?
firstOp1
openMP
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
closeMP
newToolOp2 {to tool change, CS problem}
newToolOp3
openMP
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
end1
closeMP
end2
end3
RETURN

mp1ToollAllPXcp: {Multiple Parts, 1 Tool all Parts, exit Clearance plane}
EachOp {Start of post processing}
SetFlag('2') { Need to output wfoStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF FirstOperation?
firstOp1
firstOp2
firstOp3
openMP
firstOp2 {need StrtPos in Sub}
ELSE
IF NewTool?
closeMP
newToolOp1
newToolOp2 {to tool change, CS problem}
newToolOp3
newToolOp4
newToolOp5
openMP
newToolOp4 {need StrtPos in Sub}
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
closeMP
end1
end2
end3
RETURN

noMPs: {no multiple parts}
EachOp {Start of post processing}
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 {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
end1
end2
end3
RETURN

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

progStart {setup and initializations}
initOp

IF MultipleParts?
IF AllToolsOnePart?
mpAllTools1P
ELSE {implied OneToolAllParts?}
IF FullUp?
mp1ToollAllPfu
ELSE {implied ExitClearancePlane?}
mp1ToollAllPXcp
END
END
ELSE
noMPs
END


Wyszukiwarka