Siemens 840C Sermill DW30 15 4


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

{9/19/97
Initial: Fanuc 6M (FW) B001.12.09 & Fanuc 6M (NW) D001.15 & Siemens 810M Union [GT] C395.15
Created: Siemens 840C Seramill Dxxx.15m
ForUser: MG Cutting Systems & Welding, Inc.
Control: Siemens Sinumerik 840C
Machine: Forest-Line Albert Seramill E 240 G
Develop: ComPost2 1.1b2, Virtual Gibbs 4.21
Comment: New processor per manuals. Should be a good rough first draft!
Set Up MDD for 4th X- and 5th Y-
Part Faces:
Variable number 3 stores which face is up
1=Top 2=Front 3=Right 4=Bottom 5=Back 6=Left
Variable number 5 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
Jim Radcliffe}

{11/4/97
Initial: Siemens 840C Seramill DW30.15m
Created: Siemens 840C Seramill DW30.15
Develop: ComPost2 1.1b2, Virtual Gibbs 4.21.09
Comment: Created Inch version.
Jim Radcliffe}

{11/17/97
Initial: Siemens 840C Seramill DW30.15
Created: Siemens 840C Seramill DW30.15.1
Develop: ComPost2 1.1b3, Virtual 4.21.14
Comment: Modified per marked up readouts from Dave Kreuser
Added '@714' line before head rotation line.
Added ' L9100' line after both head rotation.
Moved Speed line to after head rotation.
Changed A head position output -900 to 2700
Changed Z0 output on OfstOff line to TCZ with default to 7.95 inches.
Changed to use SeqLab and Retag to have a colon block at the start of tools.
Jim Radcliffe}

{1/20/98
Initial: Siemens 840C Seramill DW30.15.1
Created: Siemens 840C Seramill DW30.15.2
Develop: ComPost2 1.1b3, Virtual 4.21.21
Comment: Modified per fax and conversation with David Kreuser
Changed tool change command from M6 to M70 for manual tool change.
Cannot transfer a G code from main program to sub program!
Changed use of Cycle in drilling to use R50 parameter.
Moved DrillOff into drill sub.
Added R4=0 for drill operations with no dwell.
Changfed format of Dwell# to use decimal point.
Jim Radcliffe}

{2/17/98
Initial: Siemens 840C Seramill DW30.15.2
Created: Siemens 840C Seramill DW30.15.3
Comment: Modified per fax and conversation with David Kreuser
Swapped SetCSAngleA and SetCSAngleB to have M85 line output before M84 line.
Output Speed & SpinOn for SameTool, something is the indexing is turning it off.
Modified Rigid Tapping.
Changed to Absolute arc Centers.
Jim Radcliffe}

{4/21/98
Initial: Siemens 840C Seramill DW30.15.3
Created: Siemens 840C Seramill DW30.15.4
Comment: Modified during class for postprocessing.
Modifications regarding rigid tapping only!
Removed Speed and SpinOn
Inserted new line "M18" before R1= R2= R3=...
Inserted new line "M20" after G80
Dirk Oetmann}

