Fanuc 12M Toyoda [AP] BU78 16 01


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

{5/15/98,
Updated: Fanuc 6M (FW) B001.15
Created: Fanuc 6M [FW] B001.16
For: Gibbs & Associates
Versions: Catalyst v4.23.13(mac)/ComPost2 1.1b3
Corrected support for Linear ChangeCS.
Linear ChangeCS covers Multiple CSGroups in One Plane.
Post does not output CSWFOComments, G52Comments or G52Stuff for this situation.
IF AAxisAvail? OR BAxisAvail? does not automatically support this.
Deleted IF AAxisAvail? OR BAxisAvail? at G52Stuff, DoCSComment and DoCSWFOComment.
Post retracts Tool at SameTool for this situation.
Retraction is only necessary for AChange OR BChange situations.
Changed ChangeCS? to AChange? OR BChange at SameToolOp1.
Changed ChangeCS? to AChange? OR BChange at SameToolOp3.
Simplified ClearCSOffset occurance.
ClearCSOffset occurs at 5 different places, including at the output of CSComments.
Discovered that CheckPass is a good place for all situations.
Deleted ClearCSOffset at CSComments.
Caused simplification of Procedure.
Deleted ClearCSOffset at CSG52, DoCSWFOComment, OpenMP and SubCSMP Procedures.
Added ClearCSOffset at CheckPass.
Additional modifications.
Moved IF FirstOperation? OR NewTool? OR ChangeCS? Boolean from CSG52 to G52Stuff.
Moved DoSubComment Procedure to before DoOpComments Procedure.
To keep CSStuff together.
Moved call to CSComments Procedure to inside IF UseComments? Boolean at DoOpComments.
To suppress when Comments are turned off.
Added AbsValueC, IncValueC and AbsOrIncC Procedures.
Simplifies readability of Prog.
Reduces redundancy of output.
Allows us to return to earlier versions
Improves upon earlier problem with incremental output of ShiftPC command at CloseMP while
allowing us to return to .85 OfstOff blocks.
AbsValueC called from AbsOrIncC.
IncValueC called from AbsOrIncC, DoAbsOrInc and DoDrillAbsOrInc.
IncValueC called for OfstOff Blocks at NewToolOp1, two places at SameToolOp1 and DoAbsOrInc.
AbsOrIncC called for ShiftPC Block at CloseMP.
AbsOrIncC called from DoAbsOrInc, DoDrillAbsOrInc and RestoreAbsOrInc.
AbsOrIncC called for Home Block at NewToolOp2.
AbsOrIncC called for FirstHome Block at End2.
Added CRCOffC at AutoCycCutSub2.
Corrects unique situation in ZonlyRepAutoCycle where one Operation is CRCLeft and LastFeat
is an ArcFeat followed by another Operation that is CRCRight.
CRCOffC did not get output at end of CRCLeft Operation and CRCOnC did not get output at start
of CRCRight Operation.
Oddly, CRCOnC only outputs if CRCOffC has been output, not if CRCSide changes.
Moved call to InitOp Procedure to top level at end of Prog.
Personal Preference.
6/18/98
Changed to Lowercase Procedure Names.
Added comments to all SetFlag, SetFlagF and IF Flag statements.
Added Flag(6) to switch from B-Style to C-Style at progStart.
TRUE = B-Style Output, FALSE = C-Style Output.
Added Flag(7) to switch from local coordinates to uncompensated coordinates at progStart.
TRUE = Local WFO Coordinates, FALSE = D-Style Output.
Added pertinent comments at progStart.
Added IF Equal? NumOfCS# Num#('1') at progStart.
This is a standard 3 Axis - Output M-Style.
Changed Seq to SeqC at autoCycCutSub1.
Added CRCOffC to AutoCycle ZCP3C at end of IF Milling?
Moved CRCOffC to before FeedC and RapidC for ZCP3C at end of IF Milling?
To stay consistant with CRCOnC/CRCOffC Rapid/Feed/CWArc/CCWArc throughout Prog.
Changed literal 'G80' to DrillOff at end of IF Drilling.
Changed literal 'G80' to DrillOff at firstOp1 and newToolOp3.
To allow for change in FORM without having to recompile.
Changed SpeedC to Speed at for LAST ProgStop condition at sameToolOp3.
6/30/98
Deleted Gibbs System XYRepeat support.
Virtual only support ZShiftOnly Repeats.
Rewrote OpGuts Procedure.
Limited Milling Repeats to ZShiftOnly at IF Milling.
Deleted Drilling Repeats at IF Drilling.
Rewrote PostScript instructions at progStart.
7/22/98
Reverted back to Gibbs System XYRepeat support.
IF setup correctly, Virtual will support XShift and/or YShift Repeats for both Contour and
Patterns.
Rules for correct setup (as best as I understand at the moment).
Geometry CSGroup must be oriented to a plane that intersects CS#1 in a perpendicular direction.
Example, XZPlane and YZPlane, and any oriented rotation of either Plane around the XYPlane.
Any change in the ZPitch of the Origin will cause ZShiftOnly Repeat Operation.
Set Desired ZStep so that Operation will result in multiple passes.
NOTE: If correctly setup, ZStep would be misleading.
Step will be in line with depth axis of CSGroup.
Restored related code to OpGuts Procedure.
ZShiftOnly Contour Operations remain Full SepSub.
Any customer requesting G92 Style will require copying code from archives.
Deleted Deceleration from ToolPath LineFeat and ArcFeat.
There are plans to support this in the future through the use of Construction Tools in the
Virtual Process.
9/1/98
Added forced FeedRate for RI-RO Milling Operations.
When a RI-RO Operation follows either a FI-RO or RI-RO Operation, and both contain the same
FeedRate values, the second Operation does not get a FeedRate output due to the conditional
FeedRateC command. A problem arises for MultipleParts - OneToolAllParts - ExitClearancePlane
Programs when both Operations use different Tools, and a third Operation uses the SameTool as the
second Operation, but has a different FeedRate value. The result is that when the Program moves
to machine the additional parts with the second Operation at the FeedRate value of the third
Operation. It is safer to just force the FeedRate in the second Operation.
Added FORMAT#7, '#' at Prog Numeric Format Definitions.
Added RapidF# to Format#7 at Prog Numeric Format Definitions.
RapidF# equals zero and this FORMAT allows for nothing to be output.
Added RapidF# at entryMove Procedure.
Added IF FirstOperation? OR NewTool? condition two places at entryMove Procedure.
To force FeedEnt and RapidF#.
SameTool condition outputs conditional FeedEntC.
Added IF NOT AbsoluteMoves? Boolean and SetSRXYtoEP command to zonlyRep.
This fixes problem with Incremental output of move back to StrtPos for additional passes.
Deleted UseSeparateSubCalls at ProgStart Procedure.
Deleted SetMaxSeparateSubCalls('50') at ProgStart Procedure.
Moved IF ToolChangeAtHome? Boolean and SetHome command from InitOp to FirstOp1.
Personal preference for moving Procedure call to top level at end of Prog on 5/15/98 was to
reduce it to one occurance, consistant with LongHand version where it works. However, it was
reported that the IF ToolChangeAtHome? Boolean and SetHome command occuring outside of
EachOp/NextOp loop was causing Windows version to crash. Duplicating problem required having a
part file open and a post processor loaded, and then opening a new part with one of the beta
masters. I was not able to duplicate this on the Macintosh.
Changed name of doCSG52Ops Procedure to doWFOOps.
Changed call of same two places at openMP.
Name was misleading because Procedure is also called for standard MultipleParts output, not just
G52Style and contents are identicle to M001.
9/24/98
Added Post Header Comment at top.
Added missing END command at entryMove.
Changed IncValue to incValueC at autoCycCutSub1.
Changed AbsOrInc to absOrIncC at autoCycCutSub2.
Changed AbsOrInc to absOrIncC at g92Sub.
Added support of Incremental Output for SepSubs.
When user selects Incremental Output, SepSubZMoves are incorrect.
Added doSepSubZMoves Procedure.
Contains code for ZPosMoves from zonlyRepAutoCycle and zonlyRep Procedures.
Outputs Incremental ZExitMove for Exit/Entry.
AutoCycles Retract to ZCP2.
Non-AutoCycles Retract to ZCP3.
Added setSepSubZ Procedure.
Updates Status Register to final ZInPos for FeedEntry.
Modified zonlyRepAutoCycle Procedure.
Modified zonlyRep Procedure.
Expanded Advanced Milling Flags for easier developing.
Changed Flag(7) to be dedicated to D-Style Output only.
Added Flag(8) for Toggle between D-Style and G52-Style Output.
5 possible combinations:
BStyle/G52Style Flag(6) FlagF(7) FlagF(8)
BStyle/DStyle Flag(6) FlagF(7) Flag(8)
CStyle/G52Style FlagF(6) FlagF(7) FlagF(8)
CStyle/DStyle FlagF(6) FlagF(7) Flag(8)
DStyle FlagF(6) Flag(7) Flag(8)
10/1/98
Versions: Virtual 4.29.75(Mac)/ComPost2 1.7b10 (Mac)
Versions: Virtual 4.29.75(Win)/ComPost2 1.7b10 (Win)
Corrected old problem with Incorrect Status Register XYPos at end of Pattern AutoCycle Operation.
Problem is caused because Status Register is left in SetPass1 [ Contouring ] Mode and does not compensate
for SetPass2 [ PointFeat Position ] Mode Coordinates
Correction fixes known problems with Full Incremental Output.
Correction also fixes known problems with MultipleParts EquallySpacedOffsets ShiftPC and UnshftPC commands.
Added TrackXNO# to FORMAT#4 at Prog Numeric Format Definitions.
Added TrackYNO# to FORMAT#4 at Prog Numeric Format Definitions.
Added getACEPXY Procedure.
Called from ToolPath PointFeat.
Stores uncompensated LastFeat SPX# to Var(1).
Stores uncompensated LastFeat SPY# to Var(2).
Added setSRXYtoACEP Procedure.
Called at end of OpGuts IF Milling.
Adds SetPass1 LastFeat SPXY# to uncompensated SetPass2 LastFeat SPXY#.
Added Var(1) for storage of XPosition at progStart Procedure.
Added Var(2) for storage of YPosition at progStart Procedure.
DWB}

