Black&Decker Router M699 81 4m


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

{9/22/94
Copied: Fanuc 6M M001.81.2m
Created: Black & Decker Router M699.81.2m
For: Bureau Graphics
Machine: Black & Decker ELU Router
Control:
Versions: ncCad 4.33/ncCAM 4.33/ncPost 4.33.03/Compost 4.21.22
Changes made per Charles Winston of Bureau Graphics.
Does not support multiple G-Code blocks.
Does not support ToolChng.
Customer indicated that they only program 1 Tool, but NewTool was left in anyway.
Does not support Tool Length or Diameter Offsets.
Does not support WorkFixtureOffsets.
Deleted G17, G18 and G19 commands from Form.
Set Use Absolute Arc Centers to TRUE in Compost Boolean Dialog.
Changed Preset from G92 to G52 in Compost Commands 1 Dialog.
Changed Call Sub from M98 to G37 in Compost Commands 3 Dialog.
Comments are output with single quote.
Added ASCII('39') at all places except for ToolComment$.
ToolTypeComment and ToolComment are only output at FirstOperation and NewTool.
Customer requested use of ToolComment for ' G32' SubCall of SetUp Routine.
Added Address Spaces.
Line Numbers are output without an Address.
Deleted all Seq and SeqC commands.
Added SetLineStrtChr('?'), SetLineStrtChr('') and Retag.
Added conditions to toggle between SetLineStrtChr('') and SetLineStrtChr('?').
Does not support output of any ZMoves.
Literal 'G28 Z' represents ZCP1 and is output at beginning of all Operations.
Literal 'G28 Z' also represents OfstOff and is output at proper times.
Literal ' Z-V10' represents ZIn and ZInPlusInc.
Literal ' ZV10' represents ZCP2, ZCP3 and ZCP2PlusInc.
Changed coordinate FORMATs to 2 place, non-decimal, leading zero suppression.
ArcI#, ArcJ# and ArcR# are also output without an address.
ArcR# is output in front of MoveXYC.
Changed FeedRate FORMATs to whole integer values with no addresses.
Using Variable(1) to store current value of FeedRate.
Using Variable(2) to convert FeedRate.
Added following subs
DoFeed sub outputs correctly scaled value stored.
Outputs integer 1 through 9 per linear relationship of FeedRate values 3 to 33.
DoFeedEnt stores FeedEntry# and calls DoFeed sub.
DoFeedRate stores FeedContour# and calls DoFeed sub.
DoArcFeed stores ArcFeed# and calls DoFeed sub.
DoDecelFeed stores DecelFeed# and calls DoFeed sub.
CkFeedEntC compares stored value to FeedEntry# and calls DoFeedEnt sub.
CkFeedRateC compares stored value to FeedContour# and calls DoFeedRate sub.
CkArcFeedC compares stored value to ArcFeed# for ConstantSurfaceFeed Operations.
ConstantSurfaceFeed Operations call DoArcFeed sub.
Non-ConstantSurfaceFeed Operations call CkFeedRateC sub.
Changed all M00 and ProgStop commands to literal ' G38 MOTOR OFF'.
Moved CRCOnC to FirstOperation, NewTool and SameTool.
Moved CRCOffC to NewTool, SameTool and end of Prog.
CutterRadiusCompensations is activated prior to EntryMove, and canceled after Tool Retracts.
Modified SubCall Routines for Repeat Operations.
' G36 V20' Repeats# stores Loop value into Control Variable.
' G34 V20' Subtracts one from stored value.
' G37 ' BlockNumber performs SubCall.
' G35 V20 ' BlockNumber sends control back to G34 V20 block until Loop is complete.
Using same method as L001 Tagging for calling appropriate block numbers.
Modified SubCall Routines for MultiplePart Operations.
Identicle to Repeat Operations except that Parts# is loop value stored instead of Repeats#.
Modified SubCall Routines for AutoCycles and SepSubs.
' G37 ' BlockNumber performs SubCall.
Added Segmented Arcs.
Customer requested Segmented Arcs whenever radius of Arc is GreaterThan OR Equal to 250mm, or,
Center of Arc lies outside table limits from X0.Y0. to X1200.Y1200.
Added ArcSegTest sub to test for valid ArcSegment condition.
Setting Flag(1) when ArcSegment condition exists.
NOTE: Customer requested that chord length of Segment be 1mm to 2mm long.
Added various SetArcSegmentAccuracy arguments based on radius of Arc to maintain 1.5mm chord
length.
Problem exists when radius is greater than 50mm.
Minimum value of SetArcSegmentAccuracy argument must be .005% of radius plus .00001.
Example: 100mm radius requires argument value of at least .00501, 250mm requires .01251, etc.
Added ArcSegReport sub to aid in troubleshooting.
Can be deleted when problem is solved either by correcting strange pattern of SetArcSegmentAccuracy
argument to radius ratio, or, new command is created allowing Segment to be controlled by length
of chord instead of chord height.
DWB}

