GE Fanuc 18I Komo CQ38 16


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

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

{2/16/99
Initial: Fanuc 6M [FW] NBU99.16 & Siemens 840C Sermill DW30.15.4
Created: GE Fanuc 18i Komo Cxxx.16
ForUser: Creative Automation
Control: GE Fanuc 18i
Machine: Komo VMC 50/240
Develop: Compost2 PPC 1.7b15, Virtual Gibbs 5.05
Comment: New processor per conversations with Mark Streckert and Rick Becker
Set Up MDD for 4th X- and 5th Y-
Part Faces:
Variable number 23 stores which face is up
1=Top 2=Front 3=Right 4=Bottom 5=Back 6=Left
Variable number 25 stores a face orientation variable,
as each face can be oriented up to 4 different ways!
This processor does not support arcs outside the primary plane,
they will be output as linear segments
This processor does not support CRC outside the primary plane.
Approaching part:
From a full retract approach in XYZ.
SameTool without retracting or same operation reposition approach in HVD
SameTool operation on a different face calls the tool change macro.
Coolant options Flood, ThruSpindle and Mist.
Forcing WFOs for face being worked on per machine tool bulders requirements
Customer requested processor control the WFO so he dose not
have to tie a CS# to a face beging worked on.
Processor will error if more than one CS is used per
side to avoid having more that one zero!
Jim Radcliffe}