{9/12/98,
Initial : Fanuc 6M [FW] B001.16
Created: Fanuc 12M Toyoda [AP] BU78.16.00 (preliminary copy)
Customer: Alcoa Packaging Machinery, Duane Hill - 303/708-5144

Changes to "Form":

1. Under Arcs, changed I-J Max Arc Radius to 0.000

Changes to "Prog":

1. Removed Flag('2'). *** not yet ***
2. Changed wFOStuff sub.
3. Added attachHead sub and SetPalletIn('1').
4. Added rotateHead sub.
5. Added W-axis output after tool change and TCZ#.
6. Changed OfstOn to doOfstOn, added doOfstOn sub, added FORMAT for ClearancePlane1#.
7. Made changes to firstOp, newToolOp, sameToolOp, and end subs.
8. Changed StrtPos to doStartPos, added doStartPos sub, added FORMAT for StartPosX#
and StartPosY#.
9. Changed ZCP2 to doZCP2, added doZCP2 sub, added FORMAT for ClearancePlane2#.
10. Removed ZCP2C and DrillCP from opGuts and added newToolZCP2, sameToolZCP2, doZCP1 subs.
11. Changed ZIn to doZIn, added doZIn sub, added FORMAT for SPZ#.
12. Changed ZCP3 to doZCP3, added doZCP3 sub, added FORMAT for ClearancePlane3#.
13. Changed ZCP3C to doZCP3C and added doZCP3C sub.
14. Revised ckCRC sub to reverse G41/G42 for CS#5 & 6.
15. Revised formatArc sub to reverse G2/G3 for CS#5 & 6.
16. Changed MoveXYZC to doMoveXYZC and added doMoveXYZC sub.
17. Added doXMove, doYMove, and doZMove subs. Added FORMAT for EPX#, EPY#, & EPZ#.
18. Changed ZInPlusInc to doZInPlusInc, added doZInPlusInc sub, added FORMAT for
ZInPlusInc#.
19. Changed ZCP2PlusInc to doZCP2PlusInc, added doZCP2PlusInc sub, added FORMAT for
ZCP2PlusInc#.
20. Changed ZDepth to doZDepth, added doZDepth sub, added FORMAT for ZDepth#.
21. Changed RLevel to doRLevel and added doRLevel sub.
22. Changed MoveSXYZC to drillMoveSXYZC and added drillMoveSXYZC sub.
23. Added drillXMove, drillYMove, and drillZMove subs. Added FORMAT for SPX# & SPY#.
24. Removed doCSWFOComment call.
JHE}

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

