Hicell 20 [CD] YSML835 17 3


{
MILL=T
LATHE=T
ADV_MILL=F
SUBS=T
ROTARY_MILL=T
MILLTURN_POLAR-SEG=T
MILLTURN_Y-AXIS=T
METRIC=F
}
{
Before you change this post, make sure that flag(10) is set correctly:
>>> You must check G90/G91 output since I DID NOT !!! <<<
>>> As far as I know, U & W should works for both G-codes groups <<<

Flag(10):
True for Fanuc Control with Standard G-codes (Default).
G32 - Thread Cutting
G50 - Preset and Max RPM Setting
G98 - Per Minute Feedrate
G99 - Per Revolution Feedrate
X,Z - Absolute Programming
U,W - Incremental Programming
False for Fanuc Control with Special G-codes.
G33 - Thread Cutting
G92 - Preset and Max RPM Setting - Must be set in the "Form" under Origins & Values
G94 - Per Minute Feedrate
G95 - Per Revolution Feedrate
G90 - Absolute Programming - Must be set in the "Form" under Origins & Values
G91 - Incremental Programming - Must be set in the "Form" under Origins & Values
}

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

{7/24/90, Added InitProg globally to posts with this remark, DWB}
{9/21/90, Updated: Fanuc 6T MS [+] L016.53 to .71 format, JR}
{10/2/90, Added StockOff globally at FirstOperation, DWB}
{10/8/90, Replace CalcRPM2 globally with CalcEPRPM# at end of prog, DWB}

{4/1/91
Modified: Fanuc 6T MS [+] L016.71.2
For: Gibbs & Associates
Updated to Version 4.0 per Fanuc 10T MS [-] L001.80 Format.
All normal Fanuc Canned Cycles are supported.
DWB}

{08/06/91
Updated: Fanuc 6T MS [+] L016.80
For: Gibbs & Associates
Updated to Version 4.0 per Fanuc 6M M001.82 Format.
Kim Michelman}

{1/12/95
Copied & modified: Fanuc 6T MS [+] L016.82
For: Danotech / Hummel
Control: Seiki Multi
Machine: Hitachi Seiki
Use R format arcs
Go directly to G96 in CSS operations.
Rapid moves inhibit Speed changes in G96 mode!
No Preset Home at beginning of operations, MaxRPM only for CSS operations.
Tnn00 calls tool and geometry offset. They do not use wear offsets.
Customer does not want an Index Position output.
I tested the ToolChangeAtHome boolean with Catalyst 2.14.24C and it seems to be working!
Added GearRange, outputs M41 only.
Madified Drilling.
Added PeckFullOut.
Deleted DrillOff and RLevel.
Misc other format changes.
Updated to .82ż format.
Jim Radcliffe}

{2/20/95
Moved unconditional sequence label at beginning of operation to OpToolID line.
Modified FormatArc to force output ArcRC, deleted the IF ArcIJFormat? argument.
Jim Radcliffe}

{5/8/95
Initial: Seiki Multi L332.82.1
Created: Seiki Multi L332.82.2
ForUser: Danotech / Hummel
Comment: Modified per before and after edits outputs s2bit.txt and wewant.txt
Preset MaxRPM in 1st op only, commented out others.
Changed format of CutDepth in RoughContour to use decimal points
Changed StrtPos to StrtPosC in RoughContour
Jim Radcliffe}

{5/17/95, .83, Updated to .83 format, JR}
{9/10/95, Updated Seiki Multi L332.83.1 to .85 format per Fanuc 10T MS [-] L001.85.01.01, JR}

{2/4/96
Modified: Seiki Multi L332.85
Created: Seiki Multi [IM] Lxxx.85.1
For: Isimac; per Jim Adams
Corrected G70 > G73 finish/rough cycles; added CkLastLineMove and CkLastArcMove subs (called from
LineFeat, ArcFeat, and RapidFeat in toolpath) to output move to X & Z CSP in canned rough cycle.
Changed format of G74 (peck drilling) cycle to their specification.
Fixed G76 (threading) cycle; changed 'D' (1st depth of cut) to decimal format in Form,
changed format of InFeedAngle# to multiply value by 2 (to get included angle).
Added parts catcher support (M63 in, M64 out).
Added blank line between tools.
Changed tool start-up code at FirstOp and NewTool to their specifications.
Changed DoOpComments; they only want Operation and Tool comments.
Also moved comments to output after the first line of a tool, not before.
Added SetGearRange, SetNewGearFlag, and GetGearRange subs to handle high/low spindle logic
(low speed/M40 for roughing ops, high speed/M41 for finish or contouring ops;
low speed is <= 1500 and high speed is >1500. This logic is required in order to work
correctly in SameTool (CheckOffset sub).
Added DoToolData sub to create Tool Data Header.
Added SetCutOffFlag sub to determine if any ops had CutOff selected; if any ops had CutOff
selected then I set Flag 3 true. I then use this flag to output their stock stop subprogram
before first op if CutOff? was true in any op.
Added logic at end of program to output '/M30' and then 'M99' if CutOff? is true on last op;
this allows them to loop the program by turning on 'Block Delete' on their control.
Added IF ApproachID? then flip the XStkLeft polarity in ID rough cycle (G71). The polarity of
the U & W stock values must be reversed when roughing an ID.
Deleted G40/G41/G42 by stripping them in the Format.
Added logic in Canned Rough cycles to break up first move inside the cycle to two moves, a
move with simultaneous X and Z movement is illegal as the first move of a canned rough cycle.
Joe Cusimano}

{5/14/96
Modified: Seiki Multi [IM] Lxxx.85.1
Created: Seiki Multi [TL] L419.85.2
For: Tinsley Labs; per James Verrico
Modified First Op startup code per their specifications.
Changed Tool# from Format 3 to Format 8.
Deleted 'SeqLabC Preset MaxRPM EOL' from IF ConstantSurface Feed? in First Op.
Moved CoolOn to same line as Speed; moved SpinOn to first rapid line.
Changed Approach sub to rapid in Z first and then X (Tailstock type Approach).
Changed NewHome to NewHomeX# for Tailstock type exit; added FORMAT(NewHomeX#,2);
Changed FirstHome at Last Operation to FirstHomeX# for Tailstock exit.
Modified a bunch of other stuff in Last Op to their specs.
Joe Cusimano}

{2/27/97
Modified: Seiki Multi [TL] L419.85.2
Created: Seiki Multi [INS] L568.85
For: Inspirnetics
Added support for all L001 comments.
WS}

{3/1/99
Updated: Seiki Multi [INS] L568.85
Created: Seiki Multi [INS] L568.85.01
For: Gibbs & Associates/Continental Disk
Versions: Virtual 5.04.07/ComPost2 1.7b15
Updated for Catalyst v4.23.13C per Fanuc 10T MS [-] L001.85.02e Format.
DWB}

{3/23/99
Updated & Modified: Seiki Multi [INS] L568.85.01
Created: Seiki Multi [CD] L825.17
For: Continental Disk
Versions: Virtual 5.09.22/ComPost2 1.7b15
Updated for Catalyst v5 per Fanuc 10T MS [-] L001.17 Format.
Changes made per Chris Mick of Continental Disk, phone calls, manuals, 7268011.c1 and 4678701.c1
sample text files.
Moved ProgramNameComment to block by itself at initOp.
Changed SeqLabC to literals three places at initOp.
Changed FirstMoveEPZ# to FirstMoveEPX# at Prog Numeric Format Definitions.
Deleted LAST modifier two places at endOp2.
BUG CORRECTION: Polarity of XStkLeft in PosSideLathe ApproachID CannedCycle Roughing, both
RoughContour and RoughPatternShift. See notes of 2/4/96. This will need to be undone if the bug is
ever fixed. Good work Joe!
DWB}

{3/23/99
Updated & Modified: Seiki Multi [CD] L825.17
Created: Hicell 20 [CD] YSML835.17
For: Continental Disk
Versions: Virtual 5.09.22/ComPost2 1.7b15
Added MillTurn Source.
DWB}

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

#1 = '###.00'
#2 = '###.####;0.'
#3 = '####0'
#4 = '###^##0'
#5 = '##.######;0.'
#6 = '#'
#7 = '00'
#8 = '2+###.####;0.'
#9 = '00;00' {Added for thread angle & # of spring passes - JHE}
#10 = '*#####.###;0.' {Added for rotary axis - JHE}
#11 = '##^###0' {used for Peck & minmun depth of cut - JHE}
#12 = '0^0;00' {Added for thread chamfer - JHE}

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(Recall#,2)
FORMAT(ADD#,2)
FORMAT(SUB#,2)
FORMAT(MUL#,2)
FORMAT(SPX#,2)
FORMAT(SPY#,2)
FORMAT(SPZ#,2)
FORMAT(EPX#,2)
FORMAT(EPY#,2)
FORMAT(EPZ#,2)
FORMAT(ThisOpEntryZCP#,2)
FORMAT(ThisOpEntryXCP#,2)
FORMAT(ZOpCP#,2)
FORMAT(XOpCD#,2)
FORMAT(TrackX#,2)
FORMAT(TrackY#,2)
FORMAT(TrackZ#,2)
FORMAT(TrackXNO#,2)
FORMAT(TrackYNO#,2)
FORMAT(TrackZNO#,2)
FORMAT(ArcCPH#,2)
FORMAT(ArcCPV#,2)
FORMAT(FirstMoveEPX#,2)
FORMAT(ToolDiameter#,2)
FORMAT(LastCutXRadius#,2)
FORMAT(Peck#,2)
FORMAT(TRUNC#,3)
FORMAT(Tag#,3)
FORMAT(Program#,3)
FORMAT(Program2#,3)
FORMAT(CallMasterNum#,3)
FORMAT(Operation#,3)
FORMAT(Tool#,3)
FORMAT(CalcEPRPM#,3)
FORMAT(Dwell#,4)
FORMAT(FeedIPR#,5)
FORMAT(RapidF#,6)
FORMAT(InFeedAngle#,8)
FORMAT(SpringPasses#,9)
FORMAT(UnitAngle#,10)
FORMAT(TrackC#,10)
FORMAT(TrackCNO#,10)
FORMAT(MoveC#,10)
FORMAT(DIV#,12) {Added - JHE}

{Prog Subroutines **********************************************************}

resetSP: {update to the correct StartPos}
IF NOT TurningOp?
IF Rotations? OR Repeats? OR AutoCycle?
CalcSCAng
IF AbsValue?
IF FaceTool?
TrackXNO# SPX#
ELSE
TrackZNO# SPZ#
END
TrackYNO# SPY#
TrackCNO# MoveC#
ELSE
SetAbs
IF FaceTool?
TrackXNO# SPX#
ELSE
TrackZNO# SPZ#
END
TrackYNO# SPY#
TrackCNO# MoveC#
SetInc
END
END
END
RETURN

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

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

setSRXYtoACEP:
IF FaceTool?
TrackXNO# Recall# Num#('1') { xOpEP }
ELSE
TrackZNO# Recall# Num#('3') { zOpEP }
END
TrackYNO# Recall# Num#('2') { yOpEP }
TrackCNO# Recall# Num#('4') { cOpEP }
RETURN

doMillCP1: {no calls to this sub - JHE}
IF FaceTool?
ThisOpEntryZCP
ELSE
ThisOpEntryXCP
END
RETURN

doMillCP2:
IF FaceTool?
IF AbsValue?
ZOpCP
ELSE
'W' ZOpCP#
END
ELSE
IF AbsValue?
XOpCD
ELSE
'U' XOpCD#
END
END
RETURN

doMillCP3:
IF FaceTool?
IF AbsValue?
ZOpECP
ELSE
'W' ZOpECP#
END
ELSE
IF AbsValue?
XOpECD
ELSE
'U' XOpECD#
END
END
RETURN

doMillCP1C: {no calls to this sub - JHE}
IF FaceTool?
ThisOpEntryZCPC
ELSE
ThisOpEntryXCPC
END
RETURN

doMillCP2C:
IF FaceTool?
ZOpCPC
ELSE
XOpCDC
END
RETURN

doMillCP3C:
IF FaceTool?
ZOpECPC
ELSE
XOpECDC
END
RETURN

doDrillCP:
IF FaceTool?
IF RetractToCP1?
ThisOpEntryZCPC
ELSE
ZOpCPC
END
ELSE
IF RetractToCP1?
ThisOpEntryXCPC
ELSE
XOpCDC
END
END
RETURN

tagNext: {outputs the ASCII character that Retag uses}
ASCII('62') {with Tag# to reference the sequence # stored with tagNext}
RETURN

tagNextRef: {outputs the ASCII character that Retag uses}
ASCII('179') {with Tag# to reference the sequence # stored with tagNext}
RETURN

tagPrev: {outputs the ASCII character that Retag uses}
ASCII('60') {with Tag# to store the previous sequence #}
RETURN

tagPrevRef: {outputs the ASCII character that Retag uses}
ASCII('178') {with Tag# to reference the sequence # stored with tagPrev}
RETURN

toolSeqInit: { Tool Sequence Line Numbers }
Save# Num#('21') Num#('-1') { Tool 1 }
Save# Num#('22') Num#('-1') { Tool 2 }
Save# Num#('23') Num#('-1') { Tool 3 }
Save# Num#('24') Num#('-1') { Tool 4 }
Save# Num#('25') Num#('-1') { Tool 5 }
Save# Num#('26') Num#('-1') { Tool 6 }
Save# Num#('27') Num#('-1') { Tool 7 }
Save# Num#('28') Num#('-1') { Tool 8 }
Save# Num#('29') Num#('-1') { Tool 9 }
Save# Num#('30') Num#('-1') { Tool 10 }
Save# Num#('31') Num#('-1') { Tool 11 }
Save# Num#('32') Num#('-1') { Tool 12 }
Save# Num#('33') Num#('-1') { Tool 13 }
Save# Num#('34') Num#('-1') { Tool 14 }
Save# Num#('35') Num#('-1') { Tool 15 }
Save# Num#('36') Num#('-1') { Tool 16 }
Save# Num#('37') Num#('-1') { Tool 17 }
Save# Num#('38') Num#('-1') { Tool 18 }
Save# Num#('39') Num#('-1') { Tool 19 }
Save# Num#('40') Num#('-1') { Tool 20 }
Save# Num#('41') Num#('-1') { Tool 21 }
Save# Num#('42') Num#('-1') { Tool 22 }
RETURN

toolSeq:
IF LTEqual? ToolOffset# Num#('22')
FORMAT(Recall#,7)
Save# ADD# ToolOffset# Num#('20') ADD# Recall# ADD# ToolOffset# Num#('20') Num#('1')
'N' ToolOffset# Recall# ADD# ToolOffset# Num#('20')
FORMAT(Recall#,2)
ELSE
SeqLab
END
RETURN

toolSeqP:
IF LTEqual? ToolOffset# Num#('22')
FORMAT(Recall#,7)
Save# ADD# ToolOffset# Num#('20') ADD# Recall# ADD# ToolOffset# Num#('20') Num#('1')
'P' ToolOffset# Recall# ADD# ToolOffset# Num#('20')
FORMAT(Recall#,2)
ELSE
TagInc
'P' tagNextRef Tag#
END
RETURN

toolSeqQ:
IF LTEqual? ToolOffset# Num#('22')
FORMAT(Recall#,7)
Save# ADD# ToolOffset# Num#('20') ADD# Recall# ADD# ToolOffset# Num#('20') Num#('1')
'Q' ToolOffset# Recall# ADD# ToolOffset# Num#('20')
FORMAT(Recall#,2)
ELSE
'Q' tagPrevRef Tag#
END
RETURN

toolSeqPN:
IF LTEqual? ToolOffset# Num#('22')
FORMAT(SUB#,7)
'N' ToolOffset# SUB# Recall# ADD# ToolOffset# Num#('20') Num#('1')
FORMAT(SUB#,2)
ELSE
tagNext Tag# EOL
SeqLab
END
RETURN

toolSeqQN:
IF LTEqual? ToolOffset# Num#('22')
FORMAT(Recall#,7)
'N' ToolOffset# Recall# ADD# ToolOffset# Num#('20')
FORMAT(Recall#,2)
ELSE
SeqLab
END
RETURN

toolSeqQN2:
IF GreaterThan? ToolOffset# Num#('22')
tagNext Tag# EOL
END
RETURN

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?
'( 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?
IF TurningOp? AND NOT Drilling?
'( TOOL ' Tool# ': ' ToolSize$ ' ' ToolType$ ' )' EOL
ELSE
'( TOOL ' Tool# ': ' ToolDiameter# ' DIA. ' ToolType$ ' )' EOL
END
END
IF ToolComment?
'( ' ToolComment$ ' )' EOL
END
restoreScale
END
RETURN

psInit: {reset flags}
OptCyc1F
MasterOpF
CallMasterOpF
RETURN

psStuff:
RETURN

doPostScript:
psInit
EachPS
SeqLabC PostScript EOL {literals}
psStuff {commands}
NextPS
RETURN

doEndOpPS:
psInit
EachEOPS
SeqLabC EndOpPS EOL {literals}
psStuff {commands}
NextPS
RETURN

doMoveSXC:
IF AbsValue?
MoveSXC
ELSE
IF SPXMove?
'U' SPX#
END
END
RETURN

doMoveSYC:
IF AbsValue?
MoveSYC
ELSE
IF SPYMove?
'V' SPY#
END
END
RETURN

doMoveSZC:
IF AbsValue?
MoveSZC
ELSE
IF SPZMove?
'W' SPZ#
END
END
RETURN

doMoveXC:
IF AbsValue?
MoveXC
ELSE
IF XMove?
'U' EPX#
END
END
RETURN

doMoveYC:
IF AbsValue?
MoveYC
ELSE
IF YMove?
'V' EPY#
END
END
RETURN

doMoveZC:
IF AbsValue?
MoveZC
ELSE
IF ZMove?
'W' EPZ#
END
END
RETURN

doMoveCC:
IF AbsValue?
MoveCC
ELSE
IF CMove?
'H' MoveC#
END
END
RETURN

doStartPos: {called from g92Sub - JHE}
IF RotaryMill?
IF FaceTool?
'X' TrackX# SPX# 'Y0.' TrackYNO# SPY# CalcSCAng MoveC
ELSE
'Y0.' TrackYNO# SPY# 'Z' TrackZ# SPZ# CalcSCAng MoveC
END
ELSE
IF FaceTool?
XSP MoveSY TrackCNO# Num#('0')
ELSE
MoveSY ZSP TrackCNO# Num#('0')
END
END
RETURN

doZIn:
IF FaceTool?
doMoveSZC
ELSE
doMoveSXC
END
RETURN

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

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

finishSub1: {part 1}
IF NOT FeedConnect?
SeqLabC CRCOffC RapidC doMillCP3C EOL
ELSE
SeqLabC CRCOffC EOL
END
RETURN

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

stockOnNoCan:
IF NOT CannedCycle?
StockOn {need stock for SP positioning, if not a canned cycle}
END
RETURN

feedNoCan:
IF NOT CannedCycle?
FeedC
END
RETURN

feedRateNoCan:
IF NOT CannedCycle?
FeedRateC
END
RETURN

setAngleUnder360:
{sets status register and machine to current rotary position between -360 and 360 deg}
IF NOT FirstOperation?
IF LAST RotaryMill? OR LAST Rotations?
IF GTEqual? MoveC# Num#('360')
{reset the C-axis to be between 0 and 359.999}
ResetAngle
SeqLabC Preset 'C' TrackC# UnitAngle# EOL
ELSE
IF LTEqual? MoveC# Num#('-360')
IF Equal? UnitAngle# Num#('0')
{reset the C-axis to be 0}
ResetAngle
SeqLabC Preset 'C' TrackC# UnitAngle# EOL
ELSE
{reset the C-axis to be between -0.001 and -359.999}
ResetAngle
SeqLabC Preset 'C' TrackC# SUB# UnitAngle# Num#('360') EOL
END
END
END
END
END
RETURN

doSpinOn:
IF TurningOp?
SpinOn
ELSE
IF CWSpindle?
'M13' {live tool CW}
ELSE
'M14' {live tool CCW}
END
END
RETURN

doFeedRate:
IF NOT EmptyLine?
IF RotaryMill?
AngleFeedC
ELSE
FeedRateC
END
END
RETURN

doAbsOrInc:
IF Rotations? AND RotaryMill?
SetInc
ELSE
IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated }
IF FaceTool? AND ZMove?
SetInc
ELSE
IF NOT FaceTool? AND XMove?
SetInc
ELSE
SetAbs
END
END
END
END
RETURN

doACAbsOrInc:
IF Rotations? AND CMove?
SetInc
ELSE
SetAbs
END
RETURN

doDrillAbsOrInc:
IF Rotations? AND RotaryMill?
SetInc
ELSE
IF Flag?('1') { DrillSubs activated }
IF FaceTool? AND SPZMove?
SetInc
ELSE
IF NOT FaceTool? AND SPXMove?
SetInc
ELSE
SetAbs
END
END
END
END
RETURN

restoreAbsOrInc:
IF Rotations? AND RotaryMill? AND NOT AutoCycle?
SetAbs
ELSE
IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated }
SetAbs
END
END
RETURN

ckCRC:
IF LastFeat?
CRCOffC
ELSE
IF TurningOp?
IF XMove? OR ZMove?
CRCOnC
END
ELSE
IF FaceTool? AND NOT ZMove?
CRCOnC
ELSE
IF NOT FaceTool? AND NOT XMove?
CRCOnC
END
END
END
END
RETURN

tpLastFeat: {turning op's}
IF Drilling?
IF Tap?
SeqLabC SpinOff EOL
SeqLabC 'G4P2000' EOL
SeqLabC Speed InverseSpinOn EOL
ELSE
IF Dwell?
SeqLabC 'G4P' Dwell# EOL
END
END
ELSE
IF CannedCycle?
toolSeqQN
END
END
RETURN

tpPointFeat:
IF AutoCycle?
IF RotaryMill?
CalcSCAng
IF FaceTool?
SeqLabC doACAbsOrInc doMoveSXC doMoveCC EOL
ELSE
SeqLabC doACAbsOrInc doMoveSZC doMoveCC EOL
END
SetAbs
ELSE
IF FaceTool?
SeqLabC doMoveSXC doMoveSYC EOL
ELSE
SeqLabC doMoveSYC doMoveSZC EOL
END
END
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 {implies Drilling}
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
CalcSCAng
IF FaceTool?
IF RotaryMill?
SeqLabC doDrillAbsOrInc doMoveSXC doMoveSZC doMoveCC EOL
ELSE
SeqLabC doDrillAbsOrInc doMoveSXC doMoveSYC doMoveSZC doMoveCC EOL
END
ELSE {implies OD Tool}
IF RotaryMill?
SeqLabC doDrillAbsOrInc doMoveSXC doMoveSZC doMoveCC EOL
ELSE
SeqLabC doDrillAbsOrInc doMoveSXC doMoveSYC doMoveSZC doMoveCC EOL
END
END
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 TurningOp?
IF XMove? OR ZMove?
IF NOT FirstFeat? AND LAST ThreadFeat?
Rapid
ELSE
ckCRC
END
SeqLabC RapidC MoveXC MoveZC EOL
END
ELSE
IF FaceTool?
IF RotaryMill?
CalcCAng
IF XMove? OR ZMove? OR CMove?
SeqLabC ckCRC RapidC doAbsOrInc doMoveXC doMoveZC doMoveCC EOL
END
ELSE
CalcCAng
IF XMove? OR YMove? OR ZMove? OR CMove?
SeqLabC ckCRC RapidC doAbsOrInc doMoveXC doMoveYC doMoveZC doMoveCC EOL
END
END
ELSE {implies OD Tool}
IF RotaryMill?
CalcCAng
IF XMove? OR ZMove? OR CMove?
SeqLabC ckCRC RapidC doAbsOrInc doMoveXC doMoveZC doMoveCC EOL
END
ELSE
CalcCAng
IF XMove? OR YMove? OR ZMove? OR CMove?
SeqLabC ckCRC RapidC doAbsOrInc doMoveXC doMoveYC doMoveZC doMoveCC EOL
END
END
END
END
RETURN

tpLineFeat:
IF TurningOp?
IF XMove? OR ZMove?
SeqLabC ckCRC FeedC MoveXC MoveZC FeedRateC EOL
END
ELSE
IF FaceTool?
IF RotaryMill?
EACHSpiralSeg
CalcCAng
IF XMove? OR ZMove? OR CMove?
SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveZC doMoveCC doFeedRate EOL
END
NEXTSpiralSeg
ELSE
IF XMove? OR YMove? OR ZMove?
SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveYC doMoveZC doFeedRate EOL
END
END
ELSE {implies OD Tool}
IF RotaryMill?
CalcCAng
IF XMove? OR ZMove? OR CMove?
SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveZC doMoveCC doFeedRate EOL
END
ELSE
IF XMove? OR YMove? OR ZMove?
SeqLabC ckCRC FeedC doAbsOrInc doMoveXC doMoveYC doMoveZC doFeedRate EOL
END
END
END
END
RETURN

formatArc: {Apply to milling only - JHE}
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
doMoveXC doMoveYC doMoveZC
IF ArcIJFormat?
IF FaceTool?
CircleIC CircleJC
ELSE
CircleJC CircleKC
END
ELSE
ArcRC
END
RETURN

tpArcFeat:
IF TurningOp?
EACHQuadrant { Do not use NOT, LAST, FIRST or NEXT modifiers in this loop }
SeqLabC
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
MoveXC MoveZC
IF ArcIJFormat?
CircleIC CircleKC
ELSE
ArcRC
END
FeedRateC EOL
NEXTQuadrant
ELSE
IF FaceTool?
IF RotaryMill?
{if the arc center and the rotary center coincide}
IF Equal? Num#('0') ArcCPH# AND Equal? Num#('0') ArcCPV#
CalcCAng
IF ZMove? OR CMove?
SeqLabC FeedC doAbsOrInc doMoveZC doMoveCC doFeedRate EOL
END
ELSE
EACHArcSegment
CalcCAng
IF XMove? OR ZMove? OR CMove?
SeqLabC FeedC doAbsOrInc doMoveXC doMoveZC doMoveCC doFeedRate EOL
END
NEXTArcSegment
END
ELSE
EACHQuadrant
SeqLabC doAbsOrInc formatArc doFeedRate EOL
NEXTQuadrant
END
ELSE {implies OD Tool}
IF RotaryMill?
EACHArcSegment
CalcCAng
IF XMove? OR ZMove? OR CMove?
SeqLabC FeedC doAbsOrInc doMoveXC doMoveZC doMoveCC doFeedRate EOL
END
NEXTArcSegment
ELSE
EACHQuadrant
SeqLabC doAbsOrInc formatArc doFeedRate EOL
NEXTQuadrant
END
END
END
RETURN

tpThreadFeat:
SeqLabC 'G32' MoveXC MoveZC ThrdLead EOL
RETURN

toolPath:
EACHFeat
IF FirstFeat?
resetSP
END
IF TurningOp?
GetToolTip
IF LastFeat?
tpLastFeat
END
END
IF PointFeat?
tpPointFeat
ELSE
IF RapidFeat?
tpRapidFeat
ELSE
IF LineFeat?
tpLineFeat
ELSE
IF ArcFeat?
tpArcFeat
ELSE
IF TurningOp? AND ThreadFeat?
tpThreadFeat
END
END
END
END
END
IF LastFeat?
getEP
END
NEXTFeat
restoreAbsOrInc
RETURN

checkRapid:
IF LAST TurningOp?
CRCOffC
IF LAST Threading?
Rapid
ELSE
IF LAST CannedCycle? AND LAST Roughing?
Rapid
ELSE
RapidC
END
END
ELSE
IF LAST Drilling?
RapidC
END
END
RETURN

checkRapid2:
IF TurningOp?
CRCOffC
IF Threading?
Rapid
ELSE
IF CannedCycle? AND Roughing?
Rapid
ELSE
RapidC
END
END
ELSE
IF Drilling?
RapidC
END
END
RETURN

checkPass:
Plane2
SetPass1
IF NOT TurningOp?
IF Autocycle?
SetPass2
END
END
RETURN

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

autoCycCutSub2: {part 2}
toolPath
SetAbs
SeqLabC CRCOffC
IF Repeats? AND FeedConnect? AND ZshiftOnly?
ELSE
RapidC doMillCP2
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

doSepSubContour:
SetPass1
IF FaceTool?
TrackZNO# SPZ#
ELSE {implies OD Tool}
TrackXNO# SPX#
END
startSub
RapidF#
IF AutoCycle?
NewProg
autoCycCutSub1 {build element sub}
IF FaceTool?
TrackZNO# SPZ#
ELSE {implies OD Tool}
TrackXNO# SPX#
END
autoCycCutSub2
ELSE
toolPath
finishSub1
SeqLabC EndSub EOL
CloseSub
END
SetPass1
SetStatusRapid
RapidF#
SetSRXYtoEP
IF FaceTool?
TrackZNO# ZOpCP#
ELSE {implies OD Tool}
TrackXNO# XOpCD#
END
TrackCNO# Recall# Num#('4') { cOpEP }
RETURN

doSepSubFeedConnect:
IF FeedConnect?
IF CMove?
AngleFeedC
ELSE
FeedEntC
END
END
RETURN

doSepSubSPMove:
SetStatusOff
IF RotaryMill?
CalcSCAng
IF FaceTool?
IF SPXMove? OR CMove?
IF Rotations? OR AutoCycle?
SetInc
END
SeqLabC Connect doMoveSXC doMoveCC doSepSubFeedConnect EOL
SetAbs
ELSE
Connect
END
ELSE {implies OD Tool}
IF SPZMove? OR CMove?
IF Rotations? OR AutoCycle?
SetInc
END
SeqLabC Connect doMoveSZC doMoveCC doSepSubFeedConnect EOL
SetAbs
ELSE
Connect
END
END
ELSE
IF FaceTool?
IF SPXMove? OR SPYMove?
IF AutoCycle?
SetInc
END
SeqLabC Connect doMoveSXC doMoveSYC doSepSubFeedConnect EOL
SetAbs
ELSE
Connect
END
ELSE {implies OD Tool}
IF SPYMove? OR SPZMove?
IF AutoCycle?
SetInc
END
SeqLabC Connect doMoveSYC doMoveSZC doSepSubFeedConnect EOL
SetAbs
ELSE
Connect
END
END
END
SetStatusOn
RETURN

doSepSubDMoves:
IF FeedConnect?
SeqLabC FeedC ZInPlusInc FeedEnt EOL
ELSE
IF FeedEntry?
IF NOT FirstCycle?
SeqLabC RapidC ZCP2PlusInc EOL
END
SeqLabC Feed ZInPlusInc FeedEnt EOL
ELSE
IF FirstCycle? AND AutoCycle?
Rapid
END
SeqLabC RapidC ZInPlusInc EOL
END
END
SeqLabC SubCall CallLab EOL
IF NOT FeedConnect? AND NOT AbsValue?
IF FaceTool?
TrackZNO# ZCP2PlusInc#
IF NOT Equal? ZCP2PlusInc# ZOpCP#
SeqLabC doMillCP2 EOL
END
IF NOT AutoCycle?
TrackZNO# ZOpECP#
END
ELSE {implies OD Tool}
TrackXNO# ZCP2PlusInc#
IF NOT Equal? ZCP2PlusInc# XOpCD#
SeqLabC doMillCP2 EOL
END
IF NOT AutoCycle?
TrackXNO# XOpECD#
END
END
END
RETURN

setSepSubD:
SetAbs
IF FaceTool?
TrackZNO# ADD# SPZ# MUL# RepsLess1# RepeatZ#
ELSE {implies OD Tool}
TrackXNO# ADD# SPX# MUL# RepsLess1# RepeatX#
END
SetInc
RETURN

doSepSubExit:
IF NOT AbsValue?
setSepSubD
END
IF AutoCycle?
SeqLabC Rapid doMillCP2 EOL
ELSE
Rapid {Will be output at millingOp ZCP3 - DWB}
END
RETURN

resetSepSubSR:
SetPass1
SetStatusRapid
RapidF#
IF FaceTool?
TrackXNO# Recall# Num#('1') { xOpEP }
ELSE
TrackZNO# Recall# Num#('3') { zOpEP }
END
TrackYNO# Recall# Num#('2') { yOpEP }
TrackCNO# Recall# Num#('4') { cOpEP }
RETURN

doOnlyRepAutoCycle:
doSepSubContour
EachCycle
IF NOT FirstCycle?
doSepSubSPMove
END
doSepSubDMoves
NextCycle
IF FeedConnect?
doSepSubExit
END
SeqLabC EndSub EOL
CloseSub
{Element shift, not pattern}
autoCycPat {write pattern moves and main calls}
resetSepSubSR
IF FaceTool?
TrackZNO# ZOpCP#
ELSE {implies OD Tool}
TrackXNO# XOpCD#
END
RETURN

doOnlyRep:
doSepSubContour
EachCycle
IF NOT FirstCycle?
doSepSubSPMove
END
doSepSubDMoves
NextCycle
resetSepSubSR
IF FeedConnect?
doSepSubExit
ELSE {implies OD Tool}
IF FaceTool?
TrackZNO# ZOpECP#
ELSE
TrackXNO# XOpECD#
END
END
RETURN

milling:
IF AutoCycle?
NewProg
autoCycCutSub1
entryMove
autoCycCutSub2
autoCycPat
ELSE
entryMove
toolPath
END
RETURN

g92Sub:
subWarning
stdSub
SetAbs
SeqLabC Connect doStartPos EOL
milling
finishSub1
finishSubG92
RETURN

millingOp:
SeqLabC doMillCP2C EOL
IF Repeats?
NewProg
IF ZshiftOnly?
IF AutoCycle? {incremental Autocycle sub can have Z moves}
doOnlyRepAutoCycle
ELSE {Z shift only, NOT Auto Cycle}
SetFlag('1') { Milling ZShiftOnly SepSubs activated }
doOnlyRep
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 doMillCP3C EOL
setSRXYtoACEP
ELSE
SeqLabC CRCOffC RapidC doMillCP3C EOL
END
RETURN

skipToLastFeat:
EachFeat
{*IF LastFeat?*}
IF FaceTool?
TrackXNO# SPX#
ELSE
TrackZNO# SPZ#
END
TrackYNO# SPY#
CalcSCAng
TrackCNO# MoveC#
{*END*}
NextFeat
RETURN

setDrillEndOpD:
IF FaceTool?
IF RetractToCP1?
TrackZNO# ThisOpEntryZCP#
ELSE
TrackZNO# ZOpCP#
END
ELSE {implies OD Tool}
IF RetractToCP1?
TrackXNO# ThisOpEntryXCP#
ELSE
TrackXNO# XOpCD#
END
END
RETURN

doCycle:
IF FIDRO?
'G82'
ELSE
IF FIRO?
'G81'
ELSE
IF FIFO?
'G85'
ELSE
IF Peck?
IF PeckChipBreaker?
'G831'
ELSE
'G83'
END
ELSE
IF Tap?
IF CWSpindle?
'G84'
ELSE
'G841'
END
END
END
END
END
END
RETURN

doDrillStartPos:
IF FaceTool?
IF RotaryMill?
XSP CalcSCAng MoveC
ELSE
XSP MoveSY CalcSCAng MoveC
END
ELSE {implies OD Tool}
IF RotaryMill?
ZSP CalcSCAng MoveC
ELSE
MoveSY ZSP CalcSCAng MoveC
END
END
RETURN

doDrillDepth:
IF FaceTool?
MoveSZC
ELSE
MoveSXC
END
RETURN

doRLevel:
{R level is the distance from CP1 to CP2 - JHE}
SetStatusOff
IF RetractToCP1?
IF FaceTool?
'R' ThisOpEntryZCP#
ELSE
'R' ThisOpEntryXCP#
END
ELSE
IF FaceTool?
'R' ZOpCP#
ELSE
'R' XOpCD#
END
END
SetStatusOn
RETURN

doPeck:
IF Peck?
'Q' Peck#
END
RETURN

doDwell:
IF Dwell?
'P' Dwell#
END
RETURN

drillingOp:
SeqLabC doDrillCP EOL
GetCycle
IF RetractToCP1?
SeqLabC 'G198' EOL
ELSE
SeqLabC 'G199' EOL
END
SeqLabC doCycle doDrillDepth doRLevel doPeck doDwell FeedEnt EOL
IF CallMasterOp?
SeqLabC SubCall CallLabB CallMasterNum# EOL
skipToLastFeat
ELSE
IF FaceTool?
TrackZNO# SPZ#
ELSE
TrackXNO# SPX#
END
IF MasterOp?
SetFlag('1') { DrillSubs activated }
NewMasterProg
SeqLabC SubCall CallLab EOL
startSub
toolPath
SeqLabC EndSub EOL
CloseSub
SetFlagF('1') { DrillSubs deactivated }
ELSE
toolPath
END
END
setDrillEndOpD
IF NOT Rotations?
SeqLabC DrillOff EOL
SeqLabC Rapid doMillCP3 EOL
END
RETURN

rotateStartPosC:
IF FaceTool?
TrackXNO# Recall# Num#('1') { xOpEP }
IF RotaryMill?
MoveSXC CalcSCAng MoveC
ELSE
TrackYNO# Recall# Num#('2') { yOpEP }
MoveSXC MoveSYC CalcSCAng MoveC
END
ELSE {implies OD Tool}
TrackZNO# Recall# Num#('3') { zOpEP }
IF RotaryMill?
MoveSZC CalcSCAng MoveC
ELSE
TrackYNO# Recall# Num#('2') { yOpEP }
MoveSYC MoveSZC CalcSCAng MoveC
END
END
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 FaceTool? AND RetractToCP1? AND Equal? ThisOpEntryZCP# ZOpECP#
SeqLabC rotateStartPosC EOL
ELSE
IF FaceTool? AND NOT RetractToCP1? AND Equal? ZOpCP# ZOpECP#
SeqLabC rotateStartPosC EOL
ELSE
IF NOT FaceTool? AND RetractToCP1? AND Equal? ThisOpEntryXCP# XOpECD#
SeqLabC rotateStartPosC EOL
ELSE
IF NOT FaceTool? AND NOT RetractToCP1? AND Equal? XOpCD# XOpECD#
SeqLabC rotateStartPosC EOL
ELSE { Need to cancel Drill Cycle between Rotations }
SeqLabC DrillOff EOL
SeqLabC Rapid doMillCP3 EOL
SeqLabC rotateStartPosC EOL
SeqLabC doDrillCP EOL
SeqLabC doCycle doDrillDepth doRLevel doPeck doDwell FeedEnt EOL
END
END
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 Rapid doMillCP3 EOL
END
END
END
IF LastRotation?
EachFeat
IF LastFeat?
IF PointFeat?
CalcSCAng
ELSE
CalcCAng
END
TrackCNO# MoveC# EOL
END
NextFeat
END
NextRotation
IF FaceTool?
TrackXNO# Recall# Num#('1') { xOpEP }
TrackZNO# ZOpECP#
ELSE
TrackXNO# XOpECD#
TrackZNO# Recall# Num#('3') { zOpEP }
END
TrackYNO# Recall# Num#('2') { yOpEP }
RETURN

roughingCycle:
SetPass2
IF RoughContour?
SeqLabC LCycle toolSeqP toolSeqQ
IF ApproachID?
NegSideLathe
XStkLeft
PosSideLathe
ELSE
XStkLeft
END
ZStkLeft CutDepth FeedRate EOL
IF ApproachFace?
toolSeqPN StepMove ZSP EOL
SeqLabC FeedC XSP EOL
ELSE { ODApproach/IDApproach }
toolSeqPN StepMove XSP EOL
SeqLabC FeedC ZSP EOL
END
ELSE
IF RoughPatternShift?
SeqLabC LCycle toolSeqP toolSeqQ
IF ApproachID?
NegSideLathe
XStkLeft
PosSideLathe
ELSE
XStkLeft
END
ZStkLeft XminusU ZminusW NumCuts FeedRate EOL
IF ApproachFace?
toolSeqPN StepMove ZSP EOL
SeqLabC FeedC XSP EOL
ELSE { ODApproach/IDApproach }
toolSeqPN StepMove XSP EOL
SeqLabC FeedC ZSP EOL
END
END
END
toolPath
toolSeqQN2
IF AutoFinish?
SeqLabC 'G70' toolSeqP toolSeqQ EOL
END
SetPass1
TrackXNO# CycleStartX#
TrackZNO# CycleStartZ#
RETURN

threadCycle:
IF NOT ConstantVolumeCut? AND NOT SingleEdgeCut?
SeqLabC 'G92X' FirstMoveEPX# FinZ XTapAtZ ThrdLead EOL
SimpleRough
SeqLabC XatFinZ EOL
IF AutoFinish?
SeqLabC XatFinZ EOL
END
ELSE
SeqLabC LCycle XatFinZ FinZ
IF Taper?
XTapAtZ
END
ThrdHeight CutDepth ThrdLead 'A' InFeedAngle# EOL
IF AutoFinish?
SeqLabC 'G92' XatFinZ FinZ XTapAtZ ThrdLead EOL
END
END
RETURN

drillingCycles:
IF Tap?
SeqLabC LCycle ZDepth 'E' FeedIPR# EOL
SeqLabC SpinOff EOL
SeqLabC 'G4P2000' EOL
SeqLabC Speed InverseSpinOn EOL
SeqLabC ZSP EOL
ELSE
IF Peck?
SeqLabC LCycle ZDepth Dwell Peck Retract
IF PeckFullRetract?
'R1'
END
FeedRate EOL
IF AutoFinish?
SeqLabC Feed ZDepth EOL
IF Dwell?
SeqLabC 'G4P' Dwell# EOL
END
SeqLabC Rapid ZSP EOL
END
END
END
RETURN

latheOp:
IF CannedCycle?
StockOff
IF Roughing?
roughingCycle
ELSE
IF Threading?
threadCycle
ELSE
IF Drilling?
drillingCycles
END
END
END
ELSE
StockOn
SetPass1
toolPath
END
IF Drilling? AND Tap?
SeqLabC SpinOff EOL
SeqLabC 'G4P2000' EOL
SeqLabC Speed SpinOn EOL
END
RETURN

opGuts:
IF TurningOp?
latheOp
ELSE
IF FaceTool? AND AutoCycle? AND RotaryMill?
'*************************************' EOL
'WARNING!!! Patterns and Thread Milling are not supported' EOL
' in Face Operations !!!' EOL
'*************************************' EOL
END
IF Rotations?
rotaryReps
ELSE
IF Milling?
millingOp
ELSE
IF Drilling?
drillingOp
END
END
END
END
RETURN

progStart:
InitProg
SetAbs
PosSideLathe
StandardXZArcs
SetFlood
SetMaxRPM('5000')
IF Metric?
SetMaxFeed('12700')
SetArcSegmentAccuracy('.0127') {Added - JHE}
ELSE
SetMaxFeed('500')
SetArcSegmentAccuracy('.0005') {Changed from .001 - JHE}
END
toolSeqInit
Save# Num#('1') Num#('0') { xOpEP }
Save# Num#('2') Num#('0') { yOpEP }
Save# Num#('3') Num#('0') { zOpEP }
Save# Num#('4') Num#('0') { cOpEP }
SetFlagF('1') { Milling dShiftOnly SepSubs deactivated }
SetFlagF('9') { For valid Drill Rotation Sub }
SetFlag('10') {True for Fanuc Control with Standard G-codes}
{False for Fanuc Control with Special G-codes}
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
END
RETURN

initOp:
EOR EOL
ProgID1 EOL
IF UseComments?
IF ProgramNameComment?
'( ' 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 ABSOLUTE INCHES )' EOL
END
END
'N01G28U0' EOL
'N02G28V0W0M41' EOL { High Gear }
'N03' DrillOff 'M45' EOL { Rotating Tool Cancel Couple }
'N04M01' EOL
OpenSub
restoreScale
RETURN

getGearRange:
IF Roughing? OR Drilling?
'M40' { Low Gear }
ELSE
'M41' { High Gear }
END
RETURN

checkGearRange: { SameTool NewGear }
IF NotEqual? SpeedRPM# LAST SpeedRPM#
IF Roughing? OR Drilling?
IF LAST NOT Roughing? AND LAST NOT Drilling?
getGearRange
END
ELSE
IF NOT Roughing? AND NOT Drilling?
IF LAST Roughing? OR LAST Drilling?
getGearRange
END
END
END
END
RETURN

firstOp1:
' ' EOL
StockOff
SetHome
toolSeq
IF EmptyLine?
' '
END
EOL
doOpComments
doPostScript
checkPass
SeqLabC 'G30U0V0W0' getGearRange EOL
SeqLabC OpToolID LatheOffset '00' EOL
SeqLabC 'G30U0V0W0' EOL
IF TurningOp?
{SeqLabC 'M46' EOL} { C-Axis Connection Cancel - Turning Mode }
SeqLabC 'G143' EOL { Automatic Tool Nose Radius Compensation Enable Mode }
SeqLabC 'G23' EOL { Stored Stroke Check Off }
IF ConstantSurfaceFeed?
SeqLabC Preset MaxRPM EOL
'G18G99' CSSOn 'G96'
ELSE
'G18G99' CSSOff 'G97'
END
SeqLabC Speed doSpinOn EOL
ELSE
SeqLabC 'G30U0V0W0M45' EOL
SeqLabC OpToolID LatheOffset '00' EOL
SeqLabC 'G30U0V0W0' EOL
SeqLabC 'G28H0.M43' EOL
SeqLabC Preset 'C0.' EOL
TrackCNO# Num#('0')
SeqLabC 'G98M44' EOL
SeqLabC 'G140' EOL { Automatic Tool Nose Radius Compensation Cancel Mode }
SeqLabC 'G23' EOL { Stored Stroke Check Off }
IF FaceTool?
'G17'
ELSE
'G19'
END
SeqLabC CSSOff 'G97' Speed doSpinOn EOL
END
RETURN

partsCatcherAdvance:
IF CutOff?
SeqLabC 'G04P1.M63' EOL
END
RETURN

partsCatcherRetract:
IF CutOff?
SeqLabC 'G04P.5M64' EOL
END
RETURN

turnApproach:
partsCatcherAdvance
RapidF# { RapidF# Forces FeedRate }
SeqLabC Rapid ThisOpEntryZCP CoolOn EOL
IF ApproachOD?
SeqLabC ThisOpEntryXCP EOL
ELSE
IF ApproachID?
SeqLabC XOpCD EOL
ELSE {ApproachFace}
SeqLabC stockOnNoCan XSP StockOff EOL
END
END
RETURN

turnApproachSP:
IF SameTool?
partsCatcherAdvance
END
IF ApproachFace?
SeqLabC stockOnNoCan XSPC EOL
SeqLabC StockOff ZOpCPC EOL
stockOnNoCan
IF NotEqual? CycleStartZ# ZOpCP#
SeqLabC feedNoCan ZSPC feedRateNoCan EOL
END
ELSE { OD/ID Approach }
SeqLabC stockOnNoCan ZSPC EOL
SeqLabC StockOff XOpCDC EOL
stockOnNoCan
IF NotEqual? CycleStartX# XOpCD#
SeqLabC feedNoCan XSPC feedRateNoCan EOL
END
END
RETURN

millApproach:
RapidF# { RapidF# Forces FeedRate }
SeqLabC Rapid ThisOpEntryZCP CoolOn EOL
SeqLabC
IF FaceTool?
XSP
ELSE {implies OD Tool}
ThisOpEntryXCP
END
IF RotaryMill?
'Y0.'
TrackYNO# SPY#
ELSE
MoveSY
END
CalcSCAng MoveC EOL
RETURN

millApproachSP:
SeqLabC RapidC
IF FaceTool?
XSPC
END
IF SameTool?
IF RotaryMill?
'Y0.'
TrackYNO# SPY#
ELSE
MoveSYC
END
END
IF NOT FaceTool?
ZSPC
END
CalcSCAng MoveCC EOL
setAngleUnder360
IF Milling?
IF FaceTool?
SeqLabC ZOpCPC EOL
ELSE {implies OD Tool}
SeqLabC XOpCDC EOL
END
END
RETURN

newToolOp1: {Finish off last Operation}
StockOff
checkRapid
IF LAST ApproachOD?
SeqLabC LAST OpExitXCPC EOL
ELSE
IF LAST ApproachID?
SeqLabC LAST XOpECDC EOL
END
END
SeqLabC LAST OpExitZCPC CoolOff EOL
RETURN

newToolOp2:
doEndOpPS
IF LAST TurningOp?
IF LAST ConstantSurfaceFeed?
CSSOff 'G97'
END
ELSE
'G99'
END
SeqLabC 'G30U0' EOL
SeqLabC 'G30V0W0'
IF LAST NOT TurningOp?
'M45'
END
EOL
IF LAST ProgStop?
SeqLabC 'M00' EOL
ELSE
SeqLabC ProgStop EOL
END
IF LAST TurningOp? AND NOT TurningOp?
' ' EOL
'N5000' CoolOff EOL
SeqLabC DrillOff SpinOff EOL
SeqLabC Preset 'S2000P2' EOL
SeqLabC ProgStop EOL
END
RETURN

newToolOp3: {Start new Operation}
' ' EOL
toolSeq
IF EmptyLine?
' '
END
EOL
doOpComments
doPostScript
checkPass
IF TurningOp?
SeqLabC 'G30U0V0W0' getGearRange EOL
SeqLabC OpToolID LatheOffset '00' EOL
SeqLabC 'G30U0V0W0' EOL
IF LAST NOT TurningOp?
{SeqLabC 'M46' EOL} { C-Axis Connection Cancel - Turning Mode }
END
SeqLabC 'G143' EOL { Automatic Tool Nose Radius Compensation Enable Mode }
SeqLabC 'G23' EOL { Stored Stroke Check Off }
IF ConstantSurfaceFeed?
SeqLabC Preset MaxRPM EOL
'G18G99' CSSOn 'G96'
ELSE
'G18G99' CSSOff 'G97'
END
SeqLabC Speed doSpinOn EOL
ELSE
SeqLabC 'G30U0V0W0M45' EOL
SeqLabC OpToolID LatheOffset '00' EOL
SeqLabC 'G30U0V0W0' EOL
SeqLabC 'G28H0.M43' EOL
SeqLabC Preset 'C0.' EOL
TrackCNO# Num#('0')
SeqLabC 'G98M44' EOL
SeqLabC 'G140' EOL { Automatic Tool Nose Radius Compensation Cancel Mode }
SeqLabC 'G23' EOL { Stored Stroke Check Off }
IF FaceTool?
'G17'
ELSE
'G19'
END
SeqLabC CSSOff 'G97' Speed doSpinOn EOL
END
RETURN

sameToolOp1:
StockOff
doOpComments
checkRapid
checkPass
IF ApproachOD?
IF LAST ApproachOD?
SeqLabC LAST XOpECDC EOL
ELSE {around}
IF LAST ApproachID?
SeqLabC LAST XOpECDC EOL
END
SeqLabC LAST OpExitZCPC EOL
SeqLabC LAST OpExitXCPC EOL
END
ELSE
IF ApproachID?
IF LAST ApproachID?
SeqLabC LAST XOpECDC EOL
ELSE
IF LAST ApproachOD? {around}
SeqLabC LAST OpExitXCPC EOL
END
SeqLabC LAST OpExitZCPC EOL
SeqLabC XOpCDC EOL
END
ELSE {ApproachFace}
IF LAST ApproachFace?
SeqLabC LAST ZOpECPC EOL
ELSE
IF LAST ApproachOD? {around}
SeqLabC LAST OpExitXCPC EOL
ELSE {LAST ApproachID}
SeqLabC LAST XOpECDC EOL
END
SeqLabC LAST OpExitZCPC EOL
END
END
END
RETURN

sameToolOp2:
doEndOpPS
IF LAST ProgStop?
SeqLabC 'M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqLabC CoolOff EOL
END
END
IF NewToolOffset?
SeqLabC OpToolID LatheOffset '00' EOL
END
SeqLabC checkGearRange EOL { NewGear }
IF TurningOp?
IF ConstantSurfaceFeed?
CSSOn
IF LAST ConstantSurfaceFeed?
IF NotEqual? MaxRPM# LAST MaxRPM#
SeqLabC Preset MaxRPM EOL
END
IF LAST ProgStop?
'G96' Speed
ELSE
IF NotEqual? SpeedRPM# LAST SpeedRPM#
'G96' Speed
END
END
ELSE
SeqLabC Preset MaxRPM EOL
'G96' Speed
END
ELSE
CSSOff
IF LAST ConstantSurfaceFeed?
'G97' Speed
ELSE
IF LAST ProgStop?
'G97' Speed
ELSE
IF NotEqual? SpeedRPM# LAST SpeedRPM#
'G97' Speed
END
END
END
END
ELSE
SpeedC
END
IF LAST ProgStop?
SeqLabC {SpeedC} SpinOn EOL
SeqLabC CoolOn EOL
ELSE
SeqLabC {SpeedC} EOL
IF NOT CoolOff? AND LAST CoolOff?
SeqLabC CoolOn EOL
END
END
doPostScript
RETURN

endOp1: {finish last operation}
StockOff
checkRapid2
IF ApproachOD?
SeqLabC OpExitXCPC EOL
ELSE
IF ApproachID?
SeqLabC XOpECDC EOL
END
END
SeqLabC OpExitZCPC CoolOff EOL
RETURN

endOp2:
doEndOpPS
IF TurningOp?
IF ConstantSurfaceFeed?
CSSOff 'G97'
END
ELSE
'G99'
END
SeqLabC 'G30U0' EOL
SeqLabC 'G30V0W0'
IF NOT TurningOp?
'M45'
END
EOL
IF TurningOp?
partsCatcherRetract
END
IF ProgStop?
SeqLabC 'M00' EOL
ELSE
SeqLabC ProgStop EOL
END
RETURN

endOp3:
' ' EOL
SeqLabC 'G18G97G99M41' EOL { High Gear }
SeqLabC 'G28U0V0W0' EOL
SeqLabC 'M03S350' EOL
IF TurningOp? AND CutOff?
SetLineStrtChr('/')
SeqLabC 'M99' EOL
SetLineStrtChr('')
END
SeqLabC EOP EOL
CloseSub
IF TurningOp? AND CutOff?
' ' EOL
SeqLab 'M98P1234 ( BARSTOP )' EOL { Gets output to start of Main Text File }
END
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

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

progStart
EachOp
GetLCycle
IF FirstOperation?
initOp
firstOp1
IF TurningOp?
turnApproach
turnApproachSP
ELSE
millApproach
millApproachSP
END
ELSE
IF NewTool?
newToolOp1
newToolOp2
newToolOp3
IF TurningOp?
turnApproach
turnApproachSP
ELSE
millApproach
millApproachSP
END
ELSE
sameToolOp1
sameToolOp2
IF TurningOp?
turnApproachSP
ELSE
millApproachSP
END
END
END
opGuts
NextOp
endOp1
endOp2
endOp3


Wyszukiwarka

Podobne podstrony:
Seiki Multi [CD] L825 17
Cd wykł 17 12 10
4 Termometr cyfrowy – dioda półprzewodnikowa ocieplanie 5k cd śr 17 045
dictionary 17 20

więcej podobnych podstron