K & T 180 Type C&D M523 82 6


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

{10/10/92
Copied & modified: K & T 180 Type C M177.81.1
For: FN Manufacturing
This Post Processor outputs long hand and supports Repeats, AutoCycles and MultipleParts.
Changes made per conversations, faxes and sample program supplied by Michael A. Giugliano.
Changed FORMATs from non-decimal w/ trailing zeros to decimal w/ trailing zeros in both
Prog and Mach Spec.
Added PostScript support for WorkFixtureOffsets back in.
Deleted all occurances of M19 Spindle Key Lock which is now handled through PostScript.
Added PostScript support for OptCyc1, M19 Spindle Key Lock and G88 Canned Boring Cycle.
Moved DoPostScript call to before OpToolID to output M19 prior to ToolChng command.
Added following subs to ADD -5 inches Dead Band Zone to all Z positions.
LoadZ, SPZShift, EPZShift, Start, Finish, GetZCP1, GetPrimeZCP2, GetZCP2, GetDrillCP, GetZDepth,
GetZIn and GetZCP3.
Replaced LastFeatExtend with routine to Cancel CRCOff on LastFeat of ToolPath.
Deleted 7 blocks of literal code created for Angelus Can at FirstOperation.
Deleted all occurances of M25 By Pass Offsets.
Changed all occurances of OfstOn to GetZCP1 ToolOfst.
Variables 1, 2 and 3 control MultipleParts OneToolAllParts.
Variable 8 stores Z position to go to.
Variable 9 stores the constant value of -5 for Dead Band Zone.
Flag 1 is set at ZonlyRepAutoCycle for correct ExitMove positioning.
Flag 2 is set at AutoCycCutSub2 for correct ZCP2 positioning.
Flag 3 is set at GetZCP1 for unconditional ZCP1 positioning.
DWB}

{10/28/92
Modified: K & T 180 Type C&D M523.82.1
For: FN Manufacturing
Added PostScriptComments for support of OptionalCycle1.
Changed ToolComment$ to TrimToolComment$('5') at FirstOperation.
Changed PreToolComment$ to SetNextToolOp TrimToolComment$('5') at FirstOperation and NewTool.
DWB}

{11/9/92
Modified: K & T 180 Type C&D M523.82.2
For: FN Manufacturing
Added Additional support of OptionalCycle1 at ToolPath.
Outputs literal 'G4F2.' Milling Feature Dwell IF LastFeat AND NOT AutoCycle = TRUE.
Deleted RapidC 'Z20.0000P0' RapidFC at NewTool.
Deleted X10.0000Y15.0000' at NewTool.
DWB}

{11/19/92
Modified: K & T 180 Type C&D M523.82.3
For: FN Manufacturing
Changed ToolOfst at GetZCP1 to literal 'P0', Tool Length Cancel, to avoid overtravel alarm.
Added Flag(4) to output conditional ToolOfst when ZCP2 or ZIn for Milling, or DrillCP or
ZDepth for Drilling, is output.
Purpose is to not output ToolOfst on block by itself, conditionally ( i.e. ToolOfstC ).
Flag(4) is set to TRUE when ZCP1 is output.
Flag(4) is set to FALSE when ToolOfst is output.
Added GetToolOfst sub.
Outputs ToolOfst IF Flag?(4) = TRUE, and EmptyLine? = FALSE.
Called from EntryMove and DrillStuff subs and at IF Milling at common point.
DWB}

{5/14/93
Modified: K & T 180 Type C&D M523.82.4
For: FN Manufacturing
Updated to Version 4.1 per LongHand M001.81.3 Format.
Changes made per Michael A. Giugliano at FN Manufacturing
Updated to Version 4.1 per LongHand M001.81.3 Format.\
Moved call to CheckRotate to StartPos block at FirstOperation, NewTool, SameTool and MPLoop.
Added call to CheckRotate to StartPos block at EndPartSub.
Added PostScript support for OptCyc1, G88 Canned Boring Cycle at DrillStuff.
Added literal 'P0' at GetZCP3 sub IF LastOp? OR NEXT NewTool? = TRUE.
DWB}