#1 = '###.00'
#2 = '#####.###;0.'
#3 = '*#####.####;0.' {Changed from '*#####.###;0.' - JHE}
#4 = '####.####;0.'
#5 = '#######0'
#6 = '####^##0'
#7 = '#'

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(CSOffsetA#,3)
FORMAT(CSOffsetB#,3)
FORMAT(ToolDiameter#,4)
FORMAT(CSOffsetX#,4)
FORMAT(CSOffsetY#,4)
FORMAT(CSOffsetZ#,4)
FORMAT(TrackXNO#,4)
FORMAT(TrackYNO#,4)
FORMAT(TrackZNO#,4)
FORMAT(EPX#,4) {Added - JHE}
FORMAT(EPY#,4) {Added - JHE}
FORMAT(EPZ#,4) {Added - JHE}
FORMAT(SPX#,4) {Added - JHE}
FORMAT(SPY#,4) {Added - JHE}
FORMAT(SPZ#,4) {Added - JHE}
FORMAT(TCZ#,4) {Added - JHE}
FORMAT(StartPosX#,4) {Added - JHE}
FORMAT(StartPosY#,4) {Added - JHE}
FORMAT(ZDepth#,4) {Added - JHE}
FORMAT(ClearancePlane1#,4) {Added - JHE}
FORMAT(ClearancePlane2#,4) {Added - JHE}
FORMAT(ClearancePlane3#,4) {Added - JHE}
FORMAT(ZInPlusInc#,4) {Added - JHE}
FORMAT(ZCP2PlusInc#,4) {Added - JHE}
FORMAT(ADD#,5)
FORMAT(CS#,5)
FORMAT(Program#,5)
FORMAT(CallMasterNum#,5)
FORMAT(CSSubID#,5)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(NewWFO#,5)
FORMAT(Parts#,5)
FORMAT(Dwell#,6)
FORMAT(RapidF#,7)

{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

attachHead: {Added this sub - JHE}
IF Equal? Pallet# Num#('1')
SeqC 'G65P8653A1.' EOL
ELSE
IF Equal? Pallet# Num#('2')
SeqC 'G65P8653A2.' EOL
ELSE
IF Equal? Pallet# Num#('3')
SeqC 'G65P8653A3.' EOL
END
END
END
SetPalletIn('0')
RETURN

rotateHead: {Added this sub - JHE}
IF Equal? CS# Num#('3')
SeqC 'G65P8651I270.' EOL
ELSE
IF Equal? CS# Num#('4')
SeqC 'G65P8651I0.' EOL
ELSE
IF Equal? CS# Num#('5')
SeqC 'G65P8651I90.' EOL
ELSE
IF Equal? CS# Num#('6')
'G65P8651I180.' EOL
END
END
END
END
RETURN

doOfstOn: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'G43Z' ClearancePlane1# ToolOfst
ELSE
IF Equal? CS# Num#('3')
'G43Y' ClearancePlane1# ToolOfst
ELSE
IF Equal? CS# Num#('4')
'G43X' ClearancePlane1# ToolOfst
ELSE
IF Equal? CS# Num#('5')
FORMAT(ClearancePlane1#,3)
'G44Y' ClearancePlane1# ToolOfst
FORMAT(ClearancePlane1#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(ClearancePlane1#,3)
'G44X' ClearancePlane1# ToolOfst
FORMAT(ClearancePlane1#,4)
END
END
END
END
END
RETURN

doStartPos: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'X' StartPosX# 'Y' StartPosY#
ELSE
IF Equal? CS# Num#('3')
FORMAT(StartPosY#,3)
'X' StartPosX# 'Z' StartPosY#
FORMAT(StartPosY#,4)
ELSE
IF Equal? CS# Num#('4')
'Y' StartPosX# 'Z' StartPosY#
ELSE
IF Equal? CS# Num#('5')
'X' StartPosX# 'Z' StartPosY#
ELSE
IF Equal? CS# Num#('6')
FORMAT(StartPosX#,3)
'Y' StartPosX# 'Z' StartPosY#
FORMAT(StartPosX#,4)
END
END
END
END
END
RETURN

doZCP1: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' ClearancePlane1#
ELSE
IF Equal? CS# Num#('3')
'Y' ClearancePlane1#
ELSE
IF Equal? CS# Num#('4')
'X' ClearancePlane1#
ELSE
IF Equal? CS# Num#('5')
FORMAT(ClearancePlane1#,3)
'Y' ClearancePlane1#
FORMAT(ClearancePlane1#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(ClearancePlane1#,3)
'X' ClearancePlane1#
FORMAT(ClearancePlane1#,4)
END
END
END
END
END
RETURN

doZCP2: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' ClearancePlane2#
ELSE
IF Equal? CS# Num#('3')
'Y' ClearancePlane2#
ELSE
IF Equal? CS# Num#('4')
'X' ClearancePlane2#
ELSE
IF Equal? CS# Num#('5')
FORMAT(ClearancePlane2#,3)
'Y' ClearancePlane2#
FORMAT(ClearancePlane2#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(ClearancePlane2#,3)
'X' ClearancePlane2#
FORMAT(ClearancePlane2#,4)
END
END
END
END
END
RETURN

newToolZCP2: {Added this sub - JHE}
IF Drilling?
IF RetractToCP1?
{tool is already at ZCP1}
ELSE
IF NOT Equal? ClearancePlane1# ClearancePlane2#
doZCP2
END
END
ELSE {implies Milling}
IF NOT Equal? ClearancePlane1# ClearancePlane2#
doZCP2
END
END
RETURN

sameToolZCP2: {Added this sub - JHE}
IF Drilling?
IF RetractToCP1?
IF NOT Equal? LAST ClearancePlane3# ClearancePlane1#
doZCP1
END
ELSE
IF NOT Equal? LAST ClearancePlane3# ClearancePlane2#
doZCP2
END
END
ELSE {implies Milling}
IF LAST ProgStop? OR NewToolOffset? OR ChangeCS?
newToolZCP2
ELSE
IF NOT Equal? LAST ClearancePlane3# ClearancePlane2# OR ChangeCS?
doZCP2
END
END
END
RETURN

doZCP3: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' ClearancePlane3#
ELSE
IF Equal? CS# Num#('3')
'Y' ClearancePlane3#
ELSE
IF Equal? CS# Num#('4')
'X' ClearancePlane3#
ELSE
IF Equal? CS# Num#('5')
FORMAT(ClearancePlane3#,3)
'Y' ClearancePlane3#
FORMAT(ClearancePlane3#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(ClearancePlane3#,3)
'X' ClearancePlane3#
FORMAT(ClearancePlane3#,4)
END
END
END
END
END
RETURN

doZCP3C: {Added this sub - JHE}
IF NOT Equal? ClearancePlane3# SPZ#
doZCP3C
END
RETURN

doZIn: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' FIRST SPZ#
ELSE
IF Equal? CS# Num#('3')
'Y' FIRST SPZ#
ELSE
IF Equal? CS# Num#('4')
'X' FIRST SPZ#
ELSE
IF Equal? CS# Num#('5')
FORMAT(SPZ#,3)
'Y' FIRST SPZ#
FORMAT(SPZ#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(SPZ#,3)
'X' FIRST SPZ#
FORMAT(SPZ#,4)
END
END
END
END
END
RETURN

doZInPlusInc: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' ZInPlusInc#
ELSE
IF Equal? CS# Num#('3')
'Y' ZInPlusInc#
ELSE
IF Equal? CS# Num#('4')
'X' ZInPlusInc#
ELSE
IF Equal? CS# Num#('5')
FORMAT(ZInPlusInc#,3)
'Y' ZInPlusInc#
FORMAT(ZInPlusInc#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(ZInPlusInc#,3)
'X' ZInPlusInc#
FORMAT(ZInPlusInc#,4)
END
END
END
END
END
RETURN

doZCP2PlusInc: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' ZCP2PlusInc#
ELSE
IF Equal? CS# Num#('3')
'Y' ZCP2PlusInc#
ELSE
IF Equal? CS# Num#('4')
'X' ZCP2PlusInc#
ELSE
IF Equal? CS# Num#('5')
FORMAT(ZCP2PlusInc#,3)
'Y' ZCP2PlusInc#
FORMAT(ZCP2PlusInc#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(ZCP2PlusInc#,3)
'X' ZCP2PlusInc#
FORMAT(ZCP2PlusInc#,4)
END
END
END
END
END
RETURN

doZDepth: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' ZDepth#
ELSE
IF Equal? CS# Num#('3')
'Y' ZDepth#
ELSE
IF Equal? CS# Num#('4')
'X' ZDepth#
ELSE
IF Equal? CS# Num#('5')
FORMAT(ZDepth#,3)
'Y' ZDepth#
FORMAT(ZDepth#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(ZDepth#,3)
'X' ZDepth#
FORMAT(ZDepth#,4)
END
END
END
END
END
RETURN

doRLevel: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'R' ClearancePlane2#
ELSE
IF Equal? CS# Num#('3')
'R' ClearancePlane2#
ELSE
IF Equal? CS# Num#('4')
'R' ClearancePlane2#
ELSE
IF Equal? CS# Num#('5')
FORMAT(ClearancePlane2#,3)
'R' ClearancePlane2#
FORMAT(ClearancePlane2#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(ClearancePlane2#,3)
'R' ClearancePlane2#
FORMAT(ClearancePlane2#,4)
END
END
END
END
END
RETURN

drillXMove: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'X' SPX#
ELSE
IF Equal? CS# Num#('3')
'X' SPX#
ELSE
IF Equal? CS# Num#('4')
'Y' SPX#
ELSE
IF Equal? CS# Num#('5')
'X' SPX#
ELSE
IF Equal? CS# Num#('6')
FORMAT(SPX#,3)
'Y' SPX#
FORMAT(SPX#,4)
END
END
END
END
END
RETURN

drillYMove: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Y' SPY#
ELSE
IF Equal? CS# Num#('3')
FORMAT(SPY#,3)
'Z' SPY#
FORMAT(SPY#,4)
ELSE
IF Equal? CS# Num#('4')
'Z' SPY#
ELSE
IF Equal? CS# Num#('5')
'Z' SPY#
ELSE
IF Equal? CS# Num#('6')
'Z' SPY#
END
END
END
END
END
RETURN

drillZMove: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' SPZ#
ELSE
IF Equal? CS# Num#('3')
'Y' SPZ#
ELSE
IF Equal? CS# Num#('4')
'X' SPZ#
ELSE
IF Equal? CS# Num#('5')
FORMAT(SPZ#,3)
'Y' SPZ#
FORMAT(SPZ#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(SPZ#,3)
'X' SPZ#
FORMAT(SPZ#,4)
END
END
END
END
END
RETURN

drillMoveSXYZC: {Added this sub - JHE}
IF SPXMove?
drillXMove
END
IF SPYMove?
drillYMove
END
IF SPZMove?
drillZMove
END
RETURN

doXMove: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'X' EPX#
ELSE
IF Equal? CS# Num#('3')
'X' EPX#
ELSE
IF Equal? CS# Num#('4')
'Y' EPX#
ELSE
IF Equal? CS# Num#('5')
'X' EPX#
ELSE
IF Equal? CS# Num#('6')
FORMAT(EPX#,3)
'Y' EPX#
FORMAT(EPX#,4)
END
END
END
END
END
RETURN

doYMove: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Y' EPY#
ELSE
IF Equal? CS# Num#('3')
FORMAT(EPY#,3)
'Z' EPY#
FORMAT(EPY#,4)
ELSE
IF Equal? CS# Num#('4')
'Z' EPY#
ELSE
IF Equal? CS# Num#('5')
'Z' EPY#
ELSE
IF Equal? CS# Num#('6')
'Z' EPY#
END
END
END
END
END
RETURN

doZMove: {Added this sub - JHE}
IF Equal? CS# Num#('2')
'Z' EPZ#
ELSE
IF Equal? CS# Num#('3')
'Y' EPZ#
ELSE
IF Equal? CS# Num#('4')
'X' EPZ#
ELSE
IF Equal? CS# Num#('5')
FORMAT(EPZ#,3)
'Y' EPZ#
FORMAT(EPZ#,4)
ELSE
IF Equal? CS# Num#('6')
FORMAT(EPZ#,3)
'X' EPZ#
FORMAT(EPZ#,4)
END
END
END
END
END
RETURN

doMoveXYZC: {Added this sub - JHE}
IF XMove?
doXMove
END
IF YMove?
doYMove
END
IF ZMove?
doZMove
END
RETURN

{*** to remove - JHE}
cSPartNum#:
ADD# CS# MUL# NumOfCS# SUB# PartNum# Num#('1')
RETURN

cSWFO:
'G' ADD# cSPartNum# Num#('53')
RETURN

wFO:
'G' ADD# PartNum# Num#('53')
RETURN
{*** end of remove}

wFOStuff: {Changed this sub - JHE}
IF Equal? CS# Num#('2')
SeqC 'G17G55' AbsOrInc EOL
ELSE
IF Equal? CS# Num#('3')
SeqC 'G18G56' AbsOrInc EOL
ELSE
IF Equal? CS# Num#('4')
SeqC 'G19G57' AbsOrInc EOL
ELSE
IF Equal? CS# Num#('5')
SeqC 'G18G58' AbsOrInc EOL
ELSE
IF Equal? CS# Num#('6')
SeqC 'G19G59' AbsOrInc EOL
ELSE
'(*** coordinate system warning ***)' EOL
'(*** you can use only cs2, 3, 4, 5, or 6 ***)' EOL
END
END
END
END
END
{*** removed - JHE
IF Flag?('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF NOT SameTool?
IF WFOCS?
cSWFO
ELSE
wFO
END
ELSE
IF WFOCS?
IF ChangeCS?
IF MultipleParts?
{MP ChangeCS is handled in subCSMP and closeMP}
ELSE
cSWFO
END
END
END
END
END
SetFlagF('2') { Do not output WFO second time wFOStuff is called for MP-WFO-OTAP-ECP }
*** end remove}
RETURN

cSG52: {*** out ***}
SeqC 'G52X' CSOffsetX# 'Y' CSOffsetY# 'Z' CSOffsetZ# EOL
RETURN

g52Stuff: {*** out ***}
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: {Removed all calls - JHE}
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
END
RETURN

cSComments:
doCSComment
IF WFOCS? AND NOT MultipleParts?
{doCSWFOComment} {Removed - JHE}
END
RETURN

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

doOpComments:
IF UseComments?
SetScale('1')
IF OperationIDComment?
'( OPERATION ' Operation# ': ' OperationType$ ' )' EOL
END
IF OperationComment?
'( ' OperationComment$ ' )' EOL
END
IF WorkGroupComment?
'( ' WorkGroupComment$ ' )' EOL
END
IF ToolTypeComment?
'( TOOL ' Tool# ': ' ToolDiameter# ' ' ToolType$ ' )' EOL
END
IF ToolComment?
'( ' ToolComment$ ' )' EOL
END
restoreScale
cSComments
END
RETURN

cSAngleA:
IF AAxisAvail?
IF Flag?('6') AND WFOCS? { TRUE = B-Style Output, FALSE = C-Style Output }
'A0.'
ELSE
'A' CSOffsetA#
END
END
RETURN

cSAngleAC:
IF AChange?
cSAngleA
END
RETURN

cSAngleB:
IF BAxisAvail?
IF Flag?('6') AND WFOCS? { TRUE = B-Style Output, FALSE = C-Style Output }
'B0.'
ELSE
'B' CSOffsetB#
END
END
RETURN

cSAngleBC:
IF BChange?
cSAngleB
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

entryMove:
IF FeedEntry?
SeqC Feed doZIn {Change from ZIn - JHE}
IF FirstOperation? OR NewTool?
FeedEnt EOL
ELSE
FeedEntC EOL
END
ELSE
SeqC RapidC doZIn EOL {Change from ZIn - JHE}
IF FirstOperation? OR NewTool?
RapidF# { Forces FeedRate }
END
END
RETURN

startSub:
OpenSub
SubID EOL
doSubComment
RETURN

subWarning:
IF NOT FeedConnect?
IF AnyZshift?
' ' EOL
'( WARNING Z CLEARANCE WILL CHANGE WITH EACH CYCLE OF SUB REPEAT )' EOL
' ' EOL
END
END
RETURN

stdSub:
SeqC SubCall CallLab RepLab RepCycs EOL
startSub
RETURN

finishSub1: {part 1}
SeqC CRCOffC
IF NOT FeedConnect?
IF AutoCycle?
doZCP3 {>>>???<<< Changed from ZCP3C - JHE}
ELSE
IF FIFO?
FeedC doZCP3 FeedEntC {>>>???<<< Changed from ZCP3C - JHE}
ELSE
RapidC doZCP3 {>>>???<<< Changed from ZCP3C - JHE}
END
END
END
EOL
RETURN

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

absValueC:
IF NOT AbsValue?
AbsValue
END
RETURN

incValueC:
IF AbsValue?
IncValue
END
RETURN

absOrIncC:
IF AbsoluteMoves?
absValueC
ELSE
incValueC
END
RETURN

toggleIncDecWFO: {*** out, for multi parts ***}
IF Flag?('3') { Incrementing WFOs in effect }
SetFlagF('3')
ELSE { Decrementing WFOs in effect }
SetFlag('3')
END
RETURN

doWFOOps: {*** out, for multi parts ***}
IF Flag?('5')
SetFlagF('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
ELSE
SeqC SetWFO EOL
END
SeqC SubCall CallLab RepLab OnePart EOL
RETURN

openMP: {*** out, for multi parts ***}
NewProg
IF WorkFixtureOffsets?
IF WFOCS?
startSub
SaveCSProg
SaveCSOpStart
ELSE
IF OneToolAllParts? AND ExitClearancePlane?
SetFlag('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
END
IF Flag?('3') { Incrementing WFOs in effect }
NewWFO
EachWFO {simple eachPart}
doWFOOps
IncWFO
NextWFO {simple NextPart}
DecWFO
ELSE { Decrementing WFOs in effect }
LastWFO
EachWFO {simple eachPart}
doWFOOps
DecWFO
NextPrevWFO {simple NextPart}
IncWFO
END
IF Flag?('4') { This post supports IncWFO/DecWFO }
toggleIncDecWFO
END
startSub
END
ELSE
SeqC SubCall CallLab RepLab Parts EOL
IF OneToolAllParts? AND ExitClearancePlane?
SetFlag('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
startSub
END
RETURN

doCSWFOOps: {*** out, for multi parts ***}
EachCSOp
{doCSWFOComment} {Removed - JHE}
IF Flag?('5')
SetFlagF('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
ELSE
SeqC cSWFO EOL
END
SeqC SubCall CallLabB CSSubID# RepLab OnePart EOL
NextCSOp
RETURN

closeMP: {*** out, for multi parts ***}
IF WorkFixtureOffsets?
SeqC EndSub EOL
CloseSub
IF WFOCS?
IF OneToolAllParts? AND ExitClearancePlane?
SetFlag('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
END
IF Flag?('3') { Incrementing WFOs in effect }
NewWFO
EachWFO {simple eachPart}
doCSWFOOps
IncWFO
NextWFO {simple NextPart}
DecWFO
ELSE { Decrementing WFOs in effect }
LastWFO
EachWFO {simple eachPart}
doCSWFOOps
DecWFO
NextPrevWFO {simple NextPart}
IncWFO
END
IF Flag?('4') { This post supports IncWFO/DecWFO }
toggleIncDecWFO
END
END
ELSE
SeqC absOrIncC EOL
SeqC Preset ShiftPC EOL
SeqC EndSub EOL
CloseSub
SeqC Preset UnshftPC EOL
END
RETURN

subCSMP: {*** out, for multi parts ***}
IF WFOCS?
IF ChangeCS?
SeqC EndSub EOL
CloseSub
NewProg
startSub
SaveCSProg
END
END
RETURN

doAbsOrInc:
IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated }
IF ZMove?
incValueC
ELSE
absOrIncC
END
END
RETURN

doDrillAbsOrInc:
IF Flag?('1') { DrillSubs activated }
IF SPZMove?
incValueC
ELSE
absOrIncC
END
END
RETURN

restoreAbsOrInc:
IF Flag?('1') { Milling ZShiftOnly SepSubs/DrillSubs activated }
SeqC absOrIncC EOL
END
RETURN

formatArc: {Revised this sub - JHE}
doAbsOrInc
IF ArcCW?
IF GreaterThan? CS# Num#('4')
CCWArcC
ELSE
CWArcC
END
ELSE
IF GreaterThan? CS# Num#('4')
CWArcC
ELSE
CCWArcC
END
END
doMoveXYZC {Changed from MoveXYZC - JHE}
IF ArcIJFormat?
ArcIJC
ELSE
ArcR
END
RETURN

ckCRC: {Revised this sub - JHE}
IF CutterRadiusCompensation?
IF LastFeat?
CRCOff
ELSE
IF FirstFeat?
IF CRCLeft?
IF GreaterThan? CS# Num#('4')
'G42'
ELSE
CRCOn
END
ELSE
IF GreaterThan? CS# Num#('4')
'G41'
ELSE
CRCOn
END
END
END
END
END
RETURN

ckCRCNum:
IF NOT LastFeat? {Removed AND Equal? SPZ# EPZ# - JHE}
CRCOffsetC
END
RETURN

getACEPXY:
SetACSPCompF
Save# Num#('1') SPX# { Status Register Variable for X Axis }
Save# Num#('2') SPY# { Status Register Variable for Y Axis }
SetACSPComp
RETURN

setSRXYtoACEP:
SetPass1
SetSRXYtoEP
LoadFeat Num#('0') Num#('0') Num#('0')
TrackXNO# ADD# Recall# Num#('1') SPX# { Status Register Variable for X Axis }
TrackYNO# ADD# Recall# Num#('2') SPY# { Status Register Variable for Y Axis }
RETURN

toolPath:
ResetCRCNum
EACHFeat
IF PointFeat?
IF AutoCycle?
IF LastFeat?
getACEPXY
END
SeqC MoveSXYC EOL
SeqC SubCall CallLab EOL
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
ELSE
SeqC doDrillAbsOrInc drillMoveSXYZC EOL {Changed from MoveSXYZC - JHE}
END
ELSE
IF RapidFeat?
IF XMove? OR YMove? OR ZMove?
SeqC doAbsOrInc ckCRC RapidC doMoveXYZC ckCRCNum EOL
END
ELSE
IF LineFeat?
IF XMove? OR YMove? OR ZMove?
SeqC doAbsOrInc ckCRC FeedC doMoveXYZC FeedRateC ckCRCNum EOL
END
ELSE
IF ArcFeat?
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
SeqC formatArc ArcFeedC EOL
NEXTQuadrant
END
END
END
END
NEXTFeat
restoreAbsOrInc
RETURN

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

autoCycCutSub2: {part 2}
toolPath
SeqC absOrIncC CRCOffC
IF Repeats? AND FeedConnect? AND ZshiftOnly?
ELSE
IF FIFO?
FeedC doZCP2 FeedEntC {Changed from ZCP2 - JHE}
ELSE
RapidC doZCP2 {Changed from ZCP2 - JHE}
END
END
EOL
SeqC 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
SeqC absOrIncC Connect doStartPos EOL {Changed from StrtPos - JHE}
milling
finishSub1
finishSubG92
RETURN

doSepSubZMoves:
IF FeedConnect?
SeqC FeedC doZInPlusInc FeedEnt EOL {Changed from ZInPlusInc - JHE}
ELSE
IF FeedEntry?
IF NOT FirstCycle?
SeqC RapidC ZCP2PlusInc EOL {Changed from ZCP2PlusInc - JHE}
END
SeqC Feed doZInPlusInc FeedEnt EOL {Changed from ZInPlusInc - JHE}
ELSE
IF FirstCycle? AND AutoCycle?
Rapid
END
SeqC RapidC doZInPlusInc EOL {Changed from ZInPlusInc - JHE}
END
END
SeqC SubCall CallLab EOL
IF NOT FeedConnect? AND NOT AbsValue?
TrackZNO# ZCP2PlusInc#
SeqC doZCP2 EOL {>>> ?? <<< Changed from ZCP2C - JHE}
IF NOT AutoCycle?
TrackZNO# ClearancePlane3#
END
END
RETURN

setSepSubZ:
TrackZNO# ADD# FIRST SPZ# MUL# RepsLess1# RepeatZ#
RETURN

zonlyRepAutoCycle:
autoCycPat {write pattern moves and main calls}
startSub
NewProg
EachCycle
SetSRXYtoEP
IF NOT FirstCycle?
Connect
IF SPXMove? OR SPYMove?
SeqC incValueC doStartPos EOL {Changed from StrtPosC - JHE}
absOrIncC
END
END
SetStatusOn
doSepSubZMoves
SetStatusOff
NextCycle
SetStatusOn
autoCycCutSub1 {build element sub}
TrackZNO# FIRST SPZ#
autoCycCutSub2
IF FeedConnect?
IF NOT AbsValue?
setSepSubZ
END
IF FIFO?
SeqC Feed doZCP2 FeedEnt EOL {Changed from ZCP2 - JHE}
ELSE
SeqC Rapid doZCP2 EOL {Changed from ZCP2 - JHE}
END
END
SeqC EndSub EOL
CloseSub
{Element shift, not pattern}
RETURN

zonlyRep:
EachCycle
SetSRXYtoEP
IF NOT FirstCycle?
Connect
IF SPXMove? OR SPYMove?
SeqC doStartPos EOL {Changed from StrtPosC - JHE}
END
END
doSepSubZMoves {modified}
NextCycle
startSub
TrackZNO# FIRST SPZ#
toolPath
finishSub1 {okay}
SeqC EndSub EOL
CloseSub
IF FeedConnect? AND NOT AbsValue?
setSepSubZ {update TrackZNO - JHE}
END
RETURN

checkPass: {use the correct StrtPos}
IF AutoCycle?
SetPass2
ELSE
SetPass1
END
IF NOT Flag?('7')
ClearCSOffset
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?
{SeqC ZCP2C EOL} {Moved to firstOp3 newToolOp5 sameToolOp3 - JHE}
IF Repeats?
NewProg
IF ZshiftOnly?
IF AutoCycle? {incremental Autocycle sub can have Z moves}
zonlyRepAutoCycle
ELSE {Z shift only, NOT Auto Cycle}
SetFlag('1') { Milling ZShiftOnly SepSubs activated }
zonlyRep
SetFlagF('1') { Milling ZShiftOnly SepSubs deactivated }
END {end Auto Cycle IF}
ELSE {not Z only}
g92Sub
END {end Z only IF}
ELSE {no repeat OPs}
milling
END
IF AutoCycle?
SeqC CRCOffC doZCP3C EOL {Changed from ZCP3C - JHE}
setSRXYtoACEP
ELSE
IF FIFO?
SeqC CRCOffC FeedC doZCP3 FeedEntC EOL {Changed from ZCP3C - JHE}
ELSE
SeqC CRCOffC RapidC doZCP3 EOL {Changed from ZCP3C - JHE}
END
END
ELSE
IF Drilling?
{SeqC DrillCP EOL} {Moved to firstOp3 newToolOp5 sameToolOp3 - JHE}
GetCycle {Changed from StrtPos - JHE}
SeqC Cycle FromCP doStartPos doZDepth doRLevel Dwell Peck FeedEnt EOL
IF CallMasterOp?
SeqC SubCall CallLabB CallMasterNum# EOL
skipToLastFeat
ELSE
TrackZNO# FIRST SPZ#
IF MasterOp?
SetFlag('1') { DrillSubs activated }
NewMasterProg
SeqC SubCall CallLab EOL
startSub
toolPath
SeqC EndSub EOL
CloseSub
SetFlagF('1') { DrillSubs deactivated }
ELSE
toolPath
END
END
setDrillEndOpZ {update TrackZNO - JHE}
SeqC Rapid DrillOff doZCP3 EOL {Changed from ZCP3 - JHE}
END
END
RETURN

progStart:
InitProg
ReverseXZArcs
InitWFONum
SetFlood
SetMaxRPM('2500') {Changed from 10000 - JHE}
IF Metric?
SetMaxFeed('5400') {Changed from 12700 - JHE}
ELSE
SetMaxFeed('212.5') {Changed from 500 - JHE}
END
Save# Num#('1') Num#('0') { Status Register Variable for X Axis }
Save# Num#('2') Num#('0') { Status Register Variable for Y Axis }
Save# Num#('3') Num#('0') { Status Register Variable for Z Axis }
SetFlagF('1') { Milling ZShiftOnly SepSubs/DrillSubs deactivated }
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 }
SetFlagF('5') { Suppress Redundant WFO for MP-WFO-OTAP-ECP }
SetFlag('6') { TRUE = B-Style Output, FALSE = C-Style Output }
SetFlagF('7') { TRUE = D-Style Output }
SetFlagF('8') { TRUE = D-Style Output, FALSE = Local G52-WFO Coordinates }
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#('6')
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#('6') {****}
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

initOp:
EOR EOL
ProgID1
IF UseComments? AND ProgramNameComment?
' ( PROGRAM: ' ProgramName$ ' )'
END
EOL
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
OpenSub
restoreScale
RETURN

firstOp1:
IF ToolChangeAtHome?
SetHome
END
SetPalletIn('1') {Added - JHE}
SetTCZ('0') {Added - JHE}
doPostScript {Moved to here - JHE}
Seq Rapid Plane 'G20' CRCOff 'G49' DrillOff AbsOrInc EOL {Added codes - JHE}
attachHead {Added - JHE}
SeqC OpToolID EOL
SeqC ToolChng PreTool EOL {Added PreTool - JHE}
doOpComments
RETURN

firstOp2:
rotateHead {Added - JHE}
wFOStuff
g52Stuff
checkPass {Changed from StrtPos - JHE}
SeqC Rapid AbsOrInc doStartPos EOL {Removed cSAngleA cSAngleB - JHE}
SeqC Speed SpinOn EOL {Moved to here - JHE}
RETURN

firstOp3:
SeqC 'W' TCZ# EOL {Added this line - JHE}
SeqC doOfstOn CoolOn EOL {Changed OfstOn to doOfstOn - JHE}
SeqC newToolZCP2 EOL {Added this line - JHE}
RETURN

newToolOp1:
SeqC CoolOff EOL
SeqC RapidC 'G53' OfstOff 'W0.' EOL {Added some codes - JHE}
RETURN

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

newToolOp3: {Start new Operation}
SetTCZ('0') {Added - JHE}
doPostScript {Moved to here - JHE}
Seq Rapid CRCOff 'G49' DrillOff AbsOrInc EOL {Added codes - JHE}
attachHead {Added - JHE}
{SeqC OpToolID EOL} {Removed - JHE}
SeqC ToolChng PreTool EOL {Added PreTool - JHE}
doOpComments
RETURN

newToolOp4:
rotateHead {Added - JHE}
wFOStuff
g52Stuff
checkPass {Changed from StrtPos - JHE}
SeqC Rapid AbsOrInc doStartPos EOL {Removed cSAngleA cSAngleB - JHE}
SeqC Speed SpinOn EOL {Moved to here - JHE}
RETURN

newToolOp5:
SeqC 'W' TCZ# EOL {Added this line - JHE}
SeqC doOfstOn CoolOn EOL {Changed OfstOn to doOfstOn - JHE}
SeqC newToolZCP2 EOL {Added this line - JHE}
RETURN

sameToolOp1:
doEndOpPS
IF LAST ProgStop?
SeqC CoolOff EOL
SeqC RapidC 'G53' OfstOff EOL {Added some codes - JHE}
SeqC SpinOff EOL
SeqC 'M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
IF NewToolOffset? OR ChangeCS?
SeqC RapidC 'G53' OfstOff EOL {Added some codes - JHE}
END
END
RETURN

sameToolOp2: {Start new Operation}
doOpComments
doPostScript
checkPass
RETURN

sameToolOp3: {Start new Operation}
IF ChangeCS? {Added this check - JHE}
rotateHead {Added this line - JHE}
wFOStuff
END
g52Stuff
IF LAST ProgStop? {Changed from StrtPos - JHE}
SeqC Rapid AbsOrInc doStartPos EOL {Removed PlaneC cSAngleA cSAngleB - JHE}
SeqC Speed SpinOn EOL {Moved to here - JHE}
SeqC doOfstOn CoolOn EOL {Changed OfstOn to doOfstOn - JHE}
ELSE
SeqC Rapid AbsOrInc doStartPos SpeedC EOL {Changed from StrtPos - JHE}
IF NewToolOffset? OR ChangeCS?
SeqC doOfstOn EOL {Changed OfstOn to doOfstOn - JHE}
END
IF NOT CoolOff? AND LAST CoolOff?
SeqC CoolOn EOL
END
END
SeqC sameToolZCP2 EOL {Added this line - JHE}
RETURN

end1:
SeqC CoolOff EOL
SeqC RapidC 'G53' OfstOff 'W0.' EOL {Added some codes - JHE}
RETURN

end2:
doEndOpPS
IF FIRST ToolChangeAtHome?
SeqC FirstHome SpinOff EOL
ELSE
SeqC SpinOff EOL
END
IF ProgStop?
SeqC 'M0' EOL
ELSE
SeqC ProgStop EOL {Added this line - JHE}
END
RETURN

end3:
SeqC ToolChng EOL {Added this line - JHE}
SeqC 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
RETURN

mPallTools1P: {Multiple Parts, All Tools 1 Part}
EachOp {Start of post processing}
IF EquallySpacedOffsets?
SetFlag('2') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
IF FirstOperation?
openMP
firstOp1
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
newToolOp2 {to tool change, CS problem}
subCSMP
newToolOp3
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
subCSMP
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') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
END
IF FirstOperation?
firstOp1
openMP
firstOp2
firstOp3
ELSE
IF NewTool?
newToolOp1
closeMP
newToolOp2 {to tool change, CS problem}
newToolOp3
openMP
newToolOp4
newToolOp5
ELSE {implied SameTool?}
sameToolOp1
subCSMP
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') { Need to output wFOStuff twice for MP-ESO-OTAP-ECP, once for all others }
IF FirstOperation?
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
subCSMP
sameToolOp2
sameToolOp3
END
END {common point for all operations}
opGuts
NextOp {loops back to EachOP until last Operation}
closeMP
end1
end2
end3
RETURN

noMPs: {no multiple parts}
EachOp {Start of post processing}
{*** removed JHE
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 {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}
initOp

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


Wyszukiwarka

Podobne podstrony:
Fanuc 6M LM [AP] NCT45 16 1
Fanuc 6M LM [AP] BT45 16 1
Fanuc 6M LM [AP] CT45 16 1
Fanuc 6M LM [AP] NMT45 16 2
Fanuc 6M LM [AP] NBT45 16 1
Fanuc 15M MTS [CP] NDU66 16 2m
Fanuc 0M LH P&W [SP] CV84 16 3
Fanuc 18M MS [CST] NCT81 16
16 01 RYSUNEK TECHNICZNY W UJĘCIU KOMP
Fanuc 16M Makino [EE] NMT56 16
Fanuc 11M Toyoda [GS] MU04 89
Fanuc 11M Toyoda D434 15 1
Fanuc 11M Tyd [CGB] CT37 16 4
1601 plan zajec i rok?rma
Fanuc 11M Mat [AM] C820 16
Historia sztuki nowoczesnej polskiej malarstwo 16 01

więcej podobnych podstron