Heid TNC 151 BP M139 15 1m


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

{9/23/88
Copied & Modified: Heidenhain TNC 145C M082.53
For: Galaxy Die & Engineering.
Machine:
Control: Heidenhain TNC 145C
Modified to have only 1 space between codes.
Added L address before Z moves.
Use Speed from ncCam.
Modified SpinOn to be M13 [CW] and M14 [CCW].
Added first and last lines.
Added M6 after tool call.
Deleted CoolOn and CoolOff commands.
JR}

{11/15/88
Updated: Heid TNC 151 BP M139.55
For: Galaxy Die & Engineering.
Changed all RapidF to 'F3999'.
Deleted LBL 1 thru LBL 0 lines, toolchange subroutine, from beginning of prog.
Moved HomePos & CP1 after M06 in FirstOp & NewTool.
Changed M05 to M25 for spindle up.
Added missing FORMAT for ZDepth#.
Changed ClearancePlane2# in Milling to ZCP2.
Added FORMAT #9 for cycle defs SETUP & PECKG that require a negative sign which is literal.
Deleted ZDepth# preceding IncValue and following AbsOrInc.
Changed ZDepth# in PECKG to ZDepthInc#, using FORMAT #9.
Changed FORMAT for ClearancePlane2# to FORMAT #9.
Changed FORMAT for Peck# to FORMAT #9.
JR}

{7/24/90, Added InitProg globally to posts with this remark, DWB}

{11/29/90
Modified: Heid TNC 151 BP M139.58
For: Phoenix Machine & Design
Machine: Interact 412
Control: Heidenhain TNC 151B/151Q
Updated to Version 3.2 per Fanuc 6M M001.76.1 Format.
Customer requests:
Added SaveProgNum2 and replaced ProgID1 with Program# at beginning and end becuase decimal point
is not allowed in opening statement.
Add ASCII('3') at end to cause DNC to stop sending.
Form changes:
Modified Rapid FeedRate (XXXX^X) from 0 to 3999
Modified 'F' default format from '00^0' to '###^0'
Prog changes:
Cleaned up FORMATs for better readability.
Added SPZ#, EPX#, EPY#, EPZ#, ArcI# and ArcJ# and FORMATs for same, for AutoCycle output
which requires literal 'I' before each axis address to indicate incremental moves.
Added FORMATs for RepeatX#, RepeatY#, RepeatZ#, OriginUnShiftRX#, OriginUnShiftRY# and
OriginUnShiftRZ# for correct output.
Added TLDia#, TLLength# and TLNum# and FORMATs for same, for Tool Definition Loop at beginning.
Added RapidF# and FORMAT for same, and replaced all literal 'F3999' to RapidF for ease of
future conversions.
DWB}

{6/19/92
Updated: Heid TNC 151 BP M139.76.1 to .81 format
Other changes for simplicity and ease of future updates or modifications.
Changed HomeX# & HomeY# to Home
Changed StartPosX# & StartPosY# to StrtPos
Changed all literal L to use the sub DoL
Changed all literal R0 to use the sub DoR0
JR}

{12/16/92
Updated: Heid TNC 151 BP M139.81
For: Gibbs & Associates
Updated to Version 4.1 per Fanuc 6M M001.81.2 Format.
DWB}

{12/16/92
Modified: Heid TNC 151 BP M139.81.2
For: Gibbs & Associates
Combined routines with Heid TNC 155 M281.81.2m
DWB}