{2/4/94
Modified: K & T 180 Type C&D M523.82.5
For: FN Manufacturing
Versions: ncCad 4.32/ncCAM 4.32/ncPost 4.32.02/Compost 4.21.20
Changes made per Sample Part, Fax and Phone Conversations with Michael A. Giugliano at FN Mfg.
Updated to Version 4.2 per LongHand M001.81.3 Format.
Increased existing Variables 8 and 9 to 10 and 11.
Added Variables 8 and 9 for MultiplePart WorkFixtureOffset control.
Added Helix Subroutines to support Helical Arcs in all Planes.
Added FORMAT#9, '+####.###0;0', for ArcZRads#.
Added DIV# and SUB# to FORMAT#6.
Added Var(12) to store the incremental length of the Linear Axis Move.
Added Var(13) to store the incremental length of the Arc on the circumfrence.
Added Var(14) to store the Ratio of the LineLength to the ArcLength.
IF LineLength > 10% of ArcLength, FeedRate must be converted to G93 InverseTime FeedRate Mode.
Value of conversion is stored in VAR(13), irgo, InverseTime FeedRate = Arc Length.
Added Flag(5) set to TRUE when ArcFeat is Helical.
Set To False at start of ToolPath.
Added Flag(6) set to TRUE when LineLength > 10% of ArcLength for InverseTime FeedRate Mode.
Set To False at start of ToolPath and G94 IPM blocks.
Added CkHelix sub.
Sets Flag(5) when ArcFeat is Helical.
Sets Flag(6) IF Flag?(5) = TRUE and LineLength > 10% of ArcLength.
Tests and Sets Flag(4) and outputs literal 'P0' to cancel any active ToolLengthOffset.
Added ArcRadian sub to output correct I, J or K Address of Linear Axis of Helical Arc.
Called from FormatArc
Added GetG93 sub to output literal 'G93' for InverseTime FeedRates IF Flag?(6) = TRUE.
Added GetG94 sub to output literal 'G94' for IPM to Cancel G93, InverseTime FeedRates.
Called from ExitMove, ExitMove2, StdLine, and ToolPath RapidFeat, LineFeat and ArcFeat.
Added GetRapidFC sub to force RapidF on G94 IPM block.
Called from ExitMove, ExitMove2, and ToolPath RapidFeat
Added GetFeedRateC sub to force FeedRate on G94 IPM block.
Called from StdLine, and ToolPath LineFeat
Added GetArcFeedC sub to output 'F' ArcLength# on G93 InverseTime block, or force ArcFeed on
G94 IPM Block.
Called from ToolPath ArcFeat
Added GetFeedEntC sub to force FeedEnt on G94 IPM Retract block.
Called from ExitMove, ExitMove2
Added logic to control G94/G93 situations for consecutive Arcs.
NOTE: Manual states that Programming Condition requires TOOL LENGTH COMPENSATION (P) CANNOT BE
IN EFFECT when circular motion combined with one axis linear motion is programmed.
Moved CRCOnC to StrtPos at FirstOperation, NewTool and SameTool.
Moved CRCOffC to NewTool, SameTool and end of Prog.
Customer requested handling of CutterRadiusCompensation outside the ToolPath for the purpose of
not turning CRCOff for consecutive SameTool operations.
Deleted CkCRC and CkCRCOffset subs and all calls to same.
Deleted CRCOffC at ToolPath RapidFeat and LineFeat.
Deleted LastFeatExtend output at end of ToolPath.
Added GetCRCOfstOff sub.
Outputs literal 'D0'.
Added GetCRCOfst sub.
Outputs either CRCOffsetC or literal 'D0'.
Added Flag(7) to suppress RapidC and RapidFC at SameTool StrtPos.
Customer plans on programming operations that do not retract the tool between SameTool Operations.
i.e. LAST EPZ# = LAST ZCP3 = ZCP2 = ZIn.
Have limited this feature to IF Milling? AND NOT Repeats? AND NOT AutoCycle?
Flag(7) tested at EntryMove.
Added CkRapidC sub.
Suppresses RapidC.
Added CkRapidFC sub.
Suppresses RapidFC.
DWB}

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

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(ToolDiameter#,4) {.72}
FORMAT(Tag#,5)
FORMAT(RapidF#,5)
FORMAT(Program#,5) {.72}
FORMAT(Operation#,5) {.72}
FORMAT(Tool#,5) {.72}
FORMAT(Parts#,5) {.72}
FORMAT(DIV#,6)
FORMAT(SUB#,6)
FORMAT(Dwell#,6) {.72}
FORMAT(NewWFO#,7) {.72}
FORMAT(Recall#,8)
FORMAT(ADD#,8)
FORMAT(TrackX#,8)
FORMAT(TrackY#,8)
FORMAT(TrackZ#,8)
FORMAT(ArcZRads#,9)

{Helix Subroutines *********************************************************}

CkHelix:
IF XYPlane? AND ZMove?
SetFlag('5')
SetStatusOff
SetAbs
Save# Num#('12') SUB# SPZ# EPZ# { LineLength }
ELSE
IF XZPlane? AND YMove?
SetFlag('5')
SetStatusOff
SetAbs
Save# Num#('12') SUB# SPY# EPY# { LineLength }
ELSE
IF YZPlane? AND XMove?
SetFlag('5')
SetStatusOff
SetAbs
Save# Num#('12') SUB# SPX# EPX# { LineLength }
END
END
END
IF Flag?('5') { Helix }
IF NOT Flag?('4') { ToolOfst }
SetFlag('4')
SeqC 'P0' EOL { Tool Length Offset Cancel }
END
SetFlagF('6') { IPM Mode }
Save# Num#('13') DIV# MUL# ArcR# ArcAngle# Num#('57.2958') { ArcLength }
Save# Num#('14') DIV# Recall# Num#('12') Recall# Num#('13') { LineLength Ö ArcLength }
IF GreaterThan? Recall# Num#('14') Num#('.1') { LineLength > 10% of ArcLength }
SetFlag('6') { InverseTime }
END
IF AutoCycle?
SetInc
ELSE
SetAbsOrInc
END
SetStatusOn
END
RETURN

ArcRadian:
IF Flag?('5') { Helix }
IF XYPlane?
'K'
ELSE
IF XZPlane?
'J'
ELSE { YZPlane }
'I'
END
END
ArcZRads#
END
RETURN

GetG93:
IF Flag?('6') { Helix InverseTime }
'G93' { InverseTime }
END
RETURN

GetG94:
IF Flag?('6') { Helix InverseTime }
'G94' { IPM }
END
RETURN

GetRapidFC:
IF Flag?('6') { Helix InverseTime }
SetFlagF('5') { Helix }
SetFlagF('6') { Helix InverseTime }
RapidF
ELSE
RapidFC
END
RETURN

GetFeedRateC:
IF Flag?('6') { Helix InverseTime }
SetFlagF('5') { Helix }
SetFlagF('6') { Helix InverseTime }
FeedRate
ELSE
FeedRateC
END
RETURN

GetArcFeedC:
IF Flag?('5') AND Flag?('6') { Helix InverseTime }
FORMAT(Recall#,6)
'F' Recall# Num#('13') { ArcLength }
FORMAT(Recall#,8)
ELSE
IF Flag?('6')
SetFlagF('5') { Helix }
SetFlagF('6') { InverseTime }
ArcFeed
ELSE
ArcFeedC
END
END
RETURN

GetFeedEntC:
IF Flag?('6') { Helix InverseTime }
SetFlagF('5') { Helix }
SetFlagF('6') { Helix InverseTime }
FeedEnt
ELSE
FeedEntC
END
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

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

DoCycleComment:
IF UseComments? AND SubComment?
'( CYCLE START )' EOL
END
RETURN

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

PSInit: {reset flags}
NewWFOF
RotateF
OptCyc1F
RETURN

PSStuff: {revised.72}
RETURN

CheckRotate:
IF FourthCW?
FORMAT(FourthDegree#,2)
'B' FourthDegree#
FourthCWF {reset flag}
END
IF FourthCCW?
FORMAT(FourthDegree#,3)
'B' FourthDegree#
FourthCCWF {reset flag}
END
RETURN

CheckOptCyc1:
IF Drilling? AND FIFO? AND OptCyc1? { Spindle Key Lock for use w/ G88 Boring Cycle }
IF SameTool? AND LAST NOT ProgStop?
SeqC SpinOff EOL
SeqC 'M19' EOL
SeqC SpinOn EOL
ELSE
SeqC 'M19' EOL
END
END
RETURN

DoPostScript:
PSInit
EachPS
SeqC PostScript EOL {literals}
PSStuff {commands}
NextPS
RETURN

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

LoadZ:
LoadFeat Num#('0') Num#('0') Recall# Num#('10')
RETURN

SPZShift:
IF SPZMove?
'Z' ADD# SPZ# Recall# Num#('11')
TrackZNO# SPZ#
END
RETURN

DoEPZ:
'Z' ADD# EPZ# Recall# Num#('11')
TrackZNO# EPZ#
RETURN

EPZShift:
IF Flag?('3') { ZCP1 }
DoEPZ
ELSE
IF AutoCycle?
IF Flag?('2') { AutoCycCutSub2 }
IF ZMove?
DoEPZ
END
ELSE
MoveZC
END
ELSE
IF ZMove?
DoEPZ
END
END
END
RETURN

Start:
SetAddZToolOffsetF
SetStatusOff
SetAbs
RETURN

Finish:
IF Repeats? AND AnyZShift? AND NOT FirstCycle?
Save# Num#('10') SUB# Recall# Num#('10') CurOriginPosZ#
END
SetStatusOn
LoadZ
SetAddZToolOffset
IF Flag?('1') { ZonlyRepAutoCycle }
SetInc
ELSE
SetAbsOrInc
END
EPZShift
RETURN

GetZCP1:
Start
Save# Num#('10') ClearancePlane1#
SetFlag('3')
Finish
SetFlagF('3')
RETURN

GetPrimeZCP2:
Start
Save# Num#('10') PRIME ClearancePlane2#
Finish
RETURN

GetZCP2:
Start
Save# Num#('10') ClearancePlane2#
Finish
RETURN

GetDrillCP:
Start
IF RetractToCP1?
Save# Num#('10') ClearancePlane1#
ELSE
Save# Num#('10') ClearancePlane2#
END
Finish
RETURN

GetZDepth:
Start
Save# Num#('10') ZDepth#
Finish
RETURN

GetZIn:
IF AutoCycle?
ZInC
ELSE
Start
Save# Num#('10') FIRST SPZ#
Finish
END
RETURN

GetZCP3:
Start
Save# Num#('10') ClearancePlane3#
Finish
IF LastOp?
'P0'
ELSE
IF NEXT NewTool?
'P0'
END
END
RETURN

GetToolOfst:
IF Flag?('4')
IF NOT EmptyLine?
SetFlagF('4') { ToolOfst }
ToolOfst
END
END
RETURN

EntryMove:
IF FeedEntry?
IF Flag?('7')
LoadFeat Num#('0') Num#('0') FIRST SPZ#
IF ZMove?
SetFlagF('7')
END
END
IF NOT Flag?('7')
SeqC FeedC GetZIn FeedEntC GetToolOfst EOL
END
ELSE
SeqC RapidC GetZIn RapidFC GetToolOfst EOL
END
RETURN

GetConnect:
IF FeedConnect?
FeedC
ELSE
RapidC
END
RETURN

GetConnectF:
IF FeedConnect?
FeedEntC
ELSE
RapidFC
END
RETURN

ExitMove:
IF FeedConnect?
IF NOT AutoCycle?
IF NOT NoZMoves?
SeqC GetG94 FeedC GetZIn GetFeedEntC EOL
END
END
ELSE
SeqC GetG94
IF FIFO? { .81 }
FeedC
ELSE
RapidC
END
GetPrimeZCP2
IF FIFO? { .81 }
GetFeedEntC
ELSE
GetRapidFC
END
EOL
END
RETURN

ExitMove2:
IF FIFO?
GetG94 FeedC GetZCP3 GetFeedEntC
ELSE
GetG94 RapidC GetZCP3 GetRapidFC
END
RETURN

CycleWarning:
{ NOTE: This Post Processor takes care of Z Clearance. }
RETURN

FormatArc:
IF ArcCW?
CWArc
ELSE
CCWArc
END
MoveXY EPZShift ArcIJ ArcRadian
RETURN

StdLine: {enables CRC on first call, .70}
IF Decelerate?
IF RoomToDecel?
DecelMove1
SeqC GetG94 FeedC MoveXYC EPZShift GetFeedRateC EOL
DecelMove2
END
SeqC GetG94 FeedC MoveXYC EPZShift DecelFeed EOL
ELSE
IF XMove? OR YMove? OR ZMove?
SeqC GetG94 FeedC MoveXYC EPZShift GetFeedRateC EOL
END
END
RETURN

ToolPath:
SetFlagF('5') { Helix }
SetFlagF('6') { InverseTime }
EACHFeat
IF PointFeat? { Drilling Only }
IF NOT FirstFeat?
SeqC
IF Drilling? AND FIFO? AND OptCyc1?
'G88' { Boring Cycle for use w/ M19 Spindle Key Lock }
ELSE
Cycle
END
MoveSXYC SPZShift
SetStatusOff
'R' ADD# ClearancePlane2# Recall# Num#('11')
SetStatusOn
Peck FeedEnt EOL
END
SeqC DrillOff EOL
SeqC Rapid GetDrillCP RapidF EOL
ELSE
IF RapidFeat?
IF LastFeat? AND AutoCycle? {.70}
SeqC GetG94 RapidC MoveXYC EPZShift GetRapidFC EOL
ELSE
IF XMove? OR YMove? OR ZMove?
SeqC GetG94 RapidC MoveXYC EPZShift GetRapidFC EOL
END
END
ELSE
IF LineFeat?
IF AutoCycle? {.70}
IF LastFeat?
SeqC GetG94 FeedC MoveXYC EPZShift GetFeedRateC EOL
ELSE
IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps}
SeqC GetG94 FeedC MoveXYC EPZShift GetFeedRateC EOL
ELSE
StdLine {enables CRC on first call}
END
END
ELSE
StdLine
END
ELSE
IF ArcFeat?
IF Flag?('5') { LastFeat Helix }
SetFlagF('5')
IF Flag?('6') { LastFeat InverseTime }
CkHelix
IF Flag?('5') AND Flag?('6')
ELSE
GetG94
END
ELSE
CkHelix
GetG93
END
ELSE
CkHelix
GetG93
END
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
IF LastQuadrant? AND Decelerate?
IF RoomToDecel?
DecelMove1
SeqC FormatArc GetArcFeedC EOL
DecelMove2
END
SeqC FormatArc DecelFeed EOL
ELSE
SeqC FormatArc GetArcFeedC EOL
END
NEXTQuadrant
END
END
END
IF AutoCycle?
SetAbs
Save# Num#('6') SUB# EPX# CurOriginPosX#
Save# Num#('7') SUB# EPY# CurOriginPosY#
SetInc
END
END
NEXTFeat
IF OptCyc1? AND Milling? AND NOT AutoCycle?
SeqC 'G4F2.' EOL { Dwell }
END
RETURN

WFOStuff:
IF NewWFO?
IF MultipleParts?
'*** WARNING *** DO NOT USE NEWWFO() WITH NCPOST MULTIPLE PARTS' EOL
IF NOT SameTool?
IF WorkFixtureOffsets?
SeqC 'G48H' Recall# Num#('9') EOL
END
END
ELSE
SeqC 'G48H' NewWFO# EOL
END
ELSE
IF NOT SameTool?
IF MultipleParts? AND WorkFixtureOffsets?
SeqC 'G48H' Recall# Num#('9') EOL
ELSE
IF FirstOperation? AND NeedWFO1?
SeqC 'G48H1' EOL
END
END
END
END
RETURN

AutoCycCutSub1: {part 1}
CalcACSRXY {calc tool position, CalcAutoCycleStatusRecordXY}
SaveSubStatus {save tool position}
SetPass1 {element cut moves}
SetSRXYtoSP
SeqC IncValue EOL
RETURN

AutoCycCutSub2: {part 2}
SetFlag('2')
IF FIFO? {.81}
SeqC AbsOrInc FeedC GetZCP2 FeedEntC EOL {.71.2 removed CRCOffC, gets turned off in ToolPath}
ELSE
SeqC AbsOrInc RapidC GetZCP2 RapidFC EOL
END
SetFlagF('2')
SetSRSubXY {restore SR to 1st position value}
ReSetPass2 {restore for positioning moves}
RETURN

Milling:
EntryMove
ToolPath
RETURN

XYZRep:
CycleWarning
FindAnyZMoves
EachRep
DoCycleComment
IF FirstCycle?
EntryMove
ELSE
SeqC GetConnect StrtPosC GetConnectF EOL
IF FeedConnect?
IF ZshiftOnly?
EntryMove
END
ELSE
IF FeedEntry?
SeqC GetZCP2 EOL
END
EntryMove
END
END
ToolPath
ExitMove
NextRep
RETURN

NoRepAutoCycle:
EACHFeat
DoCycleComment
IF SPXMove? OR SPYMove?
SeqC RapidC MoveSXYC RapidFC EOL
END
AutoCycCutSub1
Milling
AutoCycCutSub2
NEXTFeat
RETURN

XYZRepAutoCycle:
CycleWarning
EachRep
EACHFeat
DoCycleComment
IF SPXMove? OR SPYMove?
SeqC GetConnect MoveSX MoveSY GetConnectF EOL
END
SetAbs
Save# Num#('4') SPX#
Save# Num#('5') SPY#
SetInc
AutoCycCutSub1
Milling
AutoCycCutSub2
SetAbs
TrackXNO# ADD# Recall# Num#('4') Recall# Num#('6')
TrackYNO# ADD# Recall# Num#('5') Recall# Num#('7')
SetAbsOrInc
NEXTFeat
NextRep
RETURN

ZonlyRepAutoCycle:
EACHFeat
DoCycleComment
IF SPXMove? OR SPYMove?
SeqC GetConnect MoveSXYC GetConnectF EOL
END
AutoCycCutSub1
EachRep
IF FirstCycle?
EntryMove
ELSE
IF NOT FeedConnect?
SetFlag('1')
ExitMove
SetFlagF('1')
END
DoCycleComment
IF SPXMove? OR SPYMove?
SeqC GetConnect MoveSXYC GetConnectF EOL
END
IF NOT FeedConnect?
EntryMove
END
END
ToolPath
NextRep
AutoCycCutSub2
ReSetPass2 {restore for positioning moves}
NEXTFeat
RETURN

DrillStuff:
SeqC GetDrillCP GetToolOfst EOL
GetCycle
SeqC
IF Drilling? AND FIFO? AND OptCyc1?
'G88' { Boring Cycle for use w/ M19 Spindle Key Lock }
ELSE
Cycle
END
StrtPos GetZDepth
SetStatusOff
'R' ADD# ClearancePlane2# Recall# Num#('11')
SetStatusOn
Peck FeedEnt GetToolOfst EOL
TrackZNO# FIRST SPZ# {.81.2}
RETURN

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

GetStartOfSameTool:
DoPartCycleComment
DoOpComments
DoPostScript
CheckOptCyc1
WFOStuff
CheckPass
RETURN

GetCRCOfstOff:
IF LAST CutterRadiusCompensation?
'D0'
ResetCRCNum {.72}
END
RETURN

GetCRCOfst:
IF CutterRadiusCompensation?
CRCOffsetC
ELSE
'D0'
END
RETURN

CkRapidC: { called from IF SameTool? }
IF Flag?('7')
IF Milling? AND NOT Repeats? AND NOT AutoCycle?
LoadFeat Num#('0') Num#('0') ClearancePlane2#
IF ZMove?
SetFlagF('7')
END
ELSE
SetFlagF('7')
END
END
IF NOT Flag?('7')
RapidC
END
RETURN

CkRapidFC: { called from IF SameTool? }
IF NOT Flag?('7')
RapidFC
END
RETURN

MasterSub:
IF FirstOperation?
IF MultipleParts? AND OneToolAllParts? AND NOT FirstPart?
ELSE
IF ToolChangeAtHome?
SetHome
END
Seq AbsOrInc 'G94G71' Plane
'X' TrackX# Num#('10')
'Y' TrackY# Num#('15')
'Z' TrackZ# Num#('20')
RapidF 'T' TrimToolComment$('5') EOL
DoPartCycleComment
DoOpComments
DoPostScript
CheckOptCyc1
SeqC ToolChng EOL
WFOStuff
CheckPass
SeqC AbsOrInc 'G94G71' Plane CRCOnC Rapid StrtPos GetZCP1 CheckRotate RapidF Speed
IF NOT LastTool?
'T' SetNextToolOp TrimToolComment$('5')
END
'P0' GetCRCOfst SpinOn CoolOn EOL
SetFlag('4') { ToolOfst }
END
ELSE
IF NewTool?
IF MultipleParts? AND OneToolAllParts? AND NOT FirstPart?
ELSE

{Finish off last Operation}

SeqC CoolOff EOL
SeqC CRCOffC GetCRCOfstOff EOL
DoEndOpPS
IF LAST ProgStop?
SeqC 'M0' EOL
ELSE
SeqC ProgStop EOL
END

{Start new Operation}

DoPartCycleComment
DoOpComments
DoPostScript
CheckOptCyc1
SeqC ToolChng EOL
WFOStuff
CheckPass
Seq AbsOrInc 'G94' Plane CRCOnC Rapid StrtPos GetZCP1 CheckRotate RapidF Speed
'T' SetNextToolOp TrimToolComment$('5') 'P0' GetCRCOfst SpinOn CoolOn EOL
END
SetFlag('4') { ToolOfst }
ELSE
IF SameTool?
DoEndOpPS
IF LAST ProgStop?
SeqC CoolOff EOL
SeqC CRCOffC RapidC 'Z' TrackZ# Num#('20') 'P0' RapidFC GetCRCOfstOff EOL
SeqC 'M0' EOL

{Start new Operation}

GetStartOfSameTool
SeqC PlaneC CRCOnC Rapid StrtPos GetZCP1 CheckRotate RapidF SpeedC 'P0' CRCOffsetC SpinOn CoolOn EOL
SetFlag('4') { ToolOfst }
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
IF NewToolOffset?
SeqC CRCOffC RapidC 'Z' TrackZ# Num#('20') 'P0' RapidFC GetCRCOfstOff EOL

{Start new Operation}

GetStartOfSameTool
SeqC PlaneC CRCOnC RapidC StrtPos GetZCP1 CheckRotate RapidFC SpeedC 'P0' CRCOffsetC EOL
SetFlag('4') { ToolOfst }
ELSE
IF NOT CutterRadiusCompensation?
CRCOffC
IF NOT EmptyLine?
SeqC GetCRCOfstOff EOL
END
END

{Start new Operation}

GetStartOfSameTool
SeqC PlaneC CRCOnC CkRapidC StrtPos CheckRotate CkRapidFC SpeedC CRCOffsetC EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqC CoolOn EOL
END
END
END
END
END {common point for all operations}
IF Milling?
SeqC GetZCP2 GetToolOfst EOL
IF AutoCycle?
IF Repeats?
IF ZshiftOnly?
ZonlyRepAutoCycle
ELSE
XYZRepAutoCycle
END
IF NOT FeedConnect?
SeqC ExitMove2 EOL
END
ELSE
NoRepAutoCycle
SeqC ExitMove2 EOL
END
ELSE { NOT AutoCycle }
IF Repeats?
XYZRep
SeqC ExitMove2 EOL
ELSE
Milling
LoadFeat Num#('0') Num#('0') ClearancePlane3#
IF ZMove?
SetFlagF('7')
SeqC ExitMove2 EOL
ELSE
SetFlag('7')
END
END
END
ELSE
IF Drilling?
IF Repeats?
EachRep
DoCycleComment
DrillStuff
ToolPath
NextRep
ELSE
DrillStuff
ToolPath
END
IF RetractToCP1? {.81}
TrackZNO# ClearancePlane1#
ELSE
TrackZNO# ClearancePlane2#
END
SeqC RapidC GetZCP3 RapidFC EOL
END
END
RETURN

EndPartSub:
{End of program ************************************************************}

{finish last operation}
SeqC CoolOff EOL
SeqC CRCOffC RapidC 'Z' TrackZ# Num#('20') RapidFC
IF CutterRadiusCompensation?
'D0'
ResetCRCNum {.72}
END
EOL
IF MultipleParts? AND OneToolAllParts? AND WorkFixtureOffsets?
SeqC 'G' Recall# Num#('8') EOL
END
DoEndOpPS
SeqC
'X' TrackX# Num#('10')
'Y' TrackY# Num#('15')
IF Rotate?
CheckRotate
ELSE
'B-0'
END
EOL
IF ProgStop?
SeqC 'M0' EOL
ELSE
IF MultipleParts? AND AllToolsOnePart? AND NOT LastPart?
SeqC ProgStop EOL
END
END
RETURN

MPLoop:
TagInit
IF AllToolsOnePart?
Save# Num#('9') Recall# Num#('8') { NewWFO# }
EachPart
TagInc
EachOp
MasterSub
NextOp
EndPartSub
Save# Num#('9') ADD# Recall# Num#('9') Num#('1') { NewWFO# }
NextPart
ELSE { OneToolAllParts }
Save# Num#('2') Recall# Num#('1')
IF LTEqual? Recall# Num#('1') Recall# Num#('3')
EachOp
IF Equal? Operation# Recall# Num#('2')
Save# Num#('2') ADD# Operation# Num#('1')
IF NewTool?
IF Equal? Recall# Num#('1') Recall# Num#('3')
Save# Num#('2') Operation#
ELSE
IF NotEqual? Recall# Num#('1') SUB# Recall# Num#('2') Num#('1')
Save# Num#('2') SUB# Operation# Num#('1')
END
END
END
END
NextOp
EachPart
TagInc
EachOp
IF GTEqual? Operation# Recall# Num#('1')
IF LTEqual? Operation# Recall# Num#('2')
IF Equal? Operation# Recall# Num#('1')
IF FirstPart?
Save# Num#('9') Recall# Num#('8') { NewWFO# }
ELSE
Save# Num#('9') ADD# Recall# Num#('9') Num#('1') { NewWFO# }

{Finish off last Operation}

{DoEndOpPS}
IF FullUp? OR LAST ProgStop?
SeqC CoolOff EOL
SeqC RapidC 'Z' TrackZ# Num#('20') 'P0' RapidFC EOL
SeqC 'M0' EOL

{Start new Operation}

GetStartOfSameTool
SeqC PlaneC Rapid StrtPos GetZCP1 CheckRotate RapidF SpeedC 'P0' SpinOn CoolOn EOL
SetFlag('4') { ToolOfst }
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
IF NewToolOffset?
SeqC RapidC 'Z' TrackZ# Num#('20') 'P0' RapidFC EOL
SeqC ProgStop EOL

{Start new Operation}

GetStartOfSameTool
SeqC PlaneC RapidC StrtPos GetZCP1 CheckRotate RapidFC SpeedC 'P0' EOL
SetFlag('4') { ToolOfst }
ELSE

{Start new Operation}

GetStartOfSameTool
SeqC PlaneC RapidC StrtPos CheckRotate RapidFC SpeedC EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqC CoolOn EOL
END
END
END
END
MasterSub
END
END
NextOp
NextPart
Save# Num#('1') ADD# Recall# Num#('2') Num#('1')
END
END
RETURN

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

{setup and initializations}
InitProg
ReverseXZArcs
SetAddZToolOffset
InitWFONum
SetFlood
SetMaxRPM('10000')
SetMaxFeed('500')
Save# Num#('1') Num#('0') { This Tool FirstOp# }
Save# Num#('2') Num#('0') { This Tool LastOp# }
Save# Num#('3') Num#('0') { LastOp# }
Save# Num#('4') Num#('0') { XPos Status Register Updated Position for Repeated AutoCycles }
Save# Num#('5') Num#('0') { YPos Status Register Updated Position for Repeated AutoCycles }
Save# Num#('6') Num#('0') { LastFeat EPX# AbsPosValue for Repeated AutoCycles }
Save# Num#('7') Num#('0') { LastFeat EPY# AbsPosValue for Repeated AutoCycles }
Save# Num#('8') Num#('0') { This NewWFO# }
Save# Num#('9') Num#('0') { NewWFO# counter }
Save# Num#('10') Num#('0') { CurZPos }
Save# Num#('11') Num#('-5') { DeadZone }
Save# Num#('12') Num#('0') { Helix LineLength }
Save# Num#('13') Num#('0') { Helix ArcLength }
Save# Num#('14') Num#('0') { Helix LineLength:ArcLength Ratio }
SetFlagF('1') { ZonlyRepAutoCycle }
SetFlagF('2') { AutoCycCutSub2 }
SetFlagF('3') { ZCP1 }
SetFlagF('4') { ToolOfst }
SetFlagF('5') { Helix }
SetFlagF('6') { Helix InverseTime }
SetFlagF('7') { Suppress RapidC and RapidFC for SameTool StraightConnect Operations }
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
' generates a + B move of the value you specify' EOL
' 4thAxisCCW(22.5), 4ACCW(22.5) -' EOL
' generates a - B move of the value you specify' EOL
' OptionalCycle1, OptCyc1 -' EOL
' This command supports M19 Spindle Key Lock with G88 Boring Cycle. The operation must' EOL
' be a Drilling Feed In - Feed Out type. The M19 will be output prior to the M6 Tool' EOL
' Change command for First Operation and New Tool situations. For Same Tool situations,' EOL
' an M5 Spindle Off command will be output prior to the M19 command. In addition to' EOL
' this, instead of outputting the normal G86 Boring Cycle, G88 will be output instead.' EOL
' OptionalCycle1, OptCyc1 -' EOL
' This command also supports Dwelling at the end of the ToolPath. For any Milling' EOL
' Operation, not including AutoCycles, a G4F2. will be output after the Last Feature.' EOL
END
EOR EOL
IF UseComments?
IF ProgramNameComment?
'(NAM, ' ProgramName$ ' )' EOL
END
IF ProgramComment?
'(MSG, ' ProgramComment$ ' )' EOL
END
IF FormatNameComment?
'(MSG, FORMAT: ' FormatName$ ' )' EOL
END
IF TimeComment?
'(MSG, ' Date$ ' AT ' Time$ ' )' EOL
END
IF MovesComment?
'(MSG, OUTPUT IN ' MoveType$ ' INCHES )' EOL
END
IF PartsComment?
'(MSG, PARTS PROGRAMMED: ' Parts# ' )' EOL
END
IF StartToolComment?
'(MSG, FIRST TOOL NOT IN SPINDLE )' EOL
END
END
OpenSub
RestoreScale
IF MultipleParts?
Save# Num#('1') Num#('1')
Save# Num#('8') NewWFO#
EachOp
IF LastOp?
Save# Num#('3') Operation#
END
NextOp
MPLoop
IF OneToolAllParts?
MPLoop MPLoop MPLoop MPLoop MPLoop
MPLoop MPLoop MPLoop MPLoop MPLoop
MPLoop MPLoop MPLoop MPLoop MPLoop
MPLoop MPLoop MPLoop MPLoop MPLoop
MPLoop MPLoop MPLoop MPLoop MPLoop
EndPartSub
ELSE
IF WorkFixtureOffsets?
SeqC 'G' Recall# Num#('8') EOL
END
END
ELSE
EachOp
MasterSub
NextOp
EndPartSub
END
SeqC EOP EOL
Post
Close
IF UseComments?
SetScale('1') {restore scale for comments}
Reopen
IF FileBytesComment?
'(MSG, FILE LENGTH: ' FileBytes# ' CHARACTERS )' EOL
END
IF FileFeetComment?
'(MSG, FILE LENGTH: ' FileFeet# ' FEET )' EOL
END
IF FileMetersComment?
'(MSG, FILE LENGTH: ' FileMeters# ' METERS )' EOL
END
Close
END


Wyszukiwarka

Podobne podstrony:
K & T 180 Type C M177 82 1
Fanuc 2000C Mazak L168 82
Fanuc 10T MS [2 G54] L066 82
function ingres field type
Output Section Type
GE 550T LeBlonde L082 82
programowanie kluczyka Jaguar x type
Fanuc 0T (Anzon1) L077 82 1m
36 (82)
BooleanControl Type
Fanuc 3TF Tak TS LTM L263 82 2

więcej podobnych podstron