{Prog Numeric Format Definitions ****}

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(CSOffsetA#,2)
FORMAT(CSOffsetB#,2)
FORMAT(ToolDiameter#,4)
FORMAT(CSOffsetX#,4)
FORMAT(CSOffsetY#,4)
FORMAT(CSOffsetZ#,4)
FORMAT(TrackXNO#,4)
FORMAT(TrackYNO#,4)
FORMAT(TrackZNO#,4)
FORMAT(TrackZ#,4)
FORMAT(Recall#,5)
FORMAT(ADD#,5)
FORMAT(CS#,5)
FORMAT(PartNum#,5)
FORMAT(Program#,5)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(NewWFO#,5)
FORMAT(Parts#,5)
FORMAT(Dwell#,6)
FORMAT(RapidF#,7)

{Added Subroutines ***}

SideReport:
' ' EOL
FORMAT(Recall#,2)
' A = ' Recall# Num#('21') '/' CSOffsetA#
' B = ' Recall# Num#('22') '/' CSOffsetB# EOL
FORMAT(Recall#,5)
' Op# ' Operation# ' - '
IF FirstOperation?
' Starts at Num(23) ' Recall# Num#('23') ' '
ELSE
IF Equal? Recall# Num#('24') Recall# Num#('23')
' Stays at Num(24)=Num(23) ' Recall# Num#('24') '=' Recall# Num#('23') ' '
ELSE
'Indexes From Num(24) ' Recall# Num#('24') ' '
IF Equal? Recall# Num#('24') Num#('1')
'Top'
ELSE
IF Equal? Recall# Num#('24') Num#('2')
'Front'
ELSE
IF Equal? Recall# Num#('24') Num#('3')
'Right'
ELSE
IF Equal? Recall# Num#('24') Num#('4')
'Bottom'
ELSE
IF Equal? Recall# Num#('24') Num#('5')
'Back'
ELSE
IF Equal? Recall# Num#('24') Num#('6')
'Left'
ELSE
'Unknown Side'
END
END
END
END
END
END
EOL
' To Num(23) ' Recall# Num#('23') ' '
END
END
IF Equal? Recall# Num#('23') Num#('1')
'Top'
ELSE
IF Equal? Recall# Num#('23') Num#('2')
'Front'
ELSE
IF Equal? Recall# Num#('23') Num#('3')
'Right'
ELSE
IF Equal? Recall# Num#('23') Num#('4')
'Bottom'
ELSE
IF Equal? Recall# Num#('23') Num#('5')
'Back'
ELSE
IF Equal? Recall# Num#('23') Num#('6')
'Left'
ELSE
'Unknown Side'
END
END
END
END
END
END
EOL
' ClearancePlane1# ' ClearancePlane1# EOL
' ' EOL
RETURN

SaveFace:
{ save to variable #24 the value of variable #3 to represent the previous ops face of the part }
Save# Num#('24') Recall# Num#('23')
{ initialize variable #23 }
Save# Num#('23') Num#('0')
{ save to variable #23 a value to represent the current face of the part }
IF Equal? Recall# Num#('21') Num#('0')
Save# Num#('25') Num#('1')
IF Equal? Recall# Num#('22') Num#('0')
Save# Num#('23') Num#('1') { Top }
END
IF Equal? Recall# Num#('22') Num#('90')
Save# Num#('23') Num#('3') { Right }
END
IF Equal? Recall# Num#('22') Num#('180')
Save# Num#('23') Num#('4') { Bottom }
END
IF Equal? Recall# Num#('22') Num#('270')
Save# Num#('23') Num#('6') { left }
END
END
IF Equal? Recall# Num#('21') Num#('90')
Save# Num#('25') Num#('2')
IF Equal? Recall# Num#('22') Num#('0')
Save# Num#('23') Num#('2') { Front }
END
IF Equal? Recall# Num#('22') Num#('90')
Save# Num#('23') Num#('3') { Right }
END
IF Equal? Recall# Num#('22') Num#('180')
Save# Num#('23') Num#('5') { Back }
END
IF Equal? Recall# Num#('22') Num#('270')
Save# Num#('23') Num#('6') { left }
END
END
IF Equal? Recall# Num#('21') Num#('180')
Save# Num#('25') Num#('3')
IF Equal? Recall# Num#('22') Num#('0')
Save# Num#('23') Num#('4') { Bottom }
END
IF Equal? Recall# Num#('22') Num#('90')
Save# Num#('23') Num#('3') { Right }
END
IF Equal? Recall# Num#('22') Num#('180')
Save# Num#('23') Num#('1') { Top }
END
IF Equal? Recall# Num#('22') Num#('270')
Save# Num#('23') Num#('6') { left }
END
END
IF Equal? Recall# Num#('21') Num#('270')
Save# Num#('25') Num#('4')
IF Equal? Recall# Num#('22') Num#('0')
Save# Num#('23') Num#('5') { Back }
END
IF Equal? Recall# Num#('22') Num#('90')
Save# Num#('23') Num#('3') { Right }
END
IF Equal? Recall# Num#('22') Num#('180')
Save# Num#('23') Num#('2') { Front }
END
IF Equal? Recall# Num#('22') Num#('270')
Save# Num#('23') Num#('6') { left }
END
END
{SideReport}
RETURN

SetPlane:
Plane {no output}
IF Equal? Recall# Num#('23') Num#('1') { Top }
' G17'
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
' G18'
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
' G19'
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
' G17' { We cannot do the bottom of the part }
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
' G18'
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
' G19'
END
RETURN

DoCP1:
FORMAT(ClearancePlane1#,8)
ClearancePlane1#
RETURN

DoNegCP1:
FORMAT(ClearancePlane1#,9)
ClearancePlane1#
RETURN

DoCP2:
FORMAT(ClearancePlane2#,8)
ClearancePlane2#
RETURN

DoNegCP2:
FORMAT(ClearancePlane2#,9)
ClearancePlane2#
RETURN

DoRLevel:
' R'
IF RetractToCP1?
IF Equal? Recall# Num#('23') Num#('1') { Top }
DoCP1
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
DoNegCP1
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
DoCP1
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
DoNegCP1
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
DoCP1
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
DoNegCP1
END
ELSE
IF Equal? Recall# Num#('23') Num#('1') { Top }
DoCP2
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
DoNegCP2
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
DoCP2
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
DoNegCP2
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
DoCP2
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
DoNegCP2
END
END
RETURN

DoZDepth:
FORMAT(SPZ#,8)
FIRST SPZ#
RETURN

DoNegZDepth:
FORMAT(SPZ#,9)
FIRST SPZ#
RETURN

DoEPX:
FORMAT(EPX#,8)
EPX#
RETURN

DoNegEPX:
FORMAT(EPX#,9)
EPX#
RETURN

DoEPY:
FORMAT(EPY#,8)
EPY#
RETURN

DoNegEPY:
FORMAT(EPY#,9)
EPY#
RETURN

DoEPZ:
FORMAT(EPZ#,8)
EPZ#
RETURN

DoNegEPZ:
FORMAT(EPZ#,9)
EPZ#
RETURN

DoSPX:
FORMAT(SPX#,8)
SPX#
RETURN

DoNegSPX:
FORMAT(SPX#,9)
SPX#
RETURN

DoSPY:
FORMAT(SPY#,8)
SPY#
RETURN

DoNegSPY:
FORMAT(SPY#,9)
SPY#
RETURN

DoSPZ:
FORMAT(SPZ#,8)
SPZ#
RETURN

DoNegSPZ:
FORMAT(SPZ#,9)
SPZ#
RETURN

DoArcI:
FORMAT(ArcI#,8)
ArcI#
RETURN

DoNegArcI:
FORMAT(ArcI#,9)
ArcI#
RETURN

DoArcJ:
FORMAT(ArcJ#,8)
ArcJ#
RETURN

DoNegArcJ:
FORMAT(ArcJ#,9)
ArcJ#
RETURN

ApproachXY:
LoadFeat StartPosX# StartPosY# ClearancePlane1#
IF Equal? Recall# Num#('23') Num#('1') { Top }
IF Equal? Recall# Num#('25') Num#('1')
' X' DoEPX
' Y' DoEPY
END
IF Equal? Recall# Num#('25') Num#('3')
' X' DoNegEPX
' Y' DoNegEPY
END
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
IF Equal? Recall# Num#('25') Num#('2')
' X' DoEPX
END
IF Equal? Recall# Num#('25') Num#('4')
' X' DoNegEPX
END
' Y' DoNegEPZ
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
IF Equal? Recall# Num#('25') Num#('1')
' Y' DoEPY
END
IF Equal? Recall# Num#('25') Num#('2')
' Y' DoEPX
END
IF Equal? Recall# Num#('25') Num#('3')
' Y' DoNegEPY
END
IF Equal? Recall# Num#('25') Num#('4')
' Y' DoNegEPX
END
' X' DoEPZ
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
IF Equal? Recall# Num#('25') Num#('1')
' X' DoEPX
' Y' DoNegEPY
END
IF Equal? Recall# Num#('25') Num#('3')
' X' DoNegEPX
' Y' DoEPY
END
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
IF Equal? Recall# Num#('25') Num#('2')
' X' DoNegEPX
END
IF Equal? Recall# Num#('25') Num#('4')
' X' DoEPX
END
' Y' DoEPZ
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
IF Equal? Recall# Num#('25') Num#('1')
' Y' DoEPY
END
IF Equal? Recall# Num#('25') Num#('2')
' Y' DoNegEPX
END
IF Equal? Recall# Num#('25') Num#('3')
' Y' DoNegEPY
END
IF Equal? Recall# Num#('25') Num#('4')
' Y' DoEPX
END
' X' DoNegEPZ
END
RETURN

ApproachZ:
LoadFeat StartPosX# StartPosY# ClearancePlane1#
' G43'
IF Equal? Recall# Num#('23') Num#('1') { Top }
' Z' DoEPZ
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
IF Equal? Recall# Num#('25') Num#('2')
' Z' DoEPY
END
IF Equal? Recall# Num#('25') Num#('4')
' Z' DoNegEPY
END
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
IF Equal? Recall# Num#('25') Num#('1')
' Z' DoNegEPX
END
IF Equal? Recall# Num#('25') Num#('2')
' Z' DoEPY
END
IF Equal? Recall# Num#('25') Num#('3')
' Z' DoEPX
END
IF Equal? Recall# Num#('25') Num#('4')
' Z' DoNegEPY
END
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
' Z' DoNegEPZ
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
IF Equal? Recall# Num#('25') Num#('2')
' Z' DoEPY
END
IF Equal? Recall# Num#('25') Num#('4')
' Z' DoNegEPY
END
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
IF Equal? Recall# Num#('25') Num#('1')
' Z' DoEPX
END
IF Equal? Recall# Num#('25') Num#('2')
' Z' DoEPY
END
IF Equal? Recall# Num#('25') Num#('3')
' Z' DoNegEPX
END
IF Equal? Recall# Num#('25') Num#('4')
' Z' DoNegEPY
END
END
ToolOfst
RETURN

MoveHV:
IF Equal? Recall# Num#('23') Num#('1') { Top }
IF Equal? Recall# Num#('25') Num#('1')
' X' DoEPX
' Y' DoEPY
END
IF Equal? Recall# Num#('25') Num#('3')
' X' DoNegEPX
' Y' DoNegEPY
END
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
IF Equal? Recall# Num#('25') Num#('2')
' X' DoEPX
' Z' DoEPY
END
IF Equal? Recall# Num#('25') Num#('4')
' X' DoNegEPX
' Z' DoNegEPY
END
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
IF Equal? Recall# Num#('25') Num#('1')
' Y' DoEPY
' Z' DoNegEPX
END
IF Equal? Recall# Num#('25') Num#('2')
' Y' DoEPX
' Z' DoEPY
END
IF Equal? Recall# Num#('25') Num#('3')
' Y' DoNegEPY
' Z' DoEPX
END
IF Equal? Recall# Num#('25') Num#('4')
' Y' DoNegEPX
' Z' DoNegEPY
END
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
IF Equal? Recall# Num#('25') Num#('1')
' X' DoEPX
' Y' DoNegEPY
END
IF Equal? Recall# Num#('25') Num#('3')
' X' DoNegEPX
' Y' DoEPY
END
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
IF Equal? Recall# Num#('25') Num#('2')
' X' DoNegEPX
' Z' DoEPY
END
IF Equal? Recall# Num#('25') Num#('4')
' X' DoEPX
' Z' DoNegEPY
END
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
IF Equal? Recall# Num#('25') Num#('1')
' Y' DoEPY
' Z' DoEPX
END
IF Equal? Recall# Num#('25') Num#('2')
' Y' DoNegEPX
' Z' DoEPY
END
IF Equal? Recall# Num#('25') Num#('3')
' Y' DoNegEPY
' Z' DoNegEPX
END
IF Equal? Recall# Num#('25') Num#('4')
' Y' DoEPX
' Z' DoNegEPY
END
END
RETURN

MoveHVC: { same as MoveHV with added move boolean tests }
IF Equal? Recall# Num#('23') Num#('1') { Top }
IF Equal? Recall# Num#('25') Num#('1')
IF XMove?
' X' DoEPX
END
IF YMove?
' Y' DoEPY
END
END
IF Equal? Recall# Num#('25') Num#('3')
IF XMove?
' X' DoNegEPX
END
IF YMove?
' Y' DoNegEPY
END
END
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
IF Equal? Recall# Num#('25') Num#('2')
IF XMove?
' X' DoEPX
END
IF YMove?
' Z' DoEPY
END
END
IF Equal? Recall# Num#('25') Num#('4')
IF XMove?
' X' DoNegEPX
END
IF YMove?
' Z' DoNegEPY
END
END
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
IF Equal? Recall# Num#('25') Num#('1')
IF YMove?
' Y' DoEPY
END
IF XMove?
' Z' DoNegEPX
END
END
IF Equal? Recall# Num#('25') Num#('2')
IF XMove?
' Y' DoEPX
END
IF YMove?
' Z' DoEPY
END
END
IF Equal? Recall# Num#('25') Num#('3')
IF YMove?
' Y' DoNegEPY
END
IF XMove?
' Z' DoEPX
END
END
IF Equal? Recall# Num#('25') Num#('4')
IF XMove?
' Y' DoNegEPX
END
IF YMove?
' Z' DoNegEPY
END
END
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
IF Equal? Recall# Num#('25') Num#('1')
IF XMove?
' X' DoEPX
END
IF YMove?
' Y' DoNegEPY
END
END
IF Equal? Recall# Num#('25') Num#('3')
IF XMove?
' X' DoNegEPX
END
IF YMove?
' Y' DoEPY
END
END
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
IF Equal? Recall# Num#('25') Num#('2')
IF XMove?
' X' DoNegEPX
END
IF YMove?
' Z' DoEPY
END
END
IF Equal? Recall# Num#('25') Num#('4')
IF XMove?
' X' DoEPX
END
IF YMove?
' Z' DoNegEPY
END
END
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
IF Equal? Recall# Num#('25') Num#('1')
IF YMove?
' Y' DoEPY
END
IF XMove?
' Z' DoEPX
END
END
IF Equal? Recall# Num#('25') Num#('2')
IF XMove?
' Y' DoNegEPX
END
IF YMove?
' Z' DoEPY
END
END
IF Equal? Recall# Num#('25') Num#('3')
IF YMove?
' Y' DoNegEPY
END
IF XMove?
' Z' DoNegEPX
END
END
IF Equal? Recall# Num#('25') Num#('4')
IF XMove?
' Y' DoEPX
END
IF YMove?
' Z' DoNegEPY
END
END
END
RETURN

MoveSHVC: { same as MoveHVC with SP in place of EP and booleans }
IF Equal? Recall# Num#('23') Num#('1') { Top }
IF Equal? Recall# Num#('25') Num#('1')
IF SPXMove?
' X' DoSPX
END
IF SPYMove?
' Y' DoSPY
END
END
IF Equal? Recall# Num#('25') Num#('3')
IF SPXMove?
' X' DoNegSPX
END
IF SPYMove?
' Y' DoNegSPY
END
END
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
IF Equal? Recall# Num#('25') Num#('2')
IF SPXMove?
' X' DoSPX
END
IF SPYMove?
' Z' DoSPY
END
END
IF Equal? Recall# Num#('25') Num#('4')
IF SPXMove?
' X' DoNegSPX
END
IF SPYMove?
' Z' DoNegSPY
END
END
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
IF Equal? Recall# Num#('25') Num#('1')
IF SPYMove?
' Y' DoSPY
END
IF SPXMove?
' Z' DoNegSPX
END
END
IF Equal? Recall# Num#('25') Num#('2')
IF SPXMove?
' Y' DoSPX
END
IF SPYMove?
' Z' DoSPY
END
END
IF Equal? Recall# Num#('25') Num#('3')
IF SPYMove?
' Y' DoNegSPY
END
IF SPXMove?
' Z' DoSPX
END
END
IF Equal? Recall# Num#('25') Num#('4')
IF SPXMove?
' Y' DoNegSPX
END
IF SPYMove?
' Z' DoNegSPY
END
END
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
IF Equal? Recall# Num#('25') Num#('1')
IF SPXMove?
' X' DoSPX
END
IF SPYMove?
' Y' DoNegSPY
END
END
IF Equal? Recall# Num#('25') Num#('3')
IF SPXMove?
' X' DoNegSPX
END
IF SPYMove?
' Y' DoSPY
END
END
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
IF Equal? Recall# Num#('25') Num#('2')
IF SPXMove?
' X' DoNegSPX
END
IF SPYMove?
' Z' DoSPY
END
END
IF Equal? Recall# Num#('25') Num#('4')
IF SPXMove?
' X' DoSPX
END
IF SPYMove?
' Z' DoNegSPY
END
END
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
IF Equal? Recall# Num#('25') Num#('1')
IF SPYMove?
' Y' DoSPY
END
IF SPXMove?
' Z' DoSPX
END
END
IF Equal? Recall# Num#('25') Num#('2')
IF SPXMove?
' Y' DoNegSPX
END
IF SPYMove?
' Z' DoSPY
END
END
IF Equal? Recall# Num#('25') Num#('3')
IF SPYMove?
' Y' DoNegSPY
END
IF SPXMove?
' Z' DoNegSPX
END
END
IF Equal? Recall# Num#('25') Num#('4')
IF SPXMove?
' Y' DoSPX
END
IF SPYMove?
' Z' DoNegSPY
END
END
END
RETURN

DoArcIJ:
{ Same as MoveHV with X,Y & Z labels changed to I,J & K and X and Y output changed to I and J }
IF Equal? Recall# Num#('23') Num#('1') { Top }
IF Equal? Recall# Num#('25') Num#('1')
' I' DoArcI
' J' DoArcJ
END
IF Equal? Recall# Num#('25') Num#('3')
' I' DoNegArcI
' J' DoNegArcJ
END
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
IF Equal? Recall# Num#('25') Num#('2')
' I' DoArcI
' K' DoArcJ
END
IF Equal? Recall# Num#('25') Num#('4')
' I' DoNegArcI
' K' DoNegArcJ
END
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
IF Equal? Recall# Num#('25') Num#('1')
' J' DoArcJ
' K' DoNegArcI
END
IF Equal? Recall# Num#('25') Num#('2')
' J' DoArcI
' K' DoArcJ
END
IF Equal? Recall# Num#('25') Num#('3')
' J' DoNegArcJ
' K' DoArcI
END
IF Equal? Recall# Num#('25') Num#('4')
' J' DoNegArcI
' K' DoNegArcJ
END
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
IF Equal? Recall# Num#('25') Num#('1')
' I' DoArcI
' J' DoNegArcJ
END
IF Equal? Recall# Num#('25') Num#('3')
' I' DoNegArcI
' J' DoArcJ
END
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
IF Equal? Recall# Num#('25') Num#('2')
' I' DoNegArcI
' K' DoArcJ
END
IF Equal? Recall# Num#('25') Num#('4')
' I' DoArcI
' K' DoNegArcJ
END
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
IF Equal? Recall# Num#('25') Num#('1')
' J' DoArcJ
' K' DoArcI
END
IF Equal? Recall# Num#('25') Num#('2')
' J' DoNegArcI
' K' DoArcJ
END
IF Equal? Recall# Num#('25') Num#('3')
' J' DoNegArcJ
' K' DoNegArcI
END
IF Equal? Recall# Num#('25') Num#('4')
' J' DoArcI
' K' DoNegArcJ
END
END
RETURN

MoveD:
IF Equal? Recall# Num#('23') Num#('1') { Top }
' Z' DoEPZ
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
' Y' DoNegEPZ
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
' X' DoEPZ
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
' Z' DoNegEPZ
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
' Y' DoEPZ
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
' X' DoNegEPZ
END
RETURN

MoveDC:
IF ZMove?
MoveD
END
RETURN

MoveSD:
IF Equal? Recall# Num#('23') Num#('1') { Top }
' Z' DoSPZ
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
' Y' DoNegSPZ
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
' X' DoSPZ
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
' Z' DoNegSPZ
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
' Y' DoSPZ
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
' X' DoNegSPZ
END
RETURN

MoveSDC:
IF SPZMove?
MoveD
END
RETURN

StartPos:
LoadFeat StartPosX# StartPosY# Num#('0')
MoveHV
RETURN

StartPosC:
LoadFeat StartPosX# StartPosY# Num#('0')
MoveHVC
RETURN

DCP1:
LoadFeat Num#('0') Num#('0') ClearancePlane1#
MoveD
RETURN

DCP2:
LoadFeat Num#('0') Num#('0') ClearancePlane2#
MoveD
RETURN

DCP2C:
LoadFeat Num#('0') Num#('0') ClearancePlane2#
MoveDC
RETURN

DIn:
LoadFeat Num#('0') Num#('0') FIRST SPZ#
MoveD
RETURN

DInC:
LoadFeat Num#('0') Num#('0') FIRST SPZ#
MoveDC
RETURN

DInPlusInc:
LoadFeat Num#('0') Num#('0') ZInPlusInc#
MoveD
RETURN

DCP2PlusInc:
LoadFeat Num#('0') Num#('0') ZCP2PlusInc#
MoveD
RETURN

DCP2PlusIncC:
LoadFeat Num#('0') Num#('0') ZCP2PlusInc#
MoveDC
RETURN

DCP3:
LoadFeat Num#('0') Num#('0') ClearancePlane3#
MoveD
RETURN

DCP3C:
LoadFeat Num#('0') Num#('0') ClearancePlane3#
MoveDC
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

getKomoFace:
IF Equal? Recall# Num#('23') Num#('1') { Top }
Save# Num#('26') Num#('1')
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
Save# Num#('26') Num#('3')
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
Save# Num#('26') Num#('4')
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
{ We cannot do the bottom of the part }
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
Save# Num#('26') Num#('5')
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
Save# Num#('26') Num#('2')
END
RETURN

komoFace#:
Recall# Num#('26')
RETURN

cSPartNum#:
ADD# komoFace# MUL# NumOfCS# SUB# PartNum# Num#('1')
RETURN

cSWFO:
' G54.1 P' ADD# cSPartNum# Num#('0')
RETURN

wFO:
' G54.1 P' ADD# PartNum# Num#('0')
RETURN

wFOStuff:
IF Flag?('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF NOT SameTool?
IF WFOCS?
cSWFO
ELSE
IF MultipleParts? AND WorkFixtureOffsets?
wFO
ELSE
WFO1
END
END
ELSE
IF WFOCS?
IF ChangeCS?
cSWFO
END
END
END
END
SetFlagF('2') { Do not output WFO second time wFOStuff is called for MP-WFO-OTAP-ECP }
RETURN

cSG52:
SeqC ' G52 X' CSOffsetX# ' Y' CSOffsetY# ' Z' CSOffsetZ# EOL
RETURN

g52Stuff:
IF NOT Flag?('7') AND NOT WFOCS?
IF FirstOperation? OR NewTool? OR ChangeCS?
IF MultipleParts?
IF WorkFixtureOffsets?
cSG52
END
ELSE
cSG52
END
END
END
RETURN

doCSComment:
'( CS#' CS# ' - ' CSComment$ ' )' EOL
RETURN

doCSWFOComment:
IF FirstOperation? OR NewTool? OR ChangeCS?
'( ' cSWFO ' = X' CSOffsetX# ' Y' CSOffsetY# ' Z' CSOffsetZ#
IF Flag?('6') { TRUE = B-Style Output, FALSE = C-Style Output }
IF AAxisAvail?
' A' CSOffsetA#
END
IF BAxisAvail?
' B' CSOffsetB#
END
END
' )' EOL
IF NOT Flag?('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
SetFlag('2') { Need to output wFOStuff }
END
END
RETURN

cSComments:
doCSComment
IF WFOCS?
doCSWFOComment
END
RETURN

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

doCycleComment:
IF UseComments? AND SubComment?
'( CYCLE START )' 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
cSComments
END
RETURN

SaveCSAngleA:
IF AAxisAvail?
Save# Num#('21') TRUNC# DIV# CSOffsetA# Num#('360')
IF LessThan? CSOffsetA# Num#('0')
Save# Num#('21') SUB# Recall# Num#('21') Num#('1')
END
Save# Num#('21') SUB# CSOffsetA# MUL# Recall# Num#('21') Num#('360')
END
RETURN

SaveCSAngleB:
IF BAxisAvail?
Save# Num#('22') TRUNC# DIV# CSOffsetB# Num#('360')
IF LessThan? CSOffsetB# Num#('0')
Save# Num#('22') SUB# Recall# Num#('22') Num#('1')
END
Save# Num#('22') SUB# CSOffsetB# MUL# Recall# Num#('22') Num#('360')
END
RETURN

SetCSAngle:
' R'
IF Equal? Recall# Num#('23') Num#('1') { Top }
'0'
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
'90'
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
'180'
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
{ We cannot do the bottom of the part }
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
'270'
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
'360'
END
RETURN

pSInit:
NewWFOF
FourthCWF
FourthCCWF
FifthCWF
FifthCCWF
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
RETURN

pSStuff:
RETURN

doPostScript:
pSInit
EachPS
SeqC PostScript EOL
pSStuff
NextPS
RETURN

doEndOpPS:
pSInit
EachEOPS
SeqC EndOpPS EOL
pSStuff
NextPS
RETURN

loadPRIMEZCP2:
IF NOT Flag?('7')
LoadFeat Num#('0') Num#('0') PRIME ClearancePlane2#
ELSE
LoadFeat Num#('0') Num#('0') ADD# CSOffsetZ# PRIME ClearancePlane2#
END
RETURN

pRIMEZCP2:
MoveD
RETURN

loadPRIMEZCP3:
IF NOT Flag?('7')
LoadFeat Num#('0') Num#('0') PRIME ClearancePlane3#
ELSE
LoadFeat Num#('0') Num#('0') ADD# CSOffsetZ# PRIME ClearancePlane3#
END
RETURN

pRIMEZCP3:
MoveD
RETURN

connectC:
IF FeedConnect?
FeedC
ELSE
RapidC
END
RETURN

absValueC:
IF NOT AbsValue?
AbsValue
END
RETURN

incValueC:
IF AbsValue?
IncValue
END
RETURN

absOrIncC:
IF AbsoluteMoves?
absValueC
ELSE
incValueC
END
RETURN

entryMove:
IF Repeats? AND ZShiftOnly? AND FeedConnect?
SeqC FeedC DInC
IF NOT EmptyLine?
FeedEntC
END
EOL
ELSE
IF FeedEntry?
SeqC FeedC DInC
IF NOT EmptyLine?
FeedEntC
END
EOL
ELSE
SeqC RapidC DInC EOL
END
END
RETURN

doCRCOffC:
IF Flag?('23')
CRCOff SetFlagF('23')
END
RETURN

autoCycExitMove:
SeqC absOrIncC doCRCOffC
loadPRIMEZCP2
IF FIFO?
FeedC pRIMEZCP2 FeedEntC
ELSE
RapidC pRIMEZCP2
END
EOL
RETURN

exitMove:
IF AutoCycle?
SeqC doCRCOffC DCP3C EOL
ELSE
IF FIFO?
SeqC doCRCOffC FeedC DCP3C FeedEntC EOL
ELSE
SeqC doCRCOffC RapidC DCP3C EOL
END
END
RETURN

finishSub1:
SeqC doCRCOffC
IF NOT FeedConnect?
loadPRIMEZCP3
IF ZMove?
IF AutoCycle?
pRIMEZCP3
ELSE
IF FIFO?
FeedC pRIMEZCP3 FeedEntC
ELSE
RapidC pRIMEZCP3
END
END
END
END
EOL
RETURN

StandardArc:
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
RETURN

ReverseArc:
IF ArcCW?
CCWArcC
ELSE
CWArcC
END
RETURN

formatArc:
IF Equal? Recall# Num#('23') Num#('1') { Top }
StandardArc
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
ReverseArc
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
StandardArc
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
ReverseArc
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
StandardArc
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
ReverseArc
END
MoveHV MoveDC DoArcIJ
RETURN

StandardCRC:
IF CRCLeft?
' G41'
ELSE
' G42'
END
RETURN

ReverseCRC:
IF CRCLeft?
' G42'
ELSE
' G41'
END
RETURN

ckCRC:
IF LastFeat?
doCRCOffC
ELSE
IF NOT ZMove?
IF NOT Flag?('23')
IF XYPlane?
IF Equal? Recall# Num#('23') Num#('1') { Top }
StandardCRC
END
IF Equal? Recall# Num#('23') Num#('2') { Front }
ReverseCRC
END
IF Equal? Recall# Num#('23') Num#('3') { Right }
StandardCRC
END
IF Equal? Recall# Num#('23') Num#('4') { Bottom }
ReverseCRC
END
IF Equal? Recall# Num#('23') Num#('5') { Back }
StandardCRC
END
IF Equal? Recall# Num#('23') Num#('6') { Left }
ReverseCRC
END
SetFlag('23')
END
END
END
END
RETURN

ckCRCNum:
IF NOT LastFeat? AND Equal? SPZ# EPZ#
IF XYPlane?
CRCOffsetC
END
END
RETURN

toolPath:
EACHFeat
IF PointFeat? { Drilling Only }
SeqC MoveSHVC MoveSDC EOL
ELSE
IF RapidFeat?
IF XMove? OR YMove? OR ZMove?
SeqC ckCRC RapidC MoveHVC MoveDC ckCRCNum EOL
END
ELSE
IF LineFeat?
IF XMove? OR YMove? OR ZMove?
SeqC ckCRC FeedC MoveHVC MoveDC FeedRateC ckCRCNum EOL
END
ELSE
IF ArcFeat?
IF XYPlane?
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
SeqC formatArc ArcFeedC EOL
NEXTQuadrant
ELSE
EACHArcSegment
SeqC FeedC MoveHVC MoveDC ArcFeedC EOL
NEXTArcSegment
END
END
END
END
END
NEXTFeat
RETURN

autoCycCutSub1: {part 1}
CalcACSRXY {calc tool position, CalcAutoCycleStatusRecordXY}
SaveSubStatus {save tool position}
SetPass1 {element cut moves}
SetSRXYtoSP
IF Repeats? AND ZShiftOnly?
entryMove
END
SeqC incValueC EOL
RETURN

autoCycCutSub2: {part 2}
SeqC absOrIncC doCRCOffC
IF FIFO?
FeedC DCP2C FeedEntC
ELSE
RapidC DCP2C
END
EOL
SetSRSubXY {restore SR to 1st position value}
ReSetPass2 {restore for positioning moves}
RETURN

cutAutoCycle:
IF Repeats? AND NOT ZShiftOnly?
EachRep
IF NOT FirstCycle?
IF FIFO?
Rapid
END
SeqC RapidC StartPos EOL
IF NOT FeedConnect?
SeqC DCP2C EOL
END
END
END
EACHFeat
doCycleComment
IF SPXMove? OR SPYMove?
IF FIFO?
Rapid
END
SeqC RapidC MoveSHVC EOL
END
autoCycCutSub1
IF Repeats? AND ZShiftOnly?
EachRep
IF NOT FirstCycle?
doCycleComment
IF SPXMove? OR SPYMove?
SeqC connectC incValueC MoveSHVC EOL
END
absOrIncC
IF FeedConnect?
entryMove
ELSE
IF FeedEntry?
SeqC RapidC DCP2C EOL
END
entryMove
END
SeqC incValueC EOL
END
toolPath
IF NOT FeedConnect?
autoCycExitMove
END
NextRep
ELSE
entryMove
toolPath
END
autoCycCutSub2
NEXTFeat
IF Repeats? AND NOT ZShiftOnly?
finishSub1
NextRep
END
SetPass1
RETURN

milling:
IF Repeats?
EachRep
doCycleComment
IF SPXMove? OR SPYMove?
SeqC connectC MoveSHVC EOL
END
IF FeedConnect?
entryMove
ELSE
IF FeedEntry?
SeqC RapidC DCP2C EOL
END
entryMove
END
toolPath
finishSub1
NextRep
ELSE
entryMove
toolPath
END
RETURN

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

drilling:
GetCycle
SeqC Cycle FromCP {StartPos} DIn DoRLevel Dwell Peck Retract FeedEnt EOL
TrackZNO# FIRST SPZ# {.81.2}
toolPath
setDrillEndOpZ
SeqC DrillOff Rapid DCP3 EOL
RETURN

checkPass: {use the correct StartPos}
IF AutoCycle?
SetPass2
ELSE
SetPass1
END
IF NOT Flag?('7') { TRUE = Local WFO Coordinates, FALSE = D-Style Output }
ClearCSOffset
END
RETURN

opGuts:
ResetCRCNum
IF FirstOperation? OR NewTool?
RapidF# { Forces FeedEntC/FeedRateC }
END
IF Milling?
SeqC DCP2C EOL
IF AutoCycle?
cutAutoCycle
ELSE
milling
END
exitMove
ELSE
IF Drilling?
drilling
END
END
RETURN

initialize:
InitProg
ReverseXZArcs
InitWFONum
SetArcSegmentAccuracy('.001')
SetFlood
SetMaxRPM('10000')
IF Metric?
SetMaxFeed('12700')
ELSE
SetMaxFeed('500')
END
Save# Num#('1') Num#('0') { MultipleParts Current Tool FirstOp# }
Save# Num#('2') Num#('0') { MultipleParts ToolOp# Counter }
Save# Num#('21') Num#('0') { A Axis Position }
Save# Num#('22') Num#('0') { B Axis Position }
Save# Num#('23') Num#('0') { Current Face }
Save# Num#('24') Num#('0') { LAST Face }
Save# Num#('25') Num#('0') { Current Face Modifier }
Save# Num#('26') Num#('0') { Komo Face Number for custom WFO output }
SetFlagF('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
SetFlag('3') { Incrementing WFOs in effect }
SetFlag('4') { This post supports IncWFO/DecWFO }
SetFlag('6') { TRUE = B-Style Output, FALSE = C-Style Output }
SetFlagF('7') { TRUE = D-Style Output }
SetFlag('8') { TRUE = D-Style Output, FALSE = Local G52-WFO Coordinates }
SetFlagF('21') {ErrorCheck}
SetFlagF('22') {RightSideErrorIgnore}
SetFlagF('23') {CRCOn}
RETURN

progStart:
initialize
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
END

IF NOT Flag?('7')
IF Equal? NumOfCS# Num#('1') { 3 Axis Part - Output M-Style }
SetFlag('7')
ELSE
IF MultipleParts?
IF WorkFixtureOffsets?
IF LTEqual? MUL# Parts# NumOfCS# Num#('48')
SetWFOCS { use WFO for CS changes }
ELSE
IF Flag?('8')
SetFlag('7')
END
IF UseComments?
'( Not enough Work Fixture Offsets to handle this part. )' EOL
'( Number of parts [ ' Parts# ' ] times CSs [ ' NumOfCS# ' ] )' EOL
'( exceeds the machine limit. Switching to '
IF Flag?('7')
'non'
ELSE
'G52'
END
'-wfo style output. )' EOL
END
END
ELSE
SetFlag('7')
END
ELSE
IF LTEqual? NumOfCS# Num#('48') {****}
SetWFOCS { use WFO for CS changes }
ELSE
IF Flag?('8')
SetFlag('7')
END
IF UseComments?
'( Not enough Work Fixture Offsets to handle this part. )' EOL
'( Number of CSs [ ' NumOfCS# ' ] exceeds the machine limit. )' EOL
'( Switching to '
IF Flag?('7')
'non'
ELSE
'G52'
END
'-wfo style output. )' EOL
END
END
END
END
END
RETURN

doToolChng:
' G65 P9052'
IF Equal? Recall# Num#('23') Num#('1') { Top }
OpToolID ' R0 S0'
ELSE
' T99' SetCSAngle ' S' Tool#
END
RETURN

doCoolOn:
IF ThruSpin?
' M18'
ELSE
IF Mist?
' M50' { actually this is referred to as Air Blast }
ELSE
CoolOn
END
END
RETURN

initOp:
EOR EOL
ProgID1
IF UseComments? AND ProgramNameComment?
'( ' ProgramName$ ' )'
END
EOL
EachOp
IF FirstOperation?
IF ToolChangeAtHome?
SetHome
END
END
NextOp
IF UseComments?
IF ProgramComment?
'( ' ProgramComment$ ' )' EOL
END
IF FormatNameComment?
'( FORMAT: ' FormatName$ ' )' EOL
END
IF TimeComment?
'( ' Date$ ' AT ' Time$ ' )' EOL
END
IF MovesComment?
'( OUTPUT IN ' MoveType$ ' INCHES )' EOL
END
IF PartsComment?
'( PARTS PROGRAMMED: ' Parts# ' )' EOL
END
IF StartToolComment?
'( FIRST TOOL NOT IN SPINDLE )' EOL
END
END
restoreScale
RETURN

firstOp1:
SaveCSAngleA SaveCSAngleB SaveFace getKomoFace
Seq Rapid SetPlane CRCOff DrillOff AbsOrInc EOL
doPartCycleComment
doOpComments
SeqC doToolChng EOL
doPostScript
RETURN

firstOp2:
SeqC wFOStuff EOL
g52Stuff
SeqC Speed SpinOn EOL
checkPass
SeqC Rapid absOrIncC ApproachXY EOL
RETURN

firstOp3:
SeqC ApproachZ doCoolOn EOL
RETURN

newToolOp1:
SeqC incValueC OfstOff CoolOff EOL
RETURN

newToolOp2:
doEndOpPS
IF ToolChangeAtHome?
SeqC absOrIncC Rapid PRIME Home SpinOff EOL
ELSE
SeqC SpinOff EOL
END
IF LAST ProgStop?
SeqC ' M0' EOL
ELSE
SeqC ProgStop EOL
END
RETURN

newToolOp3: {Start new Operation}
SaveCSAngleA SaveCSAngleB SaveFace getKomoFace
Seq Rapid SetPlane CRCOff DrillOff AbsOrInc EOL
doPartCycleComment
doOpComments
SeqC doToolChng EOL
doPostScript
RETURN

newToolOp4:
SeqC wFOStuff EOL
g52Stuff
SeqC Speed SpinOn EOL
checkPass
SeqC Rapid absOrIncC ApproachXY EOL
RETURN

newToolOp5:
SeqC ApproachZ doCoolOn EOL
RETURN

sameToolOp1:
doEndOpPS
IF LAST ProgStop?
SeqC incValueC OfstOff CoolOff EOL
SeqC SpinOff EOL
SeqC ' M0' EOL
ELSE
SeqC
IF NewToolOffset? OR AChange? OR BChange?
incValueC OfstOff
END
IF CoolOff? AND LAST NOT CoolOff?
CoolOff
END
EOL
END
RETURN

sameToolOp2: {Start new Operation}
SaveCSAngleA SaveCSAngleB SaveFace getKomoFace
doPartCycleComment
doOpComments
IF AChange? OR BChange?
SeqC doToolChng EOL
END
doPostScript
checkPass
RETURN

sameToolOp3: {Start new Operation}
SeqC wFOStuff EOL
g52Stuff
IF LAST ProgStop?
SeqC Rapid SetPlane absOrIncC ApproachXY Speed SpinOn EOL
SeqC ApproachZ doCoolOn EOL
ELSE
IF NewToolOffset? OR AChange? OR BChange?
SeqC Rapid SetPlane absOrIncC ApproachXY SpeedC EOL
SeqC ApproachZ
IF NOT CoolOff? AND LAST CoolOff?
doCoolOn
END
EOL
ELSE
SeqC Rapid SetPlane absOrIncC StartPos SpeedC EOL
IF NOT CoolOff? AND LAST CoolOff?
SeqC doCoolOn EOL
END
END
END
RETURN

end1:
SeqC incValueC OfstOff CoolOff EOL
RETURN

end2:
doEndOpPS
IF FIRST ToolChangeAtHome? {added FIRST modifier}
SeqC Rapid absOrIncC PRIME FirstHome SpinOff EOL
ELSE
SeqC SpinOff EOL
END
IF ProgStop?
SeqC ' M0' EOL
ELSE
IF MultipleParts? AND AllToolsOnePart? AND NOT LastPart?
SeqC ProgStop EOL
END
END
RETURN

end3:
SeqC EOP EOL
EOR EOL
Close
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}
IF FirstOperation? OR EquallySpacedOffsets?
SetFlag('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
IF FirstOperation?
firstOp1
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
newToolOp2
newToolOp3
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
sameToolOp2
sameToolOp3
END
END
opGuts
RETURN

mP1ToollAllPfu: {Multiple Parts, 1 Tool all Parts, full up}
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
opGuts
RETURN

mP1ToollAllPXcp: {Multiple Parts, 1 Tool all Parts, exit Clearance plane}
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
opGuts
RETURN

noMPs: {no multiple parts}
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
opGuts
RETURN

masterSub:
IF MultipleParts?
IF AllToolsOnePart?
mPallTools1P
ELSE {implied OneToolAllParts?}
IF FullUp?
mP1ToollAllPfu
ELSE {implied ExitClearancePlane?}
mP1ToollAllPXcp
END
END
ELSE
noMPs
END
RETURN

endPartSub:
{End of program ************************************************************}

{finish last operation}
end1
end2
RETURN

newPart1: {Finish off last Part}
IF FullUp?
SeqC incValueC OfstOff CoolOff EOL
END
{doEndOpPS}
RETURN

newPart2: {Start new Part}
sameToolOp2
RETURN

newPart3: {Start new Part}
SetFlag('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
SeqC wFOStuff EOL
g52Stuff
IF FullUp?
SeqC Rapid SetPlane absOrIncC ApproachXY Speed EOL
SeqC ApproachZ doCoolOn EOL
ELSE
SeqC Rapid SetPlane absOrIncC StartPos Speed EOL
END
RETURN

toggleIncDecWFO:
IF Flag?('3') { Incrementing WFOs in effect }
SetFlagF('3')
ELSE { Decrementing WFOs in effect }
SetFlag('3')
END
RETURN

mPLoop:
Save# Num#('2') Recall# Num#('1')
IF WorkFixtureOffsets?
IF Flag?('3') { Incrementing WFOs in effect }
NewWFO
ELSE
LastWFO
END
EachWFO
ELSE
EachPart
END
IF AllToolsOnePart?
EachOp
masterSub
NextOp
endPartSub
ELSE { OneToolAllParts }
EachOp
IF Equal? Operation# Recall# Num#('2') { Valid Tool Op }
IF FirstOperation? OR NewTool?
IF FirstPart? AND Flag?('3') { Incrementing WFOs in effect }
masterSub
ELSE
IF LastPart? AND NOT Flag?('3') { Decrementing WFOs in effect }
masterSub
ELSE
newPart1
newPart2
newPart3
opGuts
END
END
ELSE
masterSub
END
IF LastOp?
IF LastPart? AND Flag?('3') { Incrementing WFOs in effect }
Save# Num#('1') Num#('0')
ELSE
IF FirstPart? AND NOT Flag?('3') { Decrementing WFOs in effect }
Save# Num#('1') Num#('0')
END
END
Save# Num#('2') Recall# Num#('1')
ELSE
IF NEXT SameTool?
Save# Num#('2') NEXT Operation#
ELSE
IF LastPart? AND Flag?('3') { Incrementing WFOs in effect }
Save# Num#('1') NEXT Operation#
Save# Num#('2') Num#('0')
ELSE
IF FirstPart? AND NOT Flag?('3') { Decrementing WFOs in effect }
Save# Num#('1') NEXT Operation#
Save# Num#('2') Num#('0')
ELSE
Save# Num#('2') Recall# Num#('1')
END
END
END
END
END
NextOp
END
IF WorkFixtureOffsets?
IF Flag?('3') { Incrementing WFOs in effect }
IncWFO
NextWFO
DecWFO
ELSE { Decrementing WFOs in effect }
DecWFO
NextPrevWFO
IncWFO
END
IF Flag?('4') { This post supports IncWFO/DecWFO }
toggleIncDecWFO
END
ELSE
NextPart
END
RETURN

RightSideErrorIgnore:
EachOp
SaveCSAngleA SaveCSAngleB SaveFace
IF Equal? Recall# Num#('23') Num#('3')
IF NOT Flag?('22')
'Please ignore and delete the above line.' EOL
ASCII('13') EOL
SetFlag('22')
END
END
NextOp
RETURN

Face#:
Recall# Num#('23')
RETURN

FaceText:
IF Equal? Face# Num#('0')
'Unknown'
END
IF Equal? Face# Num#('1')
'Top'
END
IF Equal? Face# Num#('2')
'Front'
END
IF Equal? Face# Num#('3')
'Right'
END
IF Equal? Face# Num#('4')
'Bottom'
END
IF Equal? Face# Num#('5')
'Back'
END
IF Equal? Face# Num#('6')
'Left'
END
IF GreaterThan? Face# Num#('6')
'Unknown'
END
RETURN

ErrorCheck:
{ initialize face variables }
EachOp
SaveCSAngleA SaveCSAngleB SaveFace
Save# Face# Num#('0')
NextOp
{ check for errors }
EachOp
SaveCSAngleA SaveCSAngleB SaveFace
IF Equal? Face# Num#('0')
'The CS orientation used for operation# ' Operation# EOL
'is not supported by this machine.' EOL
' ' EOL
SetFlag('21')
ELSE
IF Equal? Face# Num#('4')
'Operation# ' Operation# ' has bottom side defined.' EOL
'This machine is not equipped for' EOL
'Bottom Side machining.' EOL
' ' EOL
SetFlag('21')
ELSE
IF NotEqual? Recall# Face# CS#
IF Equal? Recall# Face# Num#('0')
Save# Face# CS#
ELSE
'Operation# ' Operation# ' uses CS# ' CS# ' to machine' EOL
'the ' FaceText ' side of the part. It should' EOL
'use CS# ' Recall# Face# ' which has already been used' EOL
'to machine the ' FaceText ' side.' EOL
' ' EOL
SetFlag('21')
END
END
END
END
NextOp
RETURN

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

initialize
SetLowerCaseOK
RightSideErrorIgnore
ErrorCheck
IF Flag?('21') { IF Error? }
ASCII('13') EOL
'Be sure the MDD is set up as:' EOL
' 5 Axis Vertical' EOL
' 4th X-, 5th Y-' EOL
ASCII('13') EOL
'Correct the above items' EOL
'and re-process.' EOL
ASCII('13') EOL
ASCII('13') EOL
ELSE
progStart {setup and initializations}
initOp

IF MultipleParts?
IF WorkFixtureOffsets?
{'NOTE: This Post Processor does not support Work Fixture Offsets for Multiple Parts.' EOL
'It is recommended that you change your selection to Equally Spaced Offsets.' EOL}
END
IF AllToolsOnePart?
mPLoop
ELSE
EachOp
IF FirstOperation?
Save# Num#('1') Operation#
END
NextOp
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
END
ELSE
EachOp
masterSub
NextOp
endPartSub
END
end3
END


Wyszukiwarka

Podobne podstrony:
Fanuc 11M [TM] CQ07 16 2
Fanuc 6M [PMW] NDT40 16
Fanuc 6M [NW] D001 16
Fanuc 6M [PW] C001 16
Fanuc 6M [NW] NDU99 16
Fanuc 2T Star JNC 16 L174 85
(LABORATORIUM 022 Sterownik GE 6 Fanuc 90 30)
Fanuc 6M [6D] MT02 16
Fanuc 6M linmov M001 16 2m
GE Fanuc 15M 10HC PMW CV68 15
Fanuc 0M [JS] NMQ10 16
Fanuc 6M [BR] MT12 16
GE Fanuc 0TB Hardinge L576 85 1
Fanuc 11M [BC] MT27 16 1
Fanuc 0M LH NMU16 16
Fanuc 11M [BC] NMT28 16 1
Fanuc 11M [TM] BQ07 16 2
Fanuc 6M linmov M001 16 2
Fanuc 6M [DM] B180 16

więcej podobnych podstron