{Prog Numeric Format Definitions ****}

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(CSOffsetA#,2)
FORMAT(CSOffsetB#,2)
FORMAT(Recall#,2)
FORMAT(ToolDiameter#,4)
FORMAT(TrackZNO#,4)
FORMAT(Peck#,4)
FORMAT(FeedTapIPR#,4)
FORMAT(TCZ#,4)
FORMAT(Program#,5)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(NewWFO#,5)
FORMAT(ADD#,5)
FORMAT(CS#,5)
FORMAT(Parts#,5)
FORMAT(CallMasterNum#,5)
FORMAT(SpeedRPM#,5)
FORMAT(Dwell#,6)

{Added Subroutines ***}

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

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

SetPlane:
IF Equal? Recall# Num#('3') Num#('1') { Top }
' G16 XYZ'
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
' G16 XZY-'
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
' G16 YZX'
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
{ We cannot do the bottom of the part }
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
' G16 ZXY'
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
' G16 ZYX-'
END
RETURN

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

DoPartShiftX:
FORMAT(PartShiftX#,7)
PartShiftX#
RETURN

DoNegPartShiftX:
FORMAT(PartShiftX#,8)
PartShiftX#
RETURN

DoPartShiftY:
FORMAT(PartShiftY#,7)
PartShiftY#
RETURN

DoNegPartShiftY:
FORMAT(PartShiftY#,8)
PartShiftY#
RETURN

DoPartShiftZ:
FORMAT(PartShiftZ#,7)
PartShiftZ#
RETURN

DoNegPartShiftZ:
FORMAT(PartShiftZ#,8)
PartShiftZ#
RETURN

DoRepeatX:
FORMAT(RepeatX#,7)
RepeatX#
RETURN

DoNegRepeatX:
FORMAT(RepeatX#,8)
RepeatX#
RETURN

DoRepeatY:
FORMAT(RepeatY#,7)
RepeatY#
RETURN

DoNegRepeatY:
FORMAT(RepeatY#,8)
RepeatY#
RETURN

DoRepeatZ:
FORMAT(RepeatZ#,7)
RepeatZ#
RETURN

DoNegRepeatZ:
FORMAT(RepeatZ#,8)
RepeatZ#
RETURN

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

MoveHVC: { same as MoveHV with added move boolean tests }
IF Equal? Recall# Num#('3') Num#('1') { Top }
IF Equal? Recall# Num#('5') Num#('1')
IF XMove?
' X' DoEPX
END
IF YMove?
' Y' DoEPY
END
END
IF Equal? Recall# Num#('5') Num#('3')
IF XMove?
' X' DoNegEPX
END
IF YMove?
' Y' DoNegEPY
END
END
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
IF Equal? Recall# Num#('5') Num#('2')
IF XMove?
' X' DoEPX
END
IF YMove?
' Z' DoEPY
END
END
IF Equal? Recall# Num#('5') Num#('4')
IF XMove?
' X' DoNegEPX
END
IF YMove?
' Z' DoNegEPY
END
END
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
IF Equal? Recall# Num#('5') Num#('1')
IF YMove?
' Y' DoEPY
END
IF XMove?
' Z' DoNegEPX
END
END
IF Equal? Recall# Num#('5') Num#('2')
IF XMove?
' Y' DoEPX
END
IF YMove?
' Z' DoEPY
END
END
IF Equal? Recall# Num#('5') Num#('3')
IF YMove?
' Y' DoNegEPY
END
IF XMove?
' Z' DoEPX
END
END
IF Equal? Recall# Num#('5') Num#('4')
IF XMove?
' Y' DoNegEPX
END
IF YMove?
' Z' DoNegEPY
END
END
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
IF Equal? Recall# Num#('5') Num#('1')
IF XMove?
' X' DoEPX
END
IF YMove?
' Y' DoNegEPY
END
END
IF Equal? Recall# Num#('5') Num#('3')
IF XMove?
' X' DoNegEPX
END
IF YMove?
' Y' DoEPY
END
END
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
IF Equal? Recall# Num#('5') Num#('2')
IF XMove?
' X' DoNegEPX
END
IF YMove?
' Z' DoEPY
END
END
IF Equal? Recall# Num#('5') Num#('4')
IF XMove?
' X' DoEPX
END
IF YMove?
' Z' DoNegEPY
END
END
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
IF Equal? Recall# Num#('5') Num#('1')
IF YMove?
' Y' DoEPY
END
IF XMove?
' Z' DoEPX
END
END
IF Equal? Recall# Num#('5') Num#('2')
IF XMove?
' Y' DoNegEPX
END
IF YMove?
' Z' DoEPY
END
END
IF Equal? Recall# Num#('5') Num#('3')
IF YMove?
' Y' DoNegEPY
END
IF XMove?
' Z' DoNegEPX
END
END
IF Equal? Recall# Num#('5') 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#('3') Num#('1') { Top }
IF Equal? Recall# Num#('5') Num#('1')
IF SPXMove?
' X' DoSPX
END
IF SPYMove?
' Y' DoSPY
END
END
IF Equal? Recall# Num#('5') Num#('3')
IF SPXMove?
' X' DoNegSPX
END
IF SPYMove?
' Y' DoNegSPY
END
END
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
IF Equal? Recall# Num#('5') Num#('2')
IF SPXMove?
' X' DoSPX
END
IF SPYMove?
' Z' DoSPY
END
END
IF Equal? Recall# Num#('5') Num#('4')
IF SPXMove?
' X' DoNegSPX
END
IF SPYMove?
' Z' DoNegSPY
END
END
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
IF Equal? Recall# Num#('5') Num#('1')
IF SPYMove?
' Y' DoSPY
END
IF SPXMove?
' Z' DoNegSPX
END
END
IF Equal? Recall# Num#('5') Num#('2')
IF SPXMove?
' Y' DoSPX
END
IF SPYMove?
' Z' DoSPY
END
END
IF Equal? Recall# Num#('5') Num#('3')
IF SPYMove?
' Y' DoNegSPY
END
IF SPXMove?
' Z' DoSPX
END
END
IF Equal? Recall# Num#('5') Num#('4')
IF SPXMove?
' Y' DoNegSPX
END
IF SPYMove?
' Z' DoNegSPY
END
END
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
IF Equal? Recall# Num#('5') Num#('1')
IF SPXMove?
' X' DoSPX
END
IF SPYMove?
' Y' DoNegSPY
END
END
IF Equal? Recall# Num#('5') Num#('3')
IF SPXMove?
' X' DoNegSPX
END
IF SPYMove?
' Y' DoSPY
END
END
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
IF Equal? Recall# Num#('5') Num#('2')
IF SPXMove?
' X' DoNegSPX
END
IF SPYMove?
' Z' DoSPY
END
END
IF Equal? Recall# Num#('5') Num#('4')
IF SPXMove?
' X' DoSPX
END
IF SPYMove?
' Z' DoNegSPY
END
END
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
IF Equal? Recall# Num#('5') Num#('1')
IF SPYMove?
' Y' DoSPY
END
IF SPXMove?
' Z' DoSPX
END
END
IF Equal? Recall# Num#('5') Num#('2')
IF SPXMove?
' Y' DoNegSPX
END
IF SPYMove?
' Z' DoSPY
END
END
IF Equal? Recall# Num#('5') Num#('3')
IF SPYMove?
' Y' DoNegSPY
END
IF SPXMove?
' Z' DoNegSPX
END
END
IF Equal? Recall# Num#('5') 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#('3') Num#('1') { Top }
IF Equal? Recall# Num#('5') Num#('1')
' I' DoArcI
' J' DoArcJ
END
IF Equal? Recall# Num#('5') Num#('3')
' I' DoNegArcI
' J' DoNegArcJ
END
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
IF Equal? Recall# Num#('5') Num#('2')
' I' DoArcI
' K' DoArcJ
END
IF Equal? Recall# Num#('5') Num#('4')
' I' DoNegArcI
' K' DoNegArcJ
END
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
IF Equal? Recall# Num#('5') Num#('1')
' J' DoArcJ
' K' DoNegArcI
END
IF Equal? Recall# Num#('5') Num#('2')
' J' DoArcI
' K' DoArcJ
END
IF Equal? Recall# Num#('5') Num#('3')
' J' DoNegArcJ
' K' DoArcI
END
IF Equal? Recall# Num#('5') Num#('4')
' J' DoNegArcI
' K' DoNegArcJ
END
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
IF Equal? Recall# Num#('5') Num#('1')
' I' DoArcI
' J' DoNegArcJ
END
IF Equal? Recall# Num#('5') Num#('3')
' I' DoNegArcI
' J' DoArcJ
END
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
IF Equal? Recall# Num#('5') Num#('2')
' I' DoNegArcI
' K' DoArcJ
END
IF Equal? Recall# Num#('5') Num#('4')
' I' DoArcI
' K' DoNegArcJ
END
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
IF Equal? Recall# Num#('5') Num#('1')
' J' DoArcJ
' K' DoArcI
END
IF Equal? Recall# Num#('5') Num#('2')
' J' DoNegArcI
' K' DoArcJ
END
IF Equal? Recall# Num#('5') Num#('3')
' J' DoNegArcJ
' K' DoNegArcI
END
IF Equal? Recall# Num#('5') Num#('4')
' J' DoArcI
' K' DoNegArcJ
END
END
RETURN

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

MoveDC:
IF ZMove?
MoveD
END
RETURN

MoveSD:
IF Equal? Recall# Num#('3') Num#('1') { Top }
' Z' DoSPZ
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
' Y' DoNegSPZ
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
' X' DoSPZ
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
' Z' DoNegSPZ
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
' Y' DoSPZ
END
IF Equal? Recall# Num#('3') 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

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

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

MPESWFO: { MultipleParts EquallySpaced }
' G' ADD# PartNum# SUB# NewWFO# Num#('1')
RETURN

WFO:
' G' ADD# PartNum# Num#('53')
RETURN

WFONum:
' G' NewWFO#
RETURN

WFOStuff:
IF NewWFO?
IF MultipleParts? AND WorkFixtureOffsets?
EOL
'*** WARNING *** DO NOT USE NEWWFO() WITH MULTIPLE PARTS AND WORK FIXTURE OFFSETS' EOL
ELSE
WFONum
END
ELSE
IF Flag?('2')
IF NOT SameTool?
IF MultipleParts?
IF WorkFixtureOffsets?
WFO
ELSE
MPESWFO
END
ELSE
WFONum
END
END
END
END
SetFlagF('2')
RETURN

DoSubComment:
IF UseComments? AND SubComment?
'( SUB NUMBER: ' Program# ' )' EOL
END
RETURN

DoCSComment:
IF AAxisAvail? OR BAxisAvail?
'( CS#' CS# ' - ' CSComment$ ' )' EOL
END
RETURN

CSComments:
IF FirstOperation? OR NewTool? OR ChangeCS?
DoCSComment
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
CSComments
RETURN

AbsValueC:
IF NOT AbsValue?
AbsValue
END
RETURN

IncValueC:
IF AbsValue?
IncValue
END
RETURN

AbsOrIncC:
IF AbsoluteMoves?
AbsValueC
ELSE
IncValueC
END
RETURN

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

SetCSAngleA:
' M84 R900='
IF Equal? Recall# Num#('3') Num#('1') { Top }
'0'
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
'900'
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
'900'
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
{ We cannot do the bottom of the part }
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
'2700'
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
'2700'
END
RETURN

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

SetCSAngleB:
' M85 R910='
IF Equal? Recall# Num#('3') Num#('1') { Top }
'0'
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
'0'
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
'900'
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
{ We cannot do the bottom of the part }
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
'0'
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
'900'
END
RETURN

PSInit:
NewWFOF
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
RETURN

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

DoPostScript:
PSInit
EachPS
SeqLabC PostScript EOL
PSStuff
NextPS
RETURN

DoEndOpPS:
PSInit
EachEOPS
SeqLabC EndOpPS EOL
PSStuff
NextPS
RETURN

EntryMove:
IF FeedEntry?
SeqLabC Feed DIn FeedEnt EOL
ELSE
SeqLabC RapidC DIn EOL
END
RETURN

StartSub:
OpenSub
'%SPF' Program# EOL { SubID }
DoSubComment
FORMAT(Recall#,5)
'Ś' Recall# Num#('6') EOL
FORMAT(Recall#,2)
SeqLab {drop unconditional to force Sequence# on 1st line of sub}
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 CallLab RepLab RepCycs EOL
StartSub
RETURN

FinishSub1: {part 1}
SeqLabC CRCOffC
IF NOT FeedConnect?
IF AutoCycle?
DCP3C
ELSE
IF FIFO?
FeedC DCP3C FeedEntC
ELSE
RapidC DCP3C
END
END
END
EOL
RETURN

FinishSubG92: {part 2}
SeqLabC IncValueC Preset
IF Equal? Recall# Num#('3') Num#('1') { Top }
IF Equal? Recall# Num#('5') Num#('1')
' X' DoRepeatX
' Y' DoRepeatY
END
IF Equal? Recall# Num#('5') Num#('3')
' X' DoNegRepeatX
' Y' DoNegRepeatY
END
' Z' DoRepeatZ
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
IF Equal? Recall# Num#('5') Num#('2')
' X' DoRepeatX
' Z' DoRepeatY
END
IF Equal? Recall# Num#('5') Num#('4')
' X' DoNegRepeatX
' Z' DoNegRepeatY
END
' Y' DoNegRepeatZ
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
IF Equal? Recall# Num#('5') Num#('1')
' Y' DoRepeatY
' Z' DoNegRepeatX
END
IF Equal? Recall# Num#('5') Num#('2')
' Y' DoRepeatX
' Z' DoRepeatY
END
IF Equal? Recall# Num#('5') Num#('3')
' Y' DoNegRepeatY
' Z' DoRepeatX
END
IF Equal? Recall# Num#('5') Num#('4')
' Y' DoNegRepeatX
' Z' DoNegRepeatY
END
' X' DoRepeatZ
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
IF Equal? Recall# Num#('5') Num#('1')
' X' DoRepeatX
' Y' DoNegRepeatY
END
IF Equal? Recall# Num#('5') Num#('3')
' X' DoNegRepeatX
' Y' DoRepeatY
END
' Z' DoNegRepeatZ
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
IF Equal? Recall# Num#('5') Num#('2')
' X' DoNegRepeatX
' Z' DoRepeatY
END
IF Equal? Recall# Num#('5') Num#('4')
' X' DoRepeatX
' Z' DoNegRepeatY
END
' Y' DoRepeatZ
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
IF Equal? Recall# Num#('5') Num#('1')
' Y' DoRepeatY
' Z' DoRepeatX
END
IF Equal? Recall# Num#('5') Num#('2')
' Y' DoNegRepeatX
' Z' DoRepeatY
END
IF Equal? Recall# Num#('5') Num#('3')
' Y' DoNegRepeatY
' Z' DoNegRepeatX
END
IF Equal? Recall# Num#('5') Num#('4')
' Y' DoRepeatX
' Z' DoNegRepeatY
END
' X' DoNegRepeatZ
END
EOL
SeqLabC AbsOrIncC EOL
SeqLabC EndSub EOL
CloseSub
SeqLabC AbsValueC Preset ' X0 Y0 Z0' EOL
SeqLabC AbsOrIncC EOL
RETURN

ToggleIncDecWFO:
IF Flag?('3')
SetFlagF('3')
ELSE
SetFlag('3')
END
RETURN

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

OpenMP:
NewProg
IF WorkFixtureOffsets?
IF OneToolAllParts? AND ExitClearancePlane?
SetFlag('7') { Suppress Redundant WFO for MP-OTAP-ECP }
END
IF Flag?('3')
NewWFO
EachWFO {simple eachPart}
DoWFOOps
IncWFO
NextWFO {simple NextPart}
DecWFO
ELSE
LastWFO
EachWFO {simple eachPart}
DoWFOOps
DecWFO
NextPrevWFO {simple NextPart}
IncWFO
END
IF Flag?('4')
ToggleIncDecWFO
END
ELSE
SeqLabC CallLab RepLab Parts EOL
IF OneToolAllParts? AND ExitClearancePlane?
SetFlag('2') { WFOStuff }
END
END
StartSub
RETURN

CloseMP:
IF WorkFixtureOffsets?
SeqLabC EndSub EOL
CloseSub
ELSE
SeqLabC IncValueC Preset
IF Equal? Recall# Num#('3') Num#('1') { Top }
IF Equal? Recall# Num#('5') Num#('1')
' X' DoPartShiftX
' Y' DoPartShiftY
END
IF Equal? Recall# Num#('5') Num#('3')
' X' DoNegPartShiftX
' Y' DoNegPartShiftY
END
' Z' DoPartShiftZ
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
IF Equal? Recall# Num#('5') Num#('2')
' X' DoPartShiftX
' Z' DoPartShiftY
END
IF Equal? Recall# Num#('5') Num#('4')
' X' DoNegPartShiftX
' Z' DoNegPartShiftY
END
' Y' DoNegPartShiftZ
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
IF Equal? Recall# Num#('5') Num#('1')
' Y' DoPartShiftY
' Z' DoNegPartShiftX
END
IF Equal? Recall# Num#('5') Num#('2')
' Y' DoPartShiftX
' Z' DoPartShiftY
END
IF Equal? Recall# Num#('5') Num#('3')
' Y' DoNegPartShiftY
' Z' DoPartShiftX
END
IF Equal? Recall# Num#('5') Num#('4')
' Y' DoNegPartShiftX
' Z' DoNegPartShiftY
END
' X' DoPartShiftZ
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
IF Equal? Recall# Num#('5') Num#('1')
' X' DoPartShiftX
' Y' DoNegPartShiftY
END
IF Equal? Recall# Num#('5') Num#('3')
' X' DoNegPartShiftX
' Y' DoPartShiftY
END
' Z' DoNegPartShiftZ
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
IF Equal? Recall# Num#('5') Num#('2')
' X' DoNegPartShiftX
' Z' DoPartShiftY
END
IF Equal? Recall# Num#('5') Num#('4')
' X' DoPartShiftX
' Z' DoNegPartShiftY
END
' Y' DoPartShiftZ
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
IF Equal? Recall# Num#('5') Num#('1')
' Y' DoPartShiftY
' Z' DoPartShiftX
END
IF Equal? Recall# Num#('5') Num#('2')
' Y' DoNegPartShiftX
' Z' DoPartShiftY
END
IF Equal? Recall# Num#('5') Num#('3')
' Y' DoNegPartShiftY
' Z' DoNegPartShiftX
END
IF Equal? Recall# Num#('5') Num#('4')
' Y' DoPartShiftX
' Z' DoNegPartShiftY
END
' X' DoNegPartShiftZ
END
EOL
SeqLabC AbsOrIncC EOL
SeqLabC EndSub EOL
CloseSub
SeqLabC AbsValueC Preset ' X0 Y0 Z0' EOL
SeqLabC AbsOrIncC EOL
END
RETURN

DoAbsOrInc:
IF Flag?('1')
IF ZMove?
IncValueC
ELSE
AbsOrIncC
END
END
RETURN

DoDrillAbsOrInc:
IF Flag?('1')
IF SPZMove?
IncValueC
ELSE
AbsOrIncC
END
END
RETURN

RestoreAbsOrInc:
IF Flag?('1')
SeqLabC AbsOrIncC EOL
END
RETURN

StandardArc:
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
RETURN

ReverseArc:
IF ArcCW?
CCWArcC
ELSE
CWArcC
END
RETURN

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

ToolPath:
ResetCRCNum
EACHFeat
IF PointFeat?
IF AutoCycle?
SeqLabC MoveSHVC EOL
SeqLabC CallLab EOL
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
ELSE
SeqLabC DoDrillAbsOrInc MoveSHVC MoveSDC EOL {.80.01}
END
ELSE
IF RapidFeat?
IF LastFeat?
SeqLabC DoAbsOrInc CRCOffC RapidC MoveHVC MoveDC EOL
ELSE
IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps}
SeqLabC DoAbsOrInc RapidC MoveHVC MoveDC EOL
ELSE
IF XMove? OR YMove? OR ZMove?
SeqLabC DoAbsOrInc CRCOnC RapidC MoveHVC MoveDC EOL
END
END
END
ELSE
IF LineFeat?
IF LastFeat?
SeqLabC DoAbsOrInc CRCOffC FeedC MoveHVC MoveDC FeedRateC EOL
ELSE
IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps}
SeqLabC DoAbsOrInc FeedC MoveXYZC FeedRateC EOL
ELSE
IF Decelerate?
IF RoomToDecel?
DecelMove1
SeqLabC DoAbsOrInc CRCOnC FeedC MoveHVC MoveDC FeedRateC EOL
DecelMove2
END
SeqLabC DoAbsOrInc CRCOnC FeedC MoveHVC MoveDC DecelFeed EOL
ELSE
IF XMove? OR YMove? OR ZMove?
SeqLabC DoAbsOrInc CRCOnC FeedC MoveHVC MoveDC FeedRateC EOL
END
END
END
END
ELSE
IF ArcFeat?
IF XYPlane?
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
IF LastQuadrant? AND Decelerate?
IF RoomToDecel?
DecelMove1
SeqLabC FormatArc ArcFeedC EOL
DecelMove2
END
SeqLabC FormatArc DecelFeed EOL
ELSE
SeqLabC FormatArc ArcFeedC EOL
END
NEXTQuadrant
ELSE
EACHArcSegment
SeqLabC DoAbsOrInc FeedC MoveHVC MoveDC EOL
NEXTArcSegment
END
END
END
END
END
NEXTFeat
RestoreAbsOrInc
RETURN

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

AutoCycCutSub2: {part 2}
ToolPath
SeqLabC AbsOrInc
IF Repeats? AND FeedConnect? AND ZshiftOnly?
ELSE
IF FIFO?
FeedC DCP2 FeedEntC
ELSE
RapidC DCP2
END
END
EOL
SeqLabC EndSub EOL
CloseSub
SetSRSubXY {restore SR to 1st position value}
SetSRSubMove
RETURN

AutoCycPat:
SetPass2 {position pattern}
ToolPath {call after NewProg for correct sub calls}
SetPass1 {reset}
RETURN

Milling:
IF AutoCycle?
NewProg
AutoCycCutSub1
EntryMove
AutoCycCutSub2
AutoCycPat
ELSE
EntryMove
ToolPath
END
RETURN

G92Sub:
SubWarning
StdSub
SeqLabC AbsOrInc Connect StartPos 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?
SeqLabC Feed IncValue StartPosC EOL
SeqLabC AbsOrInc
ELSE
SeqLabC Feed
END
ELSE
SeqLabC Feed
END
DInPlusInc FeedEnt EOL
ELSE
IF NOT FirstCycle?
IF SPXMove? OR SPYMove?
SeqLabC Rapid IncValue StartPosC EOL
IF FeedEntry?
SeqLabC AbsOrInc DCP2PlusInc EOL
SeqLabC Feed DInPlusInc FeedEnt EOL
ELSE
SeqLabC AbsOrInc DInPlusInc EOL
END
ELSE
IF FeedEntry?
SeqLabC Rapid DCP2PlusInc EOL
SeqLabC Feed DInPlusInc FeedEnt EOL
ELSE
SeqLabC Rapid DInPlusInc EOL
END
END
ELSE
IF FeedEntry?
SeqLabC Feed DInPlusInc FeedEnt EOL
ELSE
SeqLabC Rapid DInPlusInc EOL
END
END
END
IF FirstCycle?
SetStatusOff {protect Z position for incremental sub}
END
SeqLabC CallLab EOL
NextCycle
SetStatusOn
AutoCycCutSub1 {build element sub}
AutoCycCutSub2
IF FeedConnect? {there is no Z up in the sub}
IF FIFO?
SeqLabC Feed DCP2 FeedEnt EOL
ELSE
SeqLabC Rapid DCP2 EOL
END
END
SeqLabC EndSub EOL
CloseSub
{Element shift, not pattern}
RETURN

ZonlyRep:
EachCycle
IF NOT FirstCycle?
SeqLabC Connect StartPos EOL
END
IF FeedConnect?
SeqLabC FeedC DInPlusInc FeedEnt EOL
ELSE {Entry/Exit Connect}
IF FeedEntry?
IF NOT FirstCycle?
SeqLabC RapidC DCP2PlusIncC EOL
END
SeqLabC Feed DInPlusInc FeedEnt EOL
ELSE
SeqLabC RapidC DInPlusInc EOL
END
END
SeqLabC CallLab EOL
NextCycle
StartSub
TrackZNO# FIRST SPZ#
ToolPath
FinishSub1
SeqLabC EndSub 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?
SeqLabC DCP2C 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') {std sep sub Zreps are in effect} {rep change 2}
ZonlyRep {rep change 1}
SetFlagF('1') {not std sep sub Zreps in effect} {rep change 3}
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
IF AutoCycle?
SeqLabC DCP3C EOL
ELSE
IF FIFO?
SeqLabC FeedC CRCOffC DCP3C FeedEntC EOL
ELSE
SeqLabC RapidC CRCOffC DCP3C EOL
END
END
ELSE
IF Drilling?
IF Repeats?
NewProg
StdSub
SeqLabC AbsOrInc Rapid StartPos EOL
END
GetCycle
IF NOT RigidTap?
SeqLabC FeedEnt EOL
ELSE
SeqLabC ' M18' EOL
END

SeqLabC

IF Peck?
' R0=0'
' R1=' Peck#
END

' R2='
IF Equal? Recall# Num#('3') Num#('1') { Top }
DoCP2
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
DoNegCP2
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
DoCP2
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
DoNegCP2
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
DoCP2
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
DoNegCP2
END

' R3='
IF Equal? Recall# Num#('3') Num#('1') { Top }
DoZDepth
END
IF Equal? Recall# Num#('3') Num#('2') { Front }
DoNegZDepth
END
IF Equal? Recall# Num#('3') Num#('3') { Right }
DoZDepth
END
IF Equal? Recall# Num#('3') Num#('4') { Bottom }
DoNegZDepth
END
IF Equal? Recall# Num#('3') Num#('5') { Back }
DoZDepth
END
IF Equal? Recall# Num#('3') Num#('6') { Left }
DoNegZDepth
END

IF Dwell?
' R4=' Dwell#
ELSE
' R4=0'
END
IF Peck?
' R5=' Peck#
END

IF Tap?
IF CWSpindle?
' R6=4'
' R7=3'
ELSE
' R6=3'
' R7=4'
END
IF RigidTap?
' R8=2'
ELSE
' R8=0'
END
IF RigidTap?
' R9=' FeedTapIPR#('1')
END
END

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

IF Peck?
IF PeckChipBreaker?
' R11=0'
ELSE
' R11=1'
END
END

IF RigidTap?
' R14=4'
' R20=0'
' R21=' SpeedRPM#
END

IF FIRO?
IF Dwell?
' R50=82'
ELSE
' R50=81'
END
ELSE
IF Peck?
' R50=83'
ELSE
IF Tap?
' R50=84'
ELSE
IF FIFO?
' R50=89'
ELSE
' R50=??'
END
END
END
END

EOL

IF CallMasterOp?
SeqLabC CallLabB CallMasterNum# EOL
SkipToLastFeat
ELSE
TrackZNO# FIRST SPZ#
IF MasterOp?
SetFlag('1') {std sep sub Zreps in effect}
NewMasterProg
SeqLabC CallLab EOL
StartSub
SeqLabC ' G=R50' EOL
ToolPath
SeqLabC DrillOff EOL
IF RigidTap?
SeqLabC ' M20' EOL
END
SeqLabC EndSub EOL
CloseSub
SetFlagF('1') {not std sep sub Zreps in effect}
ELSE
SeqLabC ' G=R50' EOL
ToolPath
SeqLabC DrillOff EOL
IF RigidTap?
SeqLabC ' M20' EOL
END
END
END
SetDrillEndOpZ
SeqLabC RapidC DCP3C EOL
IF Repeats?
FinishSubG92
END
END
END
RETURN

Initialize:
InitProg
ReverseXZArcs
InitWFONum
SetFlood
UseSeparateSubCalls
SetMaxSeparateSubCalls('50')
SetArcSegmentAccuracy('.001') { .001 inches }
SetTCZ('7.95')
Save# Num#('1') Num#('0') { A Axis Position }
Save# Num#('2') Num#('0') { B Axis Position }
Save# Num#('3') Num#('0') { Current Face }
Save# Num#('4') Num#('0') { LAST Face }
Save# Num#('5') Num#('0') { Current Face Modifier }
Save# Num#('6') Num#('0') { starting sequence number }
SetFlagF('1') {not std sep sub Zreps in effect} {rep change 2}
SetFlag('2') {WFO needs to be output}
SetFlag('3') {True = incrementing WFO numbers for MP. False = decrementing WFO numebrs for MP}
SetFlag('4') {True = toggle between incrementing/decrementing WFOs }
SetFlagF('5') {ErrorCheck}
SetFlagF('6') {RightSideErrorIgnore}
SetFlagF('7') { Suppress Redundant WFO for MP-OTAP-ECP }
RETURN

ProgStart:
Initialize
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 + 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
' TOOLCHANGEZ(), TCZ() -' EOL
' Set the retract Z value. Modal, changes all following OPs.' EOL
' Value is set to 7.95 as a default.' EOL
END
RETURN

InitOp:
EOR 'MPF' Program# 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 ' MoveType$ ' INCHES )' EOL
END
IF PartsComment?
'( PARTS PROGRAMMED: ' Parts# ' )' EOL
END
IF StartToolComment?
'( FIRST TOOL NOT IN SPINDLE )' EOL
END
END
Save# Num#('6') Sequence#
OpenSub
RestoreScale
RETURN

FirstOp1:
SaveCSAngleA SaveCSAngleB SaveFace
':?' Rapid Plane CRCOff DrillOff EOL
SeqLabC OpToolID ToolChng EOL
DoOpComments
DoPostScript
SeqLabC SetPlane EOL
SeqLabC WFOStuff EOL
RETURN

FirstOp2:
CheckPass
SeqLabC ' @714' EOL
SeqLabC SetCSAngleB EOL
SeqLabC ' @714' EOL
SeqLabC SetCSAngleA EOL
SeqLabC ' L9100' EOL
IF NOT RigidTap?
SeqLabC Speed SpinOn EOL
END
SeqLabC AbsOrInc Rapid DCP1 ToolOfst EOL
RETURN

FirstOp3:
SeqLabC StartPos EOL
SeqLabC CoolOn EOL
RETURN

NewToolOp1:
SeqLabC CoolOff EOL
SeqLabC WFOOff OfstOff ' Z' TCZ# EOL
RETURN

NewToolOp2:
DoEndOpPS
IF ToolChangeAtHome?
SeqLabC AbsOrIncC Rapid Home SpinOff EOL
ELSE
SeqLabC SpinOff EOL
END
IF LAST ProgStop?
SeqLabC ' M0' EOL
ELSE
SeqLabC ProgStop EOL
END
RETURN

NewToolOp3: {Start new Operation}
SaveCSAngleA SaveCSAngleB SaveFace
':?' Rapid Plane CRCOff DrillOff EOL
SeqLabC OpToolID ToolChng EOL
DoOpComments
DoPostScript
SeqLabC SetPlane EOL
SeqLabC WFOStuff EOL
RETURN

NewToolOp4:
CheckPass
SeqLabC ' @714' EOL
SeqLabC SetCSAngleB EOL
SeqLabC ' @714' EOL
SeqLabC SetCSAngleA EOL
SeqLabC ' L9100' EOL
IF NOT RigidTap?
SeqLabC Speed SpinOn EOL
END
SeqLabC AbsOrInc Rapid DCP1 ToolOfst EOL
RETURN

NewToolOp5:
SeqLabC StartPos EOL
SeqLabC CoolOn EOL
RETURN

SameToolOp1:
DoEndOpPS
IF LAST ProgStop?
SeqLabC CoolOff EOL
SeqLabC WFOOff OfstOff ' Z' TCZ# EOL
SeqLabC SpinOff EOL
SeqLabC ' M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqLabC CoolOff EOL
END
IF NewToolOffset? OR ChangeCS?
SeqLabC WFOOff OfstOff ' Z' TCZ# EOL
END
END
RETURN

SameToolOp2: {Start new Operation}
SaveCSAngleA SaveCSAngleB SaveFace
DoOpComments
DoPostScript
SeqLabC PlaneC EOL
SeqLabC SetPlane EOL
SeqLabC WFOStuff EOL
CheckPass
RETURN

SameToolOp3: {Start new Operation}
IF LAST ProgStop?
SeqLabC ' @714' EOL
SeqLabC SetCSAngleB EOL
SeqLabC ' @714' EOL
SeqLabC SetCSAngleA EOL
SeqLabC ' L9100' EOL
IF NOT RigidTap?
SeqLabC Speed SpinOn EOL
END
SeqLabC AbsOrInc Rapid DCP1 ToolOfst EOL
SeqLabC StartPos EOL
SeqLabC CoolOn EOL
ELSE
SeqLabC ' @714' EOL
SeqLabC SetCSAngleB EOL
SeqLabC ' @714' EOL
SeqLabC SetCSAngleA EOL
SeqLabC ' L9100' EOL
IF NOT RigidTap?
SeqLabC Speed SpinOn EOL
END
IF NewToolOffset? OR ChangeCS?
SeqLabC AbsOrInc Rapid DCP1 ToolOfst EOL
SeqLabC StartPos EOL
ELSE
SeqLabC AbsOrInc Rapid StartPos EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqLabC CoolOn EOL
END
END
RETURN

End1:
SeqLabC CoolOff EOL
SeqLabC WFOOff OfstOff ' Z' TCZ# EOL
RETURN

End2:
DoEndOpPS
IF FIRST ToolChangeAtHome? {added FIRST modifier}
SeqLabC AbsOrIncC Rapid FirstHome SpinOff EOL
ELSE
SeqLabC SpinOff EOL
END
IF ProgStop?
SeqLabC ' M0' EOL
END
RETURN

End3:
SeqLabC EOP EOL
CloseSub
Post2 {organize Subs into one program}
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
Retag
RETURN

MPallTools1P: {Multiple Parts, All Tools 1 Part}
EachOp {Start of post processing}
IF EquallySpacedOffsets?
SetFlag('2')
END
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 EquallySpacedOffsets?
SetFlag('2')
END
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}
SetFlag('2')
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}
SetFlag('2')
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

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

ErrorCheck:
EachOp
SaveCSAngleA SaveCSAngleB SaveFace
IF Equal? Recall# Num#('3') Num#('0')
'Operation# ' Operation# ' has no side defined.' EOL
SetFlag('5')
END
IF Equal? Recall# Num#('3') Num#('4')
'Operation# ' Operation# ' has bottom side defined.' EOL
'This machine is not equipped for' EOL
'Bottom Side machining.' EOL
SetFlag('5')
END
NextOp
RETURN

{Start of executable Prog, top level ****}

Initialize
SetLowerCaseOK
RightSideErrorIgnore
ErrorCheck
IF Flag?('5') { 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}
IF MultipleParts?
IF AllToolsOnePart?
MPallTools1P
ELSE {implied OneToolAllParts?}
IF FullUp?
MP1ToollAllPfu
ELSE {implied ExitClearancePlane?}
MP1ToollAllPXcp
END
END
ELSE
NoMPs
END
END


Wyszukiwarka

Podobne podstrony:
Siemens 810M Union [SE] MQ17 15
Siemens 850 Pen [GT] DU14 15
Siemens 850 Pen [GT] DU14 15
Siemens 810M Union [GT] M395 15
Siemens 810M Union [GT] C395 15
Siemens 850 Pen [GT] MU14 15
Using the Siemens S65 Display
15 3
15
Program wykładu Fizyka II 14 15

więcej podobnych podstron