{12/3/93
Modified: Heid TNC 151 BP M139.81.3
For: Gibbs & Associates/Charles via Fructus
Updated to Version 4.2 per Fanuc 6M M001.81.2a Format.
Changes made per conversations with Charles.
Corrected Scaling bug.
Bug was caused by EachTool/NextTool loop for TOOL DEF blocks at FirstOperation.
Bug was discovered when posting Metric Cam File with Metric Post with Comments turned off.
TLDia# was needed to be output as a Radius value, so SetScale(.5) was used.
Comments normally SetScale(1), but when comments are turned off, this doesnt happen.
RestoreScale sub only dealt with Inch Cam Files and Metric Processors, and Vice-Versa.
Added ELSE SetScale(1) at RestoreScale sub.
Deleted SetScale in EachTool/NextTool loop at FirstOperation.
Changed TLDia# to DIV# TLDia# Num#(2) in EachTool/NextTool loop at FirstOperation.
Added FORMAT(DIV#,4) at Prog Numeric Format Definitions.
DWB}

{06Jun97
Original: Heid TNC 151 BP M139.81.4
Created: Heid TNC 151 BP M139.15
For: Greater Machine
Updated to .89 format per Heid TNC 2500 [ESS] M979.89.1
Updated to .15 format
Charles Winston}

{06Jun97
Original: Heid TNC 151 BP M139.15
Created: Heid TNC 151 BP M139.15.1m
For: Greater Machine
Created Metric Version
Changed Default Format 'F" from ###^0 to ###0 in MachSpec
Charles Winston}

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

#1 = '#.00'
#2 = '###.###;0.'
#3 = '*###.###;0.'
#4 = 'ą####0.000'
#5 = '#######0'
#6 = '####0.00'
#7 = '###^0'
#8 = '+####0.000'

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(DIV#,4)
FORMAT(SPZ#,4)
FORMAT(EPX#,4)
FORMAT(EPY#,4)
FORMAT(EPZ#,4)
FORMAT(ArcI#,4)
FORMAT(ArcJ#,4)
FORMAT(ZDepth#,4)
FORMAT(RepeatX#,4)
FORMAT(RepeatY#,4)
FORMAT(RepeatZ#,4)
FORMAT(PartShiftX#,4)
FORMAT(PartShiftY#,4)
FORMAT(PartShiftZ#,4)
FORMAT(OriginUnShiftPX#,4)
FORMAT(OriginUnShiftPY#,4)
FORMAT(OriginUnShiftPZ#,4)
FORMAT(OriginUnShiftRX#,4)
FORMAT(OriginUnShiftRY#,4)
FORMAT(OriginUnShiftRZ#,4)
FORMAT(ToolDiameter#,4) {.72}
FORMAT(TLLength#,4)
FORMAT(TLDia#,4)
FORMAT(TLNum#,5)
FORMAT(Program#,5) {.72}
FORMAT(Program2#,5)
FORMAT(Operation#,5) {.72}
FORMAT(CallMasterNum#,5)
FORMAT(Tool#,5) {.72}
FORMAT(Parts#,5) {.72}
FORMAT(Dwell#,6) {.72}
FORMAT(FeedEntry#,7)
FORMAT(ClearancePlane2#,8)
FORMAT(ZDepthInc#,8)
FORMAT(Peck#,8)

{Special Subs **************************************************************}

DoL:
' L'
RETURN

DoZL:
' L'
RETURN

Space: { 0 Spaces }
''
RETURN

XYZSpace:
'' Space
RETURN

XYSpace:
'' Space Space
RETURN

ZSpace:
'' Space Space Space
RETURN

IXYZSpace:
Space
RETURN

IXYSpace:
Space Space
RETURN

IZSpace:
Space Space Space
RETURN

DoM:
' M'
Return

DoR0:
IF NOT Flag?('3') { ArcFeat }
''
END
IF Flag?('2') { CutterRadiusCompensation }
IF CRCleft?
' RL'
ELSE
' RR'
END
ELSE
' R0'
END
RETURN

RF: { RapidF }
' F0'
Return

ckCRCOff:
IF Flag?('2') { CRCOn }
SetFlagF('2')
SeqLab DoL ' IX+0 IY+0' IXYSpace DoR0 RF DoM EOL
END
RETURN

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

RestoreScale:
IF NOT Metric? { CAM file is in English, tools and tool path }
SetScale('25.4') { change to Metric, this is a Metric post }
ELSE
SetScale('1')
END
RETURN

WFONum:
RETURN

WFOStuff:
{ NOTE: This Post Processor does not support WorkFixtureOffsets. }
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
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
RETURN

PSStuff:
IF FourthCW?
FORMAT(FourthDegree#,2)
SeqLab ' A' FourthDegree# EOL
FourthCWF
END
IF FourthCCW?
FORMAT(FourthDegree#,3)
SeqLab ' A' FourthDegree# EOL
FourthCCWF {reset flag}
END
IF FifthCW?
FORMAT(FifthDegree#,2)
SeqLab ' B' FifthDegree# EOL
FifthCWF
END
IF FifthCCW?
FORMAT(FifthDegree#,3)
SeqLab ' B' FifthDegree# EOL
FifthCCWF
END
RETURN

DoPostScript:
PSInit
EachPS
SeqLab PostScript EOL
PSStuff
NextPS
RETURN

DoEndOpPS:
PSInit
EachEOPS
SeqLab EndOpPS EOL
PSStuff
NextPS
RETURN

EntryMove:
SeqLab DoZL
IF NOT AbsValue?
' IZ' SPZ# IZSpace
ELSE
ZIn ZSpace
END
DoR0
IF FeedEntry?
Feed {no output}
FeedEnt ''
ELSE
RF
END
DoM EOL
RETURN

StartSub:
OpenSub
DoSubComment
SeqLab ' LBL ' Program# 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:
SeqLab ' CALL LBL ' Program# ' REP ' Repeats# '/ ' Repeats# EOL
StartSub
RETURN

FinishSub1: {part 1}
IF NOT FeedConnect?
SeqLab DoZL ZCP3 ZSpace
IF Flag?('2') { CRCOn }
SetFlagF('2')
DoR0
SetFlag('2')
ELSE
DoR0
END
IF AutoCycle?
RF
ELSE
IF FIFO? {.81}
Feed {no output}
FeedEnt ''
ELSE
RF
END
END
DoM EOL
END
ckCRCOff
RETURN

FinishSubG92: {part 2}
SeqLab ' CYCL DEF 7.0 DATUM SHIFT' EOL
SeqLab ' CYCL DEF 7.1 IX' RepeatX# EOL
SeqLab ' CYCL DEF 7.2 IY' RepeatY# EOL
SeqLab ' CYCL DEF 7.3 IZ' RepeatZ# EOL
SeqLab ' LBL 0' EOL
CloseSub
SeqLab ' CYCL DEF 7.0 DATUM SHIFT' EOL
SeqLab ' CYCL DEF 7.1 IX' OriginUnShiftRX#('0') EOL
SeqLab ' CYCL DEF 7.2 IY' OriginUnShiftRY#('0') EOL
SeqLab ' CYCL DEF 7.3 IZ' OriginUnShiftRZ#('0') EOL
RETURN

OpenMP:
IF EquallySpacedOffsets?
NewProg
SeqLab ' CALL LBL ' Program# ' REP ' Parts# ' / ' Parts# EOL
StartSub
ELSE
'( NOTE: This post processor does not support work fixture offsets!!! )' EOL
'( Reprocess using Equally Spaced Offsets!!! )' EOL
END
RETURN

CloseMP:
IF EquallySpacedOffsets?
SeqLab ' CYCL DEF 7.0 DATUM SHIFT' EOL
SeqLab ' CYCL DEF 7.1 IX' PartShiftX# EOL
SeqLab ' CYCL DEF 7.2 IY' PartShiftY# EOL
SeqLab ' CYCL DEF 7.3 IZ' PartShiftZ# EOL
SeqLab ' LBL 0' EOL
CloseSub
SeqLab ' CYCL DEF 7.0 DATUM SHIFT' EOL
SeqLab ' CYCL DEF 7.1 IX' OriginUnShiftPX#('0') EOL
SeqLab ' CYCL DEF 7.2 IY' OriginUnShiftPY#('0') EOL
SeqLab ' CYCL DEF 7.3 IZ' OriginUnShiftPZ#('0') EOL
END
RETURN

DoAbsOrInc:
IF Flag?('1') AND AbsoluteMoves?
IF ZMove? AND AbsValue?
SetInc
ELSE
IF NOT ZMove? AND NOT AbsValue?
SetAbs
END
END
END
RETURN

DoDrillAbsOrInc:
IF Flag?('1') AND AbsoluteMoves?
IF SPZMove? AND AbsValue?
SetInc
ELSE
IF NOT SPZMove? AND NOT AbsValue?
SetAbs
END
END
END
RETURN

RestoreAbsOrInc:
IF Flag?('1') AND AbsoluteMoves? AND NOT AbsValue?
SetAbs
END
RETURN

DoHelix:
SetAbs
'P IPA'
IF ArcCW?
'-'
ELSE
'+'
END
IF Equal? EPMoveAngle# SPMoveAngle# { Full Circle }
'360.000'
ELSE
ABS# SUB# EPMoveAngle# SPMoveAngle#
END
SetInc
IF XYPlane?
' IZ' EPZ#
ELSE
IF XZPlane?
' IY' EPY#
ELSE { YZPlane }
' IX' EPX#
END
END
SetAbs
TrackXNO# EPX#
TrackYNO# EPY#
TrackZNO# EPZ#
IF AutoCycle?
SetInc
ELSE
SetAbsOrInc
END
RETURN

CheckMove:
IF AutoCycle? OR NOT AbsValue?
IF XYPlane?
IF XMove? OR YMove? OR ArcFeat?
' IX' EPX# ' IY' EPY#
IF ZMove?
' IZ' EPZ# IXYZSpace
ELSE
IXYSpace
END
ELSE
IF ZMove?
' IZ' EPZ# IZSpace
END
END
ELSE
IF XZPlane?
IF XMove? OR ZMove? OR ArcFeat?
IF YMove?
' IX' EPX# ' IY' EPY# ' IZ' EPZ# IXYZSpace
ELSE
' IX' EPX# ' IZ' EPZ# IXYSpace
END
ELSE
IF YMove?
' IY' EPY# IZSpace
END
END
ELSE { YZPlane }
IF YMove? OR ZMove? OR ArcFeat?
IF XMove?
' IX' EPX# ' IY' EPY# ' IZ' EPZ# IXYZSpace
ELSE
' IY' EPY# ' IZ' EPZ# IXYSpace
END
ELSE
IF XMove?
' IX' EPX# IZSpace
END
END
END
END
ELSE
IF XYPlane?
IF XMove? OR YMove? OR ArcFeat?
MoveX MoveY
IF ZMove?
MoveZC XYZSpace
ELSE
XYSpace
END
ELSE
IF ZMove?
MoveZC ZSpace
END
END
ELSE
IF XZPlane?
IF XMove? OR ZMove? OR ArcFeat?
IF YMove?
MoveX MoveY MoveZ XYZSpace
ELSE
MoveX MoveZ XYSpace
END
ELSE
IF YMove?
MoveY ZSpace
END
END
ELSE { YZPlane }
IF YMove? OR ZMove? OR ArcFeat?
IF XMove?
MoveX MoveY MoveZ XYZSpace
ELSE
MoveY MoveZ XYSpace
END
ELSE
IF XMove?
MoveX ZSpace
END
END
END
END
END
RETURN

ckCRC:
IF CutterRadiusCompensation?
IF LastFeat?
SetFlagF('2') { CRCOff }
ELSE
IF NOT ZMove?
SetFlag('2') { CRCOn }
END
END
END
RETURN

ckCRCNum:
{ Not Supported }
RETURN

FormatArc:
DoAbsOrInc
SeqLab ' CC'
IF AutoCycle? OR NOT AbsValue? {implies incremental}
' IX' ArcI# ' IY' ArcJ#
ELSE
ArcIJ
END
EOL
SeqLab ' C'
IF XYPlane? AND ZMove?
DoHelix
ELSE
IF XZPlane? AND YMove?
DoHelix
ELSE
IF YZPlane? AND XMove?
DoHelix
ELSE
CheckMove
END
END
END
IF ArcCW?
' DR-' CWArc {no output}
ELSE
' DR+' CCWArc {no output}
END
SetFlag('3')
DoR0
SetFlagF('3')
RETURN

FormatLine:
IF ZMove? AND NOT XMove? AND NOT YMove?
DoZL
ELSE
DoL
END
DoAbsOrInc CheckMove CkCRC DoR0
RETURN

ToolPath:
EACHFeat
IF PointFeat?
IF NOT FirstFeat?
Rapid {no output}
IF AutoCycle?
SeqLab DoL MoveSX MoveSY XYSpace DoR0 RF DoM EOL
ELSE
SeqLab DoL DoDrillAbsOrInc
IF AbsValue?
MoveSX MoveSY
IF SPZMove?
MoveSZ XYZSpace
ELSE
XYSpace
END
ELSE
' IX' SPX# ' IY' SPY# ' IZ' SPZ# IXYZSpace
END
DoR0 RF ' M99' EOL
END
END
IF AutoCycle?
SeqLab ' CALL LBL ' Program# ' REP' EOL
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
END
ELSE
IF RapidFeat?
Rapid {no output}
IF XMove? OR YMove? OR ZMove?
SeqLab FormatLine RF DoM EOL
END
ELSE
IF LineFeat?
Feed {no output}
IF XMove? OR YMove? OR ZMove?
IF Decelerate?
IF RoomToDecel?
DecelMove1
SeqLab FormatLine FeedRate '' DoM EOL
DecelMove2
END
SeqLab FormatLine DecelFeed '' DoM EOL
ELSE
SeqLab FormatLine FeedRate '' DoM EOL
END
END
ELSE
IF ArcFeat?
EACHQuadrant
IF LastQuadrant? AND Decelerate?
IF RoomToDecel?
DecelMove1
FormatArc ArcFeed '' DoM EOL
DecelMove2
END
FormatArc DecelFeed '' DoM EOL
ELSE
FormatArc ArcFeed '' DoM EOL
END
NEXTQuadrant
END
END
END
END
NEXTFeat
RestoreAbsOrInc
RETURN

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

AutoCycCutSub2: {part 2}
ToolPath
SetAbs
IF Repeats? AND FeedConnect? AND ZshiftOnly?
{.69 removed RapidC} {.71.2 removed CRCOffC, gets turned off in ToolPath}
ELSE
SeqLab DoL ZCP2 DoR0
IF FIFO? {.81}
FeedEnt
ELSE
RF
END
DoM EOL
END
SeqLab ' LBL 0' 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
SetAbs
SeqLab DoL StrtPos XYSpace DoR0
IF FeedConnect?
FeedEnt ''
ELSE
RF
END
DoM EOL
Milling
FinishSub1
FinishSubG92
RETURN

ZonlyRepAutoCycle:
AutoCycPat {write pattern moves and main calls}
StartSub
NewProg
EachCycle
SetSRXYtoEP
IF FeedConnect?
IF NOT FirstCycle?
IF SPXMove? OR SPYMove?
SetInc
SeqLab DoL ' IX' SPX# ' IY' SPY# IXYSpace DoR0 FeedRate '' DoM EOL
AbsOrInc
END
END
SeqLab DoZL ZInPlusInc ZSpace DoR0 FeedEnt '' DoM EOL
ELSE
IF NOT FirstCycle?
IF SPXMove? OR SPYMove?
SetInc
SeqLab DoL ' IX' SPX# ' IY' SPY# DoR0 RF DoM EOL
AbsOrInc
IF FeedEntry?
SeqLab DoZL ZCP2PlusInc ZSpace DoR0 RF DoM EOL
SeqLab DoZL ZInPlusInc ZSpace DoR0 FeedEnt '' DoM EOL
ELSE
SeqLab DoZL ZInPlusInc ZSpace DoR0 RF DoM EOL
END
ELSE
IF FeedEntry?
SeqLab DoZL ZCP2PlusInc ZSpace DoR0 RF DoM EOL
SeqLab DoZL ZInPlusInc ZSpace DoR0 FeedEnt '' DoM EOL
ELSE
SeqLab DoZL ZInPlusInc ZSpace DoR0 RF DoM EOL
END
END
ELSE
IF FeedEntry?
SeqLab DoZL ZInPlusInc ZSpace DoR0 FeedEnt '' DoM EOL
ELSE
SeqLab DoZL ZInPlusInc ZSpace DoR0 RF DoM EOL
END
END
END
IF FirstCycle?
SetStatusOff {protect Z position for incremental sub}
END
SeqLab ' CALL LBL ' Program# ' REP' EOL
NextCycle
SetStatusOn
AutoCycCutSub1 {build element sub}
AutoCycCutSub2
{.69, removed FinishSub1}
IF FeedConnect? {there is no Z up in the sub, .69}
Rapid {no output}
SeqLab DoZL ZCP2 ZSpace DoR0
IF FIFO? {.81}
FeedEnt ''
ELSE
RF
END
DoM EOL {.69}
END {.69}
SeqLab ' LBL 0' EOL
CloseSub
{Element shift, not pattern}
RETURN

ZonlyRep:
EachCycle
IF NOT FirstCycle?
SeqLab DoL StrtPos XYSpace DoR0
IF FeedConnect?
FeedEnt ''
ELSE
RF
END
DoM EOL
END
IF FeedConnect?
Feed {no output}
SeqLab DoZL ZInPlusInc ZSpace DoR0 FeedEnt '' DoM EOL
ELSE
IF FeedEntry?
IF NOT FirstCycle?
Rapid {no output}
SeqLab DoZL ZCP2PlusIncC ZSpace DoR0 RF DoM EOL
END
Feed {no output}
SeqLab DoZL ZInPlusInc ZSpace DoR0 FeedEnt '' DoM EOL
ELSE
Rapid {no output}
SeqLab DoZL ZInPlusInc ZSpace DoR0 RF DoM EOL
END
END
SeqLab ' CALL LBL ' Program# ' REP' EOL
NextCycle
StartSub
TrackZNO# FIRST SPZ#
ToolPath
FinishSub1
SeqLab ' LBL 0' EOL
CloseSub
RETURN

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

SkipToLastFeat:
EachFeat
IF LastFeat?
TrackXNO# SPX#
TrackYNO# SPY#
END
NextFeat
RETURN

SetDrillEndOpZ:
IF RetractToCP1?
TrackZNO# ClearancePlane1#
ELSE
TrackZNO# ClearancePlane2#
END
RETURN

OpGuts:
IF Milling?
SeqLab DoL ZCP2 DoR0 RF DoM EOL
IF Repeats?
NewProg
IF ZshiftOnly?
IF AutoCycle? {incremental Autocycle sub can have Z moves}
ZonlyRepAutoCycle
ELSE {Z shift only, NOT Auto Cycle}
IF UseSeparateSubCalls? AND CyclesLessThanMaxSubCalls?
SetFlag('1') { Milling ZShiftOnly SepSubs }
ZonlyRep
SetFlagF('1')
ELSE {no sep subs desired}
G92Sub
END
END {end Auto Cycle IF}
ELSE {not Z only}
G92Sub
END {end Z only IF}
ELSE {no repeat OPs}
Milling
END
SeqLab DoL ZCP3 DoR0
IF AutoCycle?
RF
ELSE
IF FIFO? {.81}
FeedEnt
ELSE
RF
END
END
DoM EOL
ELSE
IF Drilling?
IF Repeats?
NewProg
StdSub
SeqLab DoL StrtPos DoR0 RF DoM EOL
END
IF NOT RetractToCP1?
SeqLab DoL ZCP2 DoR0 RF DoM EOL
END
GetCycle
IF Tap?
IF OptCyc1?
SeqLab ' CYCL DEF 17.0 RIGID TAPPING' EOL
SeqLab ' CYCL DEF 17.1 SETUP -' ClearancePlane2# EOL
SeqLab ' CYCL DEF 17.2 DEPTH ' ZDepth# EOL
SeqLab ' CYCL DEF 17.3 PITCH ' FeedTapIPR# ('1') EOL
ELSE
SeqLab ' CYCL DEF 2.0 TAPPING' EOL
SeqLab ' CYCL DEF 2.1 SETUP -' ClearancePlane2# EOL
SeqLab ' CYCL DEF 2.2 DEPTH ' ZDepth# EOL
SeqLab ' CYCL DEF 2.3 DWELL 0' EOL
SeqLab ' CYCL DEF 2.4' FeedEnt EOL
END
ELSE
SeqLab ' CYCL DEF 1.0 PECKING' EOL
SeqLab ' CYCL DEF 1.1 SETUP -' ClearancePlane2# EOL
SeqLab ' CYCL DEF 1.2 DEPTH ' ZDepth# EOL
SeqLab ' CYCL DEF 1.3 PECKG -'
IF Peck?
Peck#
ELSE
ZDepthInc#
END
EOL
SeqLab ' CYCL DEF 1.4 DWELL '
IF Dwell?
Dwell#
ELSE
'0'
END
EOL
SeqLab ' CYCL DEF 1.5' FeedEnt EOL
END
IF CallMasterOp?
SeqLab ' CALL LBL ' CallMasterNum# EOL
SkipToLastFeat
ELSE
TrackZNO# FIRST SPZ#
IF MasterOp?
SetFlag('1') {std sep sub Zreps in effect}
NewMasterProg
SeqLab ' CALL LBL ' Program# EOL
StartSub
SeqLab DoL StrtPos XYSpace DoR0 RF ' M99' EOL
ToolPath
SeqLab ' LBL 0' EOL
CloseSub
SetFlagF('1') {not std sep sub Zreps in effect}
ELSE
SeqLab DoL StrtPos XYSpace DoR0 RF ' M99' EOL
ToolPath
END
END
{SetDrillEndOpZ}
Rapid {no output}
SeqLab DoL ZCP3 DoR0 RF DoM EOL
IF Repeats?
FinishSubG92
END
END
END
RETURN

ProgStart:
InitProg
ReverseXZArcs
UseSeparateSubCalls
SetMaxSeparateSubCalls('50')
SetMaxRPM('10000')
SaveProgNum2
SetFlagF('1') { Milling ZShiftOnly SepSubs }
SetFlagF('2') { CRCOff }
SetFlagF('3') { ArcFeat }
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
' 4thAxisCW(12.5), 4ACW(12.5) -' EOL
' generates a + A move of the value you specify' EOL
' 4thAxisCCW(22.5), 4ACCW(22.5) -' EOL
' generates a - A move of the value you specify' 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
END

IF MultipleParts? AND WorkFixtureOffsets?
SeqLab ' ; *** WARNING *** ' EOL
SeqLab ' ; THIS POST PROCESSOR DOES NOT SUPPORT WORKFIXTURE OFFSETS. ' EOL
SeqLab ' ; PLEASE SELECT EQUALLY SPACED OFFSETS. ' EOL
SeqLab ' ; *** WARNING *** ' EOL
END
RETURN

InitOp:
SeqLab ' BEGIN PGM ' Program# ' MM' EOL
IF ToolChangeAtHome?
SetHome
END
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 ABSOLUTE METERS )' EOL
END
IF PartsComment?
'( PARTS PROGRAMMED: ' Parts# ' )' EOL
END
IF StartToolComment?
'( FIRST TOOL NOT IN SPINDLE )' EOL
END
END
EachTool
SetScale('1')
SeqLab ' TOOL DEF ' TLNum#
RestoreScale
DoL TLLength#
' R' DIV# TLDia# Num#('2') { TLRadius# }
EOL
NextTool
OpenSub
RestoreScale
RETURN

FirstOp1:
DoOpComments
DoPostScript
SetAbs
Plane {no output}
SeqLab ' TOOL CALL ' Tool# ' Z' Speed EOL
SeqLab DoL ' R F M06' EOL
SeqLab DoL Home DoR0 RF DoM EOL
SeqLab DoL ZCP1 DoR0 RF DoM EOL
RETURN

FirstOp2:
CheckPass
SeqLab DoL StrtPos DoR0 RF SpinOn EOL
RETURN

FirstOp3:
RETURN

NewToolOp1:
DoEndOpPS
IF LAST ProgStop?
SeqLab ' STOP M02' EOL
END
RETURN

NewToolOp2:
DoOpComments
DoPostScript
SetAbs
Plane {no output}
RETURN

NewToolOp3: {Start new Operation}
SeqLab ' TOOL CALL ' Tool# ' Z' Speed EOL
SeqLab DoL ' R F M06' EOL
SeqLab DoL Home DoR0 RF DoM EOL
SeqLab DoL ' Z' ClearancePlane1# DoR0 RF DoM EOL
RETURN

NewToolOp4:
CheckPass
SeqLab DoL StrtPos DoR0 RF SpinOn EOL
RETURN

NewToolOp5:
RETURN

SameToolOp1:
DoEndOpPS
IF LAST ProgStop?
SeqLab ' STOP M02' EOL
END
RETURN

SameToolOp2: {Start new Operation}
DoOpComments
DoPostScript
CheckPass
RETURN

SameToolOp3: {Start new Operation}
SetAbs
Plane {no output}
SeqLab DoL StrtPos DoR0 RF DoM EOL
RETURN

End1:
DoEndOpPS
SeqLab DoL Home DoR0 RF ' M25' EOL
RETURN

End2:
SeqLab ' STOP M02' EOL
RETURN

End3:
Post
Close
Reopen
IF UseComments?
SetScale('1') {restore scale for comments}
IF FileBytesComment?
'( FILE LENGTH: ' FileBytes# ' CHARACTERS )' EOL
END
IF FileFeetComment?
'( FILE LENGTH: ' FileFeet# ' FEET )' EOL
END
IF FileMetersComment?
'( FILE LENGTH: ' FileMeters# ' METERS )' EOL
END
END
SeqLab ' END PGM ' Program2# ' MM' EOL
ASCII('3') EOL
Close
Retag
RETURN

MPallTools1P: {Multiple Parts, All Tools 1 Part}
EachOp {Start of post processing}
IF FirstOperation?
InitOp
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 {End of program}
End2
CloseMP
End3
RETURN

MP1ToollAllPfu: {Multiple Parts, 1 Tool all Parts, full up}
EachOp {Start of post processing}
IF FirstOperation?
InitOp
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 {End of program}
CloseMP
End2
End3
RETURN

MP1ToollAllPXcp: {Multiple Parts, 1 Tool all Parts, exit Clearance plane}
EachOp {Start of post processing}
IF FirstOperation?
InitOp
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 {End of program}
End1
End2
End3
RETURN

NoMPs: {no multiple parts}
EachOp {Start of post processing}
IF FirstOperation?
InitOp
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 {End of program}
End2
End3
RETURN

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

ProgStart {setup and initializations}

IF MultipleParts?
IF AllToolsOnePart?
MPallTools1P
ELSE {implied OneToolAllParts?}
IF FullUp?
MP1ToollAllPfu
ELSE {implied ExitClearancePlane?}
MP1ToollAllPXcp
END
END
ELSE
NoMPs
END


Wyszukiwarka