{10/6/94
Modified: Black & Decker Router M699.81.2m
For: Bureau Graphics
Versions: ncCad 4.33/ncCAM 4.33/ncPost 4.33.03/Compost 4.21.22
Versions: Catalyst v2.05.54C/Compost 4.21.22
Changes made per Charles Winston of Bureau Graphics.
Modified handling of Segmented Arcs.
Deleted various SetArcSegmentAccuracy arguments at ArcSegTest sub.
Bill Gibbs instructed me to allow default value of .025 to control Arc Segmentation.
Bill instructed me to calculate Hypoteneous of move and suppress output until a move GTEqual to
Num#(1.0) mm is established.
Modified ArcSegReport.
Added output of additional calculations.
Added Hypoteneous sub.
Calculates Delta End Point value of current ArcSegmentFeature.
Added following variables to accomplish this:
Var(3) = Current Tool Position in X axis.
Var(4) = Current Tool Position in Y axis.
Var(5) = Current Delta X Position.
Var(6) = Current Delta Y Position.
Var(7) = Current Hypoteneous value.
Added ChordLength sub.
Outputs valid ArcSegment move GTEqual to Num#(1.0) mm.
DWB}

{11/9/94
Modified: Black & Decker Router M699.81.3m
For: Bureau Graphics
Versions: ncCad 4.33/ncCAM 4.33/ncPost 4.33.03/Compost 4.21.23
Versions: Catalyst v2.14.06C/Compost 4.21.23
Changes made per EMail from Charles Winston of Bureau Graphics.
Changed all '#####^#0' FORMATs to '#####.#0;0' in Compost Default Formats Dialog.
Addresses affected by this were A, B, C, I, J, K, R, Q, X, Y and Z.
Changed all '##0' FORMATs to '###.#0;0' in Compost Default Formats Dialog.
Addresses affected by this were F.
Changed FORMAT#4 from '####^#0' to '####.#0;0' at Prog Numeric Format Definitions.
Changed FORMAT#6 from '###0' to '##0.##;0' at Prog Numeric Format Definitions.
Commented out MoveType$ of ProgramComments at FirstOperation.
Commented out FileBytesComment, FileFeetComment and FileMetersComment at end of Prog.
DWB}

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

#1 = '#.00'
#2 = '###^#0'
#3 = '*###^#0'
#4 = '####.#0;0'
#5 = '#######0'
#6 = '##0.##;0'
#20 = '#bb.000000'
#21 = '#bb0'
#22 = '#bbbb.b0'

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(ArcI#,4)
FORMAT(ArcJ#,4)
FORMAT(ArcR#,4)
FORMAT(ToolDiameter#,4) {.72}
FORMAT(Repeats#,5)
FORMAT(Program#,5) {.72}
FORMAT(Operation#,5) {.72}
FORMAT(Tool#,5) {.72}
FORMAT(NewWFO#,5) {.72}
FORMAT(Parts#,5) {.72}
FORMAT(Num#,6)
FORMAT(Recall#,6)
FORMAT(MUL#,6)
FORMAT(Dwell#,6) {.72}
FORMAT(FeedEntry#,6)
FORMAT(FeedContour#,6)
FORMAT(DecelFeed#,6)
FORMAT(ArcFeed#,6)
FORMAT(ADD#,20)
FORMAT(SUB#,20)
FORMAT(SQRT#,20)
FORMAT(SPX#,20)
FORMAT(SPY#,20)
FORMAT(EPX#,20)
FORMAT(EPY#,20)
FORMAT(ArcSegAcc#,20)
FORMAT(LineLength#,20)
FORMAT(ArcSeg#,21)

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

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

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

DoOpComments:
IF UseComments?
SetScale('1')
SetLineStrtChr('')
ASCII('39') '-------------' EOL
IF OperationIDComment?
ASCII('39') 'OPERATION ' Operation# ': ' OperationType$ EOL
END
IF OperationComment?
ASCII('39') OperationComment$ EOL
END
IF WorkGroupComment?
ASCII('39') WorkGroupComment$ EOL
END
IF FirstOperation? OR NewTool?
IF ToolTypeComment?
ASCII('39') 'TOOL ' Tool# ': ' ToolDiameter# ' ' ToolType$ EOL
END
IF ToolComment?
'? G32 ' ToolComment$ EOL { Calls SetUp Routine }
END
ELSE
IF LAST ProgStop?
IF ToolComment?
'? G32 ' ToolComment$ EOL { Calls SetUp Routine }
END
END
END
RestoreScale
SetLineStrtChr('?')
END
RETURN

PSInit: {reset flags}
RotateF
RETURN

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

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

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

DoFeed:
Save# Num#('2') MUL# Recall# Num#('1') NumSc#('1')
' '
IF LTEqual? Recall# Num#('2') Num#('6')
Num#('1')
ELSE
IF LTEqual? Recall# Num#('2') Num#('9')
Num#('2')
ELSE
IF LTEqual? Recall# Num#('2') Num#('13')
Num#('3')
ELSE
IF LTEqual? Recall# Num#('2') Num#('16')
Num#('4')
ELSE
IF LTEqual? Recall# Num#('2') Num#('19')
Num#('5')
ELSE
IF LTEqual? Recall# Num#('2') Num#('23')
Num#('6')
ELSE
IF LTEqual? Recall# Num#('2') Num#('26')
Num#('7')
ELSE
IF LTEqual? Recall# Num#('2') Num#('29')
Num#('8')
ELSE
Num#('9')
END
END
END
END
END
END
END
END
RETURN

DoFeedEnt:
Save# Num#('1') FeedEntry#
DoFeed
RETURN

DoFeedRate:
Save# Num#('1') FeedContour#
DoFeed
RETURN

DoArcFeed:
Save# Num#('1') ArcFeed#
DoFeed
RETURN

DoDecelFeed:
Save# Num#('1') DecelFeed#
DoFeed
RETURN

CkFeedEntC:
IF NotEqual? FeedEntry# Recall# Num#('1')
DoFeedEnt
END
RETURN

CkFeedRateC:
IF NotEqual? FeedContour# Recall# Num#('1')
DoFeedRate
END
RETURN

CkArcFeedC:
IF ConstantSurfaceFeed?
IF NotEqual? ArcFeed# Recall# Num#('1')
DoArcFeed
END
ELSE
CkFeedRateC
END
RETURN

EntryMove:
IF FeedEntry?
Feed ' Z-V10' DoFeedEnt EOL { ZIn }
ELSE
Rapid ' Z-V10' EOL { ZIn }
END
RETURN

StartSub:
OpenSub
SetLineStrtChr('')
' ' EOL
ASCII('39') '-------------' EOL
SetLineStrtChr('?')
' ' DoSubComment EOL
SetLineStrtChr('')
'<' Program# EOL { SubID }
SetLineStrtChr('?')
RETURN

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

StdSub:
' G36 V20 ' Repeats# EOL { Store value to variable 20 }
SetLineStrtChr('')
'>' Program# EOL
SetLineStrtChr('?')
' G34 V20' EOL { Decrement the value of variable 20 by 1 }
' G37 ²' Program# EOL { SubCall }
' G35 V20 Å‚' Program# EOL { If value of variable does not equal 0, then loop back }
StartSub
RETURN

FinishSub1: {part 1}
IF NOT FeedConnect?
IF AutoCycle?
' ZV10' EOL { ZCP3C }
ELSE
IF FIFO? {.81}
FeedC ' ZV10' CkFeedEntC EOL { ZCP3C }
ELSE
RapidC ' ZV10' EOL { ZCP3C }
END
END
END
RETURN

FinishSubG92: {part 2}
Preset ShiftRC EOL
CloseSub
Preset UnshftRC EOL
RETURN

OpenMP:
IF NOT WorkFixtureOffsets?
NewProg
' G36 V20 ' Parts# EOL { Store value to variable 20 }
SetLineStrtChr('')
'>' Program# EOL
SetLineStrtChr('?')
' G34 V20' EOL { Decrement the value of variable 20 by 1 }
' G37 ²' Program# EOL { SubCall }
' G35 V20 Å‚' Program# EOL { If value of variable does not equal 0, then loop back }
StartSub
END
RETURN

CloseMP:
IF NOT WorkFixtureOffsets?
Preset ShiftPC EOL
CloseSub
Preset UnshftPC EOL
END
RETURN

ArcSegTest:
SetStatusOff
SetFlagF('1')
IF GTEqual? ABS# ArcR# Num#('250')
SetFlag('1')
ELSE
IF LessThan? ArcI# Num#('0')
SetFlag('1')
ELSE
IF LessThan? ArcJ# Num#('0')
SetFlag('1')
ELSE
IF GTEqual? ArcI# Num#('1200')
SetFlag('1')
ELSE
IF GTEqual? ArcJ# Num#('1200')
SetFlag('1')
END
END
END
END
END
SetStatusOn
RETURN

Hypoteneous:
Save# Num#('5') SUB# Recall# Num#('3') EPX# { Delta X }
Save# Num#('6') SUB# Recall# Num#('4') EPY# { Delta Y }
Save# Num#('7')
SQRT# ADD#
MUL# Recall# Num#('5') Recall# Num#('5') { X Squared }
MUL# Recall# Num#('6') Recall# Num#('6') { Y Squared }
RETURN

ArcSegReport:
SetLineStrtChr('')
FORMAT(Recall#,20)
FORMAT(MUL#,20)
FORMAT(ArcR#,22)
Save# Num#('3') SPX#
Save# Num#('4') SPY#
' ' EOL
' ArcR# ArcSegAcc# LineLength# ArcSeg#' EOL
EACHArcSegment
IF LastSeg?
' ' ArcR# ' ' ArcSegAcc# ' ' LineLength# ' ' ArcSeg# EOL
END
NEXTArcSegment
' ' EOL
SetLineStrtChr('?')
' ' EOL
'ArcSeg SPX EPX Delta X X Squared SPY EPY Delta Y Y Squared Hypoteneous' EOL
EACHArcSegment
SetStatusOff
Hypoteneous
IF GTEqual? Recall# Num#('7') NumSc#('1') { Minimum Chord Length }
SetStatusOn
Feed MoveXY CkFeedRateC EOL
Save# Num#('3') EPX#
Save# Num#('4') EPY#
ELSE
ArcSeg# ' '
Recall# Num#('3') ' ' { SPX }
EPX# ' '
Recall# Num#('5') ' ' { Delta X }
MUL# Recall# Num#('5') Recall# Num#('5') ' ' { X Squared }
Recall# Num#('4') ' ' { SPY }
EPY# ' '
Recall# Num#('6') ' ' { Delta Y }
MUL# Recall# Num#('6') Recall# Num#('6') ' ' { Y Squared }
Recall# Num#('7') { Chord Length }
IF LastSeg?
' ( Last Segment Chord Length )'
END
EOL
END
NEXTArcSegment
SetStatusOn
FORMAT(Recall#,6)
FORMAT(MUL#,6)
FORMAT(ArcR#,4)
SetLineStrtChr('?')
RETURN

ChordLength:
FORMAT(Recall#,20)
FORMAT(MUL#,20)
Save# Num#('3') SPX#
Save# Num#('4') SPY#
EACHArcSegment
SetStatusOff
Hypoteneous
IF GTEqual? Recall# Num#('7') NumSc#('1') { Minimum Chord Length }
SetStatusOn
Feed MoveXY CkFeedRateC EOL
Save# Num#('3') EPX#
Save# Num#('4') EPY#
END
NEXTArcSegment
SetStatusOn
FORMAT(Recall#,6)
FORMAT(MUL#,6)
RETURN

FormatArc:
IF ArcCW?
CWArc
ELSE
CCWArc
END
IF ArcIJFormat?
MoveXY ' ' ArcI# ' ' ArcJ#
ELSE
' ' ArcR# MoveXY
END
RETURN

StdLine: {enables CRC on first call, .70}
IF Decelerate?
IF RoomToDecel?
DecelMove1
Feed MoveXYC CkFeedRateC EOL
DecelMove2
END
Feed MoveXYC DoDecelFeed EOL
ELSE
IF XMove? OR YMove? OR ZMove?
Feed MoveXYC CkFeedRateC EOL
END
END
RETURN

ToolPath:
ResetCRCNum {.72}
EACHFeat
IF PointFeat?
IF AutoCycle?
MoveSXYC EOL
' G37 ²' Program# EOL { SubCall }
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
ELSE
MoveSXYC EOL {.80.01}
END
ELSE
IF RapidFeat?
IF AutoCycle?
Rapid MoveXYC EOL
ELSE
IF XMove? OR YMove? OR ZMove?
Rapid MoveXYC EOL
END
END
ELSE
IF LineFeat?
IF AutoCycle? {.70}
IF LastFeat?
Feed MoveXYC CkFeedRateC EOL
ELSE
IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps}
Feed MoveXYC CkFeedRateC EOL
ELSE
StdLine {enables CRC on first call}
END
END
ELSE
StdLine
END
ELSE
IF ArcFeat?
ArcSegTest
IF Flag?('1') { Need to Segment ArcFeat }
SetFlagF('1')
{ArcSegReport}
ChordLength
ELSE
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
IF LastQuadrant? AND Decelerate?
IF RoomToDecel?
DecelMove1
FormatArc CkArcFeedC EOL
DecelMove2
END
FormatArc DoDecelFeed EOL
ELSE
FormatArc CkArcFeedC EOL
END
NEXTQuadrant
END
END
END
END
END
NEXTFeat
RETURN

WFOStuff:
{ Does not support WorkFixtureOffsets }
RETURN

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

AutoCycCutSub2: {part 2}
ToolPath
AbsOrInc EOL
IF Repeats? AND FeedConnect? AND ZshiftOnly?
{.69 removed RapidC} {.71.2 removed CRCOffC, gets turned off in ToolPath}
ELSE
IF FIFO? {.81}
FeedC ' ZV10' FeedEntC EOL { ZCP2C }
ELSE
RapidC ' ZV10' EOL { ZCP2C }
END
END
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
AbsOrInc EOL
Connect StrtPos EOL
Milling
FinishSub1
FinishSubG92
RETURN

ZonlyRepAutoCycle:
AutoCycPat {write pattern moves and main calls}
StartSub
NewProg
EachCycle
IF FeedConnect?
Feed ' Z-V10' DoFeedEnt EOL { ZInPlusInc }
ELSE
IF FeedEntry?
IF NOT FirstCycle?
Rapid ' ZV10' EOL {.69 added Rapid, reads better} { ZCP2PlusInc }
{can't call for cycle = 1, .69 changed to ZCP2PlusInc}
END
Feed ' Z-V10' DoFeedEnt EOL { ZInPlusInc }
ELSE
Rapid ' Z-V10' EOL {.69 added Rapid, reads better} { ZInPlusInc }
END
END
IF FirstCycle?
SetStatusOff {protect Z position for incremental sub}
END
' G37 ²' Program# EOL { SubCall }
NextCycle
SetStatusOn
AutoCycCutSub1 {build element sub}
AutoCycCutSub2
{.69, removed FinishSub1}
IF FeedConnect? {there is no Z up in the sub, .69}
IF FIFO? {.81}
Feed ' ZV10' DoFeedEnt EOL {.69} { ZCP2C }
ELSE
Rapid ' ZV10' EOL {.69} { ZCP2C }
END
END {.69}
CloseSub
{Element shift, not pattern}
RETURN

ZonlyRep:
EachCycle
IF NOT FirstCycle?
Connect StrtPos EOL {.71.2, added Connect}
END
IF FeedConnect?
FeedC ' Z-V10' DoFeedEnt EOL {.71.2, changed to FeedC} { ZInPlusInc }
ELSE {Entry/Exit Connect}
IF FeedEntry?
IF NOT FirstCycle?
RapidC ' ZV10' EOL { ZCP2PlusInc }
{can't call for cycle =1} {.69 added Rapid, reads better} {.71.2, changed to RapidC, reads better}
END
Feed ' Z-V10' DoFeedEnt EOL { ZInPlusInc }
ELSE
RapidC ' Z-V10' EOL { ZInPlusInc }
{.69 added Rapid, reads better} {.71.2, changed to RapidC, reads better}
END
END
' G37 ²' Program# EOL { SubCall }
NextCycle
StartSub
ToolPath
FinishSub1
CloseSub
RETURN

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

GetStartOfSameTool:
DoOpComments
DoPostScript
CheckPass
RETURN

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

{setup and initializations}
InitProg
SkipZ
ReverseXZArcs
InitWFONum
SetFlood
UseSeparateSubCalls
SetMaxSeparateSubCalls('50')
SetMaxRPM('10000')
SetMaxFeed('500')
SetFlagF('1') { ArcSegTest }
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
END
EachOp {Start of post processing *********************}
IF FirstOperation?
IF ToolChangeAtHome?
SetHome
END
IF UseComments?
IF ProgramNameComment?
' ' ASCII('39') 'PROGRAM: ' ProgramName$
END
IF ProgramComment?
ASCII('39') ProgramComment$ EOL
END
IF FormatNameComment?
ASCII('39') 'FORMAT: ' FormatName$ EOL
END
IF TimeComment?
ASCII('39') Date$ ' AT ' Time$ EOL
END
IF MovesComment?
{ASCII('39') 'OUTPUT IN ' MoveType$ ' METERS' EOL}
END
IF PartsComment?
ASCII('39') 'PARTS PROGRAMMED: ' Parts# EOL
END
IF StartToolComment?
ASCII('39') 'FIRST TOOL NOT IN SPINDLE' EOL
END
END
SetLineStrtChr('?')
OpenSub
RestoreScale
IF MultipleParts? AND AllToolsOnePart?
OpenMP
END
DoOpComments
DoPostScript
Plane { No Output }
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
' G28 Z' EOL { ZCP1 }
AbsOrInc EOL
CRCOnC EOL
Rapid StrtPos EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
StrtPos EOL
END
ELSE
IF NewTool?

{Finish off last Operation}

IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CloseMP
END
CRCOffC EOL
' G28 Z' EOL { OfstOff }
IF MultipleParts? AND OneToolAllParts? AND FullUp?
CloseMP
END
DoEndOpPS
Rapid ' X0 Y0' EOL
Rapid ' Z0' EOL
' G38 MOTOR OFF' EOL { ProgStop }

{Start new Operation}

SetLineStrtChr('')
' ' EOL
DoOpComments
DoPostScript
Plane { No Output }
SetLineStrtChr('?')
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
' G28 Z' EOL { ZCP1 }
CRCOnC EOL
Rapid StrtPos EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
StrtPos EOL
END
ELSE
IF SameTool?
CRCOffC EOL
DoEndOpPS

IF LAST ProgStop?
' G28 Z' EOL { OfstOff }
Rapid ' X0 Y0' EOL
Rapid ' Z0' EOL
' G38 MOTOR OFF' EOL { ProgStop }
ELSE
IF NewToolOffset?
' G28 Z' EOL { OfstOff }
END
END

{Start new Operation}

SetLineStrtChr('')
' ' EOL
SetLineStrtChr('?')
GetStartOfSameTool
Plane { No Output }
' G28 Z' EOL { ZCP1 }
CRCOnC EOL
Rapid StrtPos EOL
END
END
END {common point for all operations}
IF Milling?
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?
FindAnyZMoves {for normal abs subroutine}
IF NoZMoves?
ZonlyRep
ELSE
G92Sub {pattern shift, not element}
END
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
ELSE
IF Drilling?
IF Repeats?
NewProg
StdSub
AbsOrInc EOL
Rapid StrtPos EOL
END
DrillCP EOL
GetCycle
Cycle FromCP StrtPos ZDepth RLevel Dwell Peck Retract FeedEnt EOL
TrackZNO# FIRST SPZ# {.81.2}
ToolPath
IF RetractToCP1? {.81}
TrackZNO# ClearancePlane1#
ELSE
TrackZNO# ClearancePlane2#
END
' G80' EOL
IF Repeats?
FinishSubG92
END
RapidC ZCP3C EOL
END
END
NextOp {loops back to EachOP until last Operation}

{End of program ************************************************************}

{finish last operation}
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CloseMP
END
IF MultipleParts? AND OneToolAllParts? AND FullUp?
CloseMP
END
CRCOffC EOL
DoEndOpPS
' G28 Z' EOL { ZCP1 }
Rapid ' X0 Y0' EOL
Rapid ' Z0' EOL
IF MultipleParts? AND AllToolsOnePart?
CloseMP
END
' G38 MOTOR OFF' EOL
CloseSub
Post2 {organize Subs into one program}
Close
SetLineStrtChr('')
Retag
{IF UseComments?
SetScale('1') {restore scale for comments}
Reopen
IF FileBytesComment?
ASCII('39') 'FILE LENGTH: ' FileBytes# ' CHARACTERS' EOL
END
IF FileFeetComment?
ASCII('39') 'FILE LENGTH: ' FileFeet# ' FEET' EOL
END
IF FileMetersComment?
ASCII('39') 'FILE LENGTH: ' FileMeters# ' METERS' EOL
END
Close
END}


Wyszukiwarka