Fanuc 16M [NM] M834 89 5m


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

{4/11/89
Copied & modified; Fanuc 0M Leadwell M075.55, for Triple T.
Add 'X0' to machine home move at end of program.
Add 'Home' for 1st tool change.
Delete ' G0 G91 G28 G49 X2. Y-2. Z-2.'
Add 'G49' to 1st line of program.
Jim Radcliffe}

{7/24/90, Added InitProg globally to posts with this remark, DWB}
{2/22/94, Updated Fanuc 0M Leadwell (TT) M188.56 to .81.2 format, JR}

{2/16/95
Copied & modified: Fanuc 0M Leadwell (TT) M188.81
For: Murtaugh Represents / Aero Precision
Control: Fanuc 16M
Added to saftey start block.
Moved WFOStuff call to StrtPos line.
Removed spaces between codes.
Spindle and StrtPos on same line.
OfstOn and CoolOn on same line. Block delete CoolOn.
String ZCP3 move at end of operation to CoolOff command.
Changed MachSpec format L from 0000 to ###0 to change 'M98P00010001' to 'M98P10001'.
Changed MachSpec CRC label from an H to a D.
Jim Radcliffe}

{3/16/95, Modified Fanuc 16M M00B.81.2 Rigid Tapping, JR}

{
Format: Fanuc 16M [NM] 834.81.4
8/7/95
Added support for W & Z axis cuts. Use OptCyc1 to toggle between Z for cutting and W for cutting
TH}

{
Format: Fanuc 16M [NM] 834.81.5m
9/1/95
Converted to metric
Replaced: IncValue 'G28Y0Z0' SpinOff with: G53G49D0H0Z0
Moved MyWCP2 to appear before OfstOn
Moved MyWCP3C to appear after G53G49D0H0Z0
TH}

{10/2/95
Modified: Fanuc 16M [NM] 834.81.5m
For: National Machinery
Versions: ncCad 4.33.01/ncCAM 4.33.01/ncPost 4.33.06/Catalyst v2.22/Compost 4.21.32/1.0a
Changes made per Jeff Casto and Bob Hess, with blessing from Tom Hubina.
Machine supports standard XYZ axes with additional W Table axis.
Processor outputs all ClearancePlane moves as W with ToolLength# ADDed to ClearancePlane#.
ToolPath for all operations output as Z axis unless user enters OptionalCycle1 command in Utility
Data Field, in which case, Z value is changed to W address with ToolLength# ADDed to ZPos#.
Canned Drilling Cycles are the norm unless user enters OptionalCycle1 command in Utility Data
Field, in which case, post will output longhand drilling code.
DWB}

{10/3/95
Format: Fanuc 16M [NM] M834.85m
For: National Machinery
Upgraded to .85 version to support expanded SepSubs and DrillSubs.
Added CallMasterNum# to FORMAT#7 at Prog Numeric Format Definitions.
Added MasterOpF at PSInit.
Added CallMasterOpF at PSInit.
Added DoAbsOrInc sub.
Added call to DoAbsOrInc sub at FormatArc sub.
Added call to DoAbsOrInc sub at StdLine sub three places.
Added call to DoAbsOrInc sub at ToolPath LineFeat.
Added DoDrillAbsOrInc sub.
Added call to DoDrillAbsOrInc sub at ToolPath PointFeat.
Added RestoreAbsOrInc sub.
Added call to RestoreAbsOrInc sub at end of ToolPath.
Changed SkipZ command to TrackZNO# FIRST SPZ# at ZonlyRep sub.
Deleted UnSkipZ command at ZonlyRep sub.
Added SkipToLastFeat sub.
Added SetDrillEndOpZ sub.
Added support of CallMasterOp at IF Drilling.
Added FIRST modifier to TrackZNO# SPZ# at IF Drilling.
Added support of MasterOp at IF Drilling.
Moved SeqC command from inside MP-OTAP-ECP condition to CoolOff block at end of Prog.
TH}

{11/3/95
Format: Fanuc 16M [NM] M834.85.1m
For: National Machinery
Changes made per Jeff Casto.
Added Retract# to FORMAT#4 at Prog Numeric Format Definitions.
Added ZDepth# to FORMAT#4 at Prog Numeric Format Definitions.
Added ClearancePlane2# to FORMAT#4 at Prog Numeric Format Definitions.
Added Dwell# to FORMAT#4 at Prog Numeric Format Definitions.
Added FeedEntry# to FORMAT#4 at Prog Numeric Format Definitions.
Added Recall# to FORMAT#4 at Prog Numeric Format Definitions.
Added CalcZSurf# to FORMAT#4 at Prog Numeric Format Definitions.
Added parenthesis to OptCyc1 report at DoPostScript.
Corrected ZW switching errors for Non-Canned Drilling Operations.
Deleted call to WCP2C sub for OptCyc1 RigidTap at ToolPath PointFeat.
Modified Drilling output at ToolPath PointFeat.
Added ELSE condition for IF Peck Boolean.
Moved FeedC MoveSWC FeedEntC block into ELSE condtion.
MoveSWC handles output of Depth Move.
Added condition to NOT Retract Tool for LastFeat.
This is handled at IF Drilling.
Changed literal METERS to MILIMETERS at FirstOperation.
Added literal 'M71' to WCP1 block at FirstOperation, NewTool and ProgStop condition at SameTool.
Added literal 'M70' just prior to ProgStop block for ProgStop condtion at NewTool.
Deleted WCP1 block following StrtPos block at third SameTool condition.
Modified IF Drilling.
Deleted WCP1C and WCP2C blocks for non-Canned Operations.
Added support for FIStopOffWallRO AND BackBore Operations at IF Drilling.
These Operations become an option when using 3AHMZW.mch MDD.
Added following formula for BackBore Operations to calculate Q Parameter.
ABS (((ShankDiameter + (ToolDiameter Ö 2) - (ShankDiameter Ö 2)) Ö 2) - (ShankDiameter Ö 2))
Basically, the formula works like this:
Dividing ToolDiameter and ShankDiameter in half results in ToolRadius and ShankRadius.
Subtracting ShankRadius from ToolRadius results in the distance from the ToolEdge to the
ShankEdge.
Adding the ShankDiameter to this results in the distance from the ToolEdge to the opposite side
of the ShankEdge.
Dividing this result in half and then subtracting the ShankRadius results in the distance
halfway between the ToolEdge to the ShankEdge.
DWB NOTE: I believe the same result could have been accomplished by subtracting the
ShankDiameter from the ToolDiameter and dividing that value by 4.
i.e., (ToolDiameter - ShankDiameter) Ö 4.
Added WCP3C block at end of IF Drilling.
TH}

{11/14/95
Format: Fanuc 16M [NM] M834.85.2m
For: National Machinery
Changed TrackZ# to TrackZNO# for FORMATting at Prog Numeric Format Definitions.
Changed all colons in comments to dashes.
Added condition to output ZCP3C instead of WCP3C for non-Canned Drilling Operations at end of
IF Drilling.
Added literal 'G53G49D0H0Z0M5' at end of prog.
Added literal 'M70' at end of prog.
TH}

{1/16/95
Format: Fanuc 16M [NM] M834.85.3m
For: National Machinery
Added missing END to 11/14/95 ZCP3C condition at end of IF Drilling.
TH}

{2/22/96
Format: Fanuc 16M [NM] M834.86m
For: National Machinery
Changed R-Format Maximum Arc Angle from 0.000 to 359.999 in Compost2 Arc Dialog.
Updated for Catalyst v3.05C per Fanuc 6M M001.86 Format
Modified ZonlyRepAutoCycle for SetSRXYtoEP code.
Changed FORMAT#6 from ####^##0 to ####^### at Prog Numeric Format Definitions.
Deleted second FORMAT of DWELL# at Prog Numeric Format Definitions.
Decreased SetMaxRPM from 10000 to 1000 at setup and initializations.
Increased SetMaxFeed from 500 to 2540 at setup and initializations.
Commented out call to GetLastWCP3C sub at NewTool.
Changed WCP2C to ZCP2C at start of IF Milling.
Added condition to support expanded SepSubs at IF Milling.
Commented out IF ELSE END condition for MultipleParts OneToolAllParts FullUp at end of Prog.
TH}

{3/13/96
Format: Fanuc 16M [NM] M834.86.1m
For: National Machinery
Deleted END with no matching IF statement at MoveDC sub.
Changed WCP3C to ZCP3C at FinishSub1 sub three places.
Changed WCP2 to ZCP2 at AutoCycCutSub2 sub two places.
Changed WCP2 to ZCP2 at ZonlyRepAutoCycle sub two places.
Changed WInPlusInc to ZInPlusInc at ZonlyRep sub three places.
Changed WCP2PlusIncC to ZCP2PlusIncC at ZonlyRep sub one place.
Commented out call to GetLastWCP3C sub at SameTool three places.
Added literal 'M71' to WCP1 block at NewToolOffset condition at SameTool.
TH}

{3/13/96
Format: Fanuc 16M [NM] M834.86.2m
For: National Machinery
Added 4.2 CkCRC sub.
Deleted ResetCRCNum at ToolPath.
Command now part of CkCRC sub.
Added call to DoAbsOrInc sub two places at ToolPath RapidFeat.
Added call to DoAbsOrInc sub one place at ToolPath LineFeat.
TH}

{3/25/96, Tested ZOnlyRepAutoCycle, Changed version # to .89, MPK}

{4/16/96
Format: Fanuc 16M [NM] M834.89.1m
For: National Machinery
Changed R-Format Maximum Arc Angle from 359.999 to 359.000 in Compost2 Arc Dialog.
TH}

{8/8/96
Format: Fanuc 16M [NM] M834.89.2m
For: National Machinery
Changed FORMAT#4 from #####.###;0. to ####.####;0. at Prog Numeric Format Definitions.
Increased SetMaxSeparateSubCalls from 50 to 200 at setup and initializations.
Changed MILIMETERS to MM at FirstOperation MovesComment.
JM}

{8/30/96
Modified: Fanuc 16M [NM] M834.89.2m
Created: Fanuc 16M [NM] M834.89.3m
For: National Machinery
Machine:
Control:
Versions: Catalyst v3.05.03C/Compost 4.21.37/v1.0b1
Changes made per Ken Hoffman of National Machinery
Updated for Catalyst v3.05C per Fanuc 6M M001.89 Format.
Modified ckCRC sub.
Added FormatLine and ckCRCNum subs.
Modified ToolPath to suit.
Changed FORMAT#4 from ####.####;0. back to #####.###;0. at Prog Numeric Format Definitions.
Added ABS# to FORMAT#4 at Prog Numeric Format Definitions.
Added DIV# to FORMAT#4 at Prog Numeric Format Definitions.
Added ShankDiam# to FORMAT#4 at Prog Numeric Format Definitions.
Added Parts# to FORMAT#5 at Prog Numeric Format Definitions.
Deleted ZDepth# from FORMAT#4 at Prog Numeric Format Definitions.
Customer reported that Tool did not retract to ZCP3 prior to SameTool StrtPos.
This caused Tool to crash.
Rewrote LastWCP3 and LastWCP3C subs.
Deleted GetLastWCP3C sub.
Was not being called anyway.
Added LastZCP3C sub.
Only called at SameTool IF NOT ProgStop? AND NOT NewToolOffset.
Tests for OptCyc1 condition.
IF TRUE, calls LastWCP3C sub else does normal stuff.
Deleted WCP2PlusInc, WCP2PlusIncC and WInPlusInc subs.
Never called.
Modified DoPeck sub.
Modified ToolPath Drilling routines in general.
Problem with SPZ due to Tracking ClearancePlane which should never be done inside ToolPath.
Other miscellaneous clean up required.
Uncommented IF ELSE END condition for MultipleParts OneToolAllParts FullUp at end of Prog.
See 2/22/96.
This should never have happened as CloseSub command was not be acted on at end of output,
resulting in File Alert Messages and bogus output.
Deleted the rest of the code that was contained therein.
Customer reported that W-Axis values were incorrect.
Changed ADD# Z-AxisValues# ToolLength# to SUB# Z-AxisValues# ToolLength#.
DWB}

{11/22/96
Modified: Fanuc 16M [NM] M834.89.3m
Created: Fanuc 16M [NM] M834.89.4m
For: National Machinery
Versions: Catalyst v3.20C/Compost 4.21.37/v1.0b1
Changes made per Ken Hoffman of National Machinery
Normal Operations without OptCyc1 now outputs all Z values.
M71Block outputs WCP1 and E1 macro call.
W Address only output on M71 block.
OptCyc1 Operations output all W values without any ToolLength# adjustment.
M71Block outputs WCP1 and E2 macro call.
Z Address only output on OfstOn and G53 blocks.
Rewrote and cleaned up ZtoW change subs.
Changed all 'W' Sub# ZAxisValue# ToolLength# to 'W' ZAxisValue#.
ZAxisValue# refers to all Z Number Commands throughout Prog.
Added support of ToolChangeZ() PostScript Command.
Allows user to overide value of ZCP1.
Deleted Q Parameter Formula for Canned Drilling BackBore at IF Drilling.
Replaced it with literal 'Q.05'.
Updated for Catalyst v3.20C per Fanuc 6M M001.89a Format.
Added M001.14 source.
Changed FORMAT#2 from ###.###;0. to #####.###;0. at Prog Numeric Format Definitions.
Changed FORMAT#3 from *###.###;0. to *#####.###;0. at Prog Numeric Format Definitions.
Deleted version comments.
Deleted Flag(2) for CRCOffsetC at ckCRC and ckCRCNum subs and at setup and initializations.
Added NOT LastFeat? AND Equal? SPZ# EPZ# condition at ckCRCNum sub.
Moved contents of FormatLine back to ToolPath LineFeat.
Modified WorkFixtureOffset logic.
Added Flag(2) for WFOStuff at setup and initializations.
Added SetFlag(2) for EquallySpacedOffsets at OpenMP sub.
Added WFONum sub.
Rewrote logic at WFOStuff sub.
Added EOL to NewWFO MP WFOStuff sub Warning.
Deleted SeqC and EOL at WFOStuff sub.
Added Flag(2) logic at start of EachOp/NextOp Loop.
Moved WFOStuff after MP-OTAP-FU condition at FirstOperation and NewTool.
Added WFOStuff for MP-OTAP-ECP condition at FirstOperation and NewTool.
Added AbsOrInc Rapid to StrtPos block for MP-OTAP-ECP condition at FirstOperation and NewTool.
Added SeqC and EOL at WFOStuff calls at GetStartOfSameTool, FirstOperation and NewTool.
Added SetMaxFeed(100) for English VNC files.
Moved Speed SpinOn after MP-OTAP-FU condition at FirstOperation and NewTool.
Added Speed SpinOn for MP-OTAP-ECP condition at FirstOperation and NewTool.
DWB}

{08/11/98,
Initial: Fanuc 16M [NM] M834.89.4m
Created: Fanuc 16M [NM] M834.89.5m
For: National Machinery

NOTE: This Post now allows CRC calls on Rapid or Line Features with a
Z component. The customers' control allows this.

Changes to Prog:
1) ckCRC - Deleted logic prohibiting CRC on a Z move.
2) ckCRCNum - Deleted logic prohibiting CRC on a Z move.
CDH}

{Prog Numeric Format Definitions ****}

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(Recall#,4)
FORMAT(ADD#,4)
FORMAT(TCZ#,4)
FORMAT(ClearancePlane1#,4)
FORMAT(ClearancePlane2#,4)
FORMAT(ClearancePlane3#,4)
FORMAT(ZInPlusInc#,4)
FORMAT(ZCP2PlusInc#,4)
FORMAT(SPX#,4)
FORMAT(SPY#,4)
FORMAT(SPZ#,4)
FORMAT(EPZ#,4)
FORMAT(OriginShiftRX#,4)
FORMAT(OriginShiftRY#,4)
FORMAT(OriginShiftRZ#,4)
FORMAT(OriginUSRXCTP#,4)
FORMAT(OriginUSRYCTP#,4)
FORMAT(OriginUSRZCTP#,4)
FORMAT(OriginShiftPX#,4)
FORMAT(OriginShiftPY#,4)
FORMAT(OriginShiftPZ#,4)
FORMAT(OriginUSPXCTP#,4)
FORMAT(OriginUSPYCTP#,4)
FORMAT(OriginUSPZCTP#,4)
FORMAT(Retract#,4)
FORMAT(CalcZSurf#,4)
FORMAT(ToolDiameter#,4)
FORMAT(TrackZ#,4)
FORMAT(TrackZNO#,4)
FORMAT(Operation#,5)
FORMAT(Tool#,5)
FORMAT(NewWFO#,5)
FORMAT(Parts#,5)
FORMAT(Dwell#,6)
FORMAT(Program#,7)
FORMAT(CallMasterNum#,7)

{W Axis Subroutines *****************}

M71Block:
SetStatusOff
SeqC 'M71W'
IF NotEqual? TCZ# Num#('0')
TCZ#
ELSE
ClearancePlane1#
END
IF OptCyc1?
'E2'
ELSE
'E1'
END
EOL
SetStatusOn
RETURN

DCP1:
IF NotEqual? TCZ# Num#('0')
IF OptCyc1?
'W'
ELSE
'Z'
END
TrackZ# TCZ#
ELSE
IF OptCyc1?
'W' ClearancePlane1#
ELSE
ZCP1
END
END
RETURN

DCP1C:
IF NotEqual? TCZ# Num#('0')
LoadFeat Num#('0') Num#('0') TCZ#
ELSE
LoadFeat Num#('0') Num#('0') ClearancePlane1#
END
IF ZMove?
DCP1
END
RETURN

DOfstOn:
IF NotEqual? TCZ# Num#('0')
'G43Z' TrackZ# TCZ# ToolOfst
ELSE
OfstOn
END
RETURN

DCP2:
IF OptCyc1?
'W' ClearancePlane2#
ELSE
ZCP2
END
RETURN

DCP2C:
LoadFeat Num#('0') Num#('0') ClearancePlane2#
IF ZMove?
DCP2
END
RETURN

DCP3:
IF OptCyc1?
'W' ClearancePlane3#
ELSE
ZCP3
END
RETURN

DCP3C:
LoadFeat Num#('0') Num#('0') ClearancePlane3#
IF ZMove?
DCP3
END
RETURN

LastDCP3:
IF OptCyc1?
'W' LAST ClearancePlane3#
ELSE
LAST ZCP3
END
RETURN

LastDCP3C:
LoadFeat Num#('0') Num#('0') LAST ClearancePlane3#
IF ZMove?
LastDCP3
END
RETURN

DInPlusInc:
IF OptCyc1?
'W' ZInPlusInc#
ELSE
ZInPlusInc
END
RETURN

DCP2PlusInc:
IF OptCyc1?
'W' ZCP2PlusInc#
ELSE
ZCP2PlusInc
END
RETURN

DCP2PlusIncC:
LoadFeat Num#('0') Num#('0') ZCP2PlusInc#
IF ZMove?
DCP2PlusInc
END
RETURN

DIn:
IF OptCyc1?
'W' FIRST SPZ#
ELSE
ZIn
END
RETURN

DDrillCP:
IF RetractToCP1?
DCP1C
ELSE
DCP2C
END
RETURN

DDepth:
IF OptCyc1?
'W' FIRST SPZ#
ELSE
ZDepth
END
RETURN

MoveDC:
IF ZMove? AND OptCyc1?
'W' EPZ#
ELSE
MoveZC
END
RETURN

MoveSDC:
IF SPZMove? AND OptCyc1?
'W' SPZ#
ELSE
MoveSZC
END
RETURN

DoPeck:
IF GreaterThan? SUB# Recall# Num#('1') Peck# SPZ# { IF OldZ - Peck# > Depth }
Save# Num#('1') SUB# Recall# Num#('1') Peck# { Save#1 NewZ }
SeqC Feed 'W' Recall# Num#('1') FeedEntC EOL { Move to NewZ }
Rapid
IF PeckFullRetract?
SeqC 'W' ClearancePlane2# EOL { Retract Tool Full Out }
END
SeqC 'W' ADD# Recall# Num#('1') Retract# EOL { Move to Retract Pos }
TrackZNO# ADD# Recall# Num#('1') Retract# { Update Status Register }
END
RETURN

{Prog Subroutines ****}

RestoreScale:
IF NOT Metric? {CAM file is in English, tools and tool path}
SetScale('25.4') { change to Metric, this is a Metric post}
END
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?
WFO1
ELSE
WFONum
END
ELSE
WFONum
END
END
END
END
SetFlagF('2')
RETURN

DoSubComment:
IF UseComments? AND SubComment?
FORMAT(Program#,5)
'( SUB NUMBER - ' Program# ' )'
FORMAT(Program#,7)
END
RETURN

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

PSInit:
NewWFOF
RotateF
OptCyc1F
MasterOpF
CallMasterOpF
RETURN

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

DoPostScript:
PSInit
EachPS
SeqC PostScript EOL
PSStuff
NextPS
RETURN

DoEndOpPS:
PSInit
EachEOPS
SeqC EndOpPS EOL
PSStuff
NextPS
RETURN

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

StartSub:
OpenSub
ASCII('13') SubID DoSubComment EOL
RETURN

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

StdSub:
SeqC SubCall CallLabB RepCycs Program# EOL
StartSub
RETURN

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

FinishSubG92: {part 2}
IF OptCyc1?
SeqC Preset
IF NotEqual? RepeatX# Num#('0')
'X' OriginShiftRX#
END
IF NotEqual? RepeatY# Num#('0')
'Y' OriginShiftRY#
END
IF NotEqual? RepeatZ# Num#('0')
'W' OriginShiftRZ#
END
EOL
ELSE
SeqC Preset ShiftRC EOL
END
SeqC EndSub EOL
CloseSub
IF OptCyc1?
SeqC Preset
IF NotEqual? RepeatX# Num#('0')
'X' OriginUSRXCTP#('1')
END
IF NotEqual? RepeatY# Num#('0')
'Y' OriginUSRYCTP#('1')
END
IF NotEqual? RepeatZ# Num#('0')
'W' OriginUSRZCTP#('1')
END
EOL
ELSE
SeqC Preset UnshftRC EOL
END
RETURN

OpenMP:
NewProg
IF WorkFixtureOffsets?
NewWFO
EachWFO {simple eachPart}
SeqC SetWFO EOL
SeqC SubCall CallLabB OnePart Program# EOL
IncWFO
NextWFO {simple NextPart}
ELSE
SeqC SubCall CallLabB Parts Program# EOL
SetFlag('2') { WFOStuff }
END
StartSub
RETURN

CloseMP:
IF WorkFixtureOffsets?
SeqC EndSub EOL
CloseSub
SeqC WFO1 EOL
ELSE
IF OptCyc1?
SeqC Preset
IF NotEqual? PartShiftX# Num#('0')
'X' OriginShiftPX#
END
IF NotEqual? PartShiftY# Num#('0')
'Y' OriginShiftPY#
END
IF NotEqual? PartShiftZ# Num#('0')
'W' OriginShiftPZ#
END
EOL
ELSE
SeqC Preset ShiftPC EOL
END
SeqC EndSub EOL
CloseSub
IF OptCyc1?
SeqC Preset
IF NotEqual? PartShiftX# Num#('0')
'X' OriginUSPXCTP#('1')
END
IF NotEqual? PartShiftY# Num#('0')
'Y' OriginUSPYCTP#('1')
END
IF NotEqual? PartShiftZ# Num#('0')
'W' OriginUSPZCTP#('1')
END
EOL
ELSE
SeqC Preset UnshftPC EOL
END
END
RETURN

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

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

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

FormatArc:
DoAbsOrInc
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
MoveXYC MoveDC
IF ArcIJFormat?
ArcIJC
ELSE
ArcRC
END
RETURN

ckCRC:
IF LastFeat?
CRCOffC
ELSE
CRCOnC
END
RETURN

ckCRCNum:
IF NOT LastFeat?
CRCOffsetC
END
RETURN

ToolPath:
ResetCRCNum
EACHFeat
IF PointFeat?
IF AutoCycle?
SeqC MoveSXYC EOL
SeqC SubCall CallLabB '1' Program# EOL
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
ELSE
IF OptCyc1? AND NOT RigidTap?
SeqC RapidC MoveSXYC EOL
IF Peck?
Save# Num#('1') ClearancePlane2#
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck DoPeck
END
SeqC FeedC MoveSDC FeedEntC EOL
IF Dwell?
SeqC 'G4P' Dwell# EOL
END
IF FIFO? OR Tap?
SeqC FeedC DCP2 EOL
IF NOT LastFeat?
IF RetractToCP1?
SeqC RapidC DCP1 EOL
END
END
ELSE
IF NOT LastFeat?
IF RetractToCP1?
SeqC RapidC DCP1 EOL
ELSE
SeqC RapidC DCP2 EOL
END
END
END
ELSE
SeqC DoDrillAbsOrInc MoveSXC MoveSYC MoveSDC EOL
END
END
ELSE
IF RapidFeat?
IF XMove? OR YMove? OR ZMove?
SeqC DoAbsOrInc ckCRC RapidC MoveXYC MoveDC ckCRCNum EOL
END
ELSE
IF LineFeat?
IF XMove? OR YMove? OR ZMove?
IF Decelerate?
IF RoomToDecel?
DecelMove1
SeqC DoAbsOrInc ckCRC FeedC MoveXYC MoveDC FeedRateC ckCRCNum EOL
DecelMove2
END
SeqC DoAbsOrInc ckCRC FeedC MoveXYC MoveDC DecelFeed ckCRCNum EOL
ELSE
SeqC DoAbsOrInc ckCRC FeedC MoveXYC MoveDC FeedRateC ckCRCNum EOL
END
END
ELSE
IF ArcFeat?
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
IF LastQuadrant? AND Decelerate?
IF RoomToDecel?
DecelMove1
SeqC FormatArc ArcFeedC EOL
DecelMove2
END
SeqC FormatArc DecelFeed EOL
ELSE
SeqC FormatArc ArcFeedC EOL
END
NEXTQuadrant
END
END
END
END
NEXTFeat
RestoreAbsOrInc
RETURN

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

AutoCycCutSub2: {part 2}
ToolPath
SeqC AbsOrInc
IF Repeats? AND FeedConnect? AND ZshiftOnly?
ELSE
IF FIFO?
FeedC DCP2 FeedEntC
ELSE
RapidC DCP2
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 AbsOrInc Connect StrtPos EOL
Milling
FinishSub1
FinishSubG92
RETURN

ZonlyRepAutoCycle:
AutoCycPat {write pattern moves and main calls}
StartSub
NewProg
EachCycle
SetSRXYtoEP
IF FeedConnect?
Feed
IF NOT FirstCycle?
IF SPXMove? OR SPYMove?
SeqC IncValue StrtPosC EOL
AbsOrInc
END
END
SeqC DInPlusInc FeedEnt EOL
ELSE
IF NOT FirstCycle?
Rapid
IF SPXMove? OR SPYMove?
SeqC IncValue StrtPosC EOL
AbsOrInc
END
IF FeedEntry?
SeqC DCP2PlusInc EOL
END
END
IF FeedEntry?
SeqC Feed DInPlusInc FeedEnt EOL
ELSE
IF FirstCycle?
Rapid
END
SeqC RapidC DInPlusInc EOL
END
END
IF FirstCycle?
SetStatusOff {protect Z position for incremental sub}
END
SeqC SubCall CallLabB '1' Program# EOL
NextCycle
SetStatusOn
AutoCycCutSub1 {build element sub}
AutoCycCutSub2
IF FeedConnect? {there is no Z up in the sub}
IF FIFO?
SeqC Feed DCP2 FeedEnt EOL
ELSE
SeqC Rapid DCP2 EOL
END
END
SeqC EndSub EOL
CloseSub
{Element shift, not pattern}
RETURN

ZonlyRep:
EachCycle
IF NOT FirstCycle?
SeqC Connect StrtPos EOL
END
IF FeedConnect?
SeqC FeedC DInPlusInc FeedEnt EOL
ELSE {Entry/Exit Connect}
IF FeedEntry?
IF NOT FirstCycle?
SeqC RapidC DCP2PlusIncC EOL
END
SeqC Feed DInPlusInc FeedEnt EOL
ELSE
SeqC RapidC DInPlusInc EOL
END
END
SeqC SubCall CallLabB '1' Program# EOL
NextCycle
StartSub
TrackZNO# FIRST SPZ#
ToolPath
FinishSub1
SeqC 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?
IF NotEqual? TCZ# Num#('0')
TrackZNO# TCZ#
ELSE
TrackZNO# ClearancePlane1#
END
ELSE
TrackZNO# ClearancePlane2#
END
RETURN

GetStartOfSameTool:
DoOpComments
DoPostScript
CheckPass
RETURN

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

{setup and initializations}
InitProg
ReverseXZArcs
InitWFONum
SetFlood
UseSeparateSubCalls
SetMaxSeparateSubCalls('200')
SetMaxRPM('1000')
IF Metric?
SetMaxFeed('2540')
ELSE
SetMaxFeed('100')
END
SetTCZ('0') { ZCP1 Adjust }
SetFlagF('1') { Milling ZShiftOnly SepSubs }
SetFlagF('2') { WFOStuff }
Save# Num#('1') Num#('0') { Manual Peck Cycle }
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
' OptionalCycle1, OptCyc1 -' EOL
' Changes all Z Addresses to W, output E2 on M71 block' EOL
' Non-modal - Reset to False at end of Operation' EOL
' ToolChangeZ(5), TCZ(5) -' EOL
' Allows user to overide overall clearance plane (CP1) value' EOL
' Modal - Value remains in effect until changed' EOL
END
EachOp {Start of post processing *********************}
IF MultipleParts?
IF AllToolsOnePart?
IF EquallySpacedOffsets?
SetFlag('2') { WFOStuff }
END
ELSE {implied OneToolAllParts?}
IF FullUp?
IF EquallySpacedOffsets?
SetFlag('2') { WFOStuff }
END
ELSE {implied ExitClearancePlane?}
SetFlag('2') { WFOStuff }
END
END
ELSE
SetFlag('2') { WFOStuff }
END
IF FirstOperation?
EOR EOL
ProgID1
IF UseComments? AND ProgramNameComment?
'( ' ProgramName$ ' )'
END
EOL
IF ToolChangeAtHome?
SetHome
END
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$ ' MM )' EOL
END
IF PartsComment?
'( PARTS PROGRAMMED - ' Parts# ' )' EOL
END
IF StartToolComment?
'( FIRST TOOL NOT IN SPINDLE )' EOL
END
END
OpenSub
RestoreScale
IF MultipleParts? AND AllToolsOnePart?
OpenMP
END
Seq Rapid Plane CRCOff 'G49' 'G98' AbsOrInc DrillOff EOL
SeqC OpToolID ToolChng EOL
DoOpComments
DoPostScript
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
SeqC WFOStuff StrtPos Speed SpinOn EOL
M71Block
SeqC DOfstOn CoolOn EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
SeqC AbsOrInc Rapid WFOStuff StrtPos Speed SpinOn EOL
END
ELSE
IF NewTool?

{Finish off last Operation}

IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CloseMP
END
SeqC RapidC CRCOffC CoolOff EOL
SeqC 'G53G49D0H0Z0' EOL { OfstOff }
IF MultipleParts? AND OneToolAllParts? AND FullUp?
CloseMP
END
DoEndOpPS
IF ToolChangeAtHome?
SeqC Rapid Home EOL
END
IF LAST ProgStop?
SeqC 'M0' EOL
ELSE
SeqC 'M70' EOL
SeqC ProgStop EOL
END

{Start new Operation}

Seq Rapid Plane CRCOff 'G49' 'G98' AbsOrInc DrillOff EOL
SeqC OpToolID ToolChng EOL
DoOpComments
DoPostScript
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
SeqC WFOStuff StrtPos Speed SpinOn EOL
M71Block
SeqC DOfstOn CoolOn EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
SeqC AbsOrInc Rapid WFOStuff StrtPos Speed SpinOn EOL
END
ELSE
IF SameTool?
IF LAST ProgStop?
SeqC RapidC CRCOffC CoolOff EOL
SeqC 'G53G49D0H0Z0' EOL { OfstOff }
DoEndOpPS
SeqC SpinOff EOL
SeqC 'M0' EOL

{Start new Operation}

Seq Rapid Plane CRCOff 'G49' 'G98' AbsOrInc DrillOff EOL
GetStartOfSameTool
SeqC WFOStuff StrtPos Speed SpinOn EOL
M71Block
SeqC DOfstOn CoolOn EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqC CoolOff EOL
END
IF NewToolOffset?
SeqC RapidC CRCOffC 'G53G49D0H0Z0' EOL { OfstOff }
DoEndOpPS

{Start new Operation}

GetStartOfSameTool
SeqC PlaneC AbsOrInc Rapid WFOStuff StrtPos SpeedC EOL
M71Block
SeqC DOfstOn EOL
ELSE
IF LAST Milling?
IF LAST AutoCycle?
SeqC LastDCP3C EOL
ELSE
IF LAST FIFO? {.81}
SeqC FeedC CRCOffC LastDCP3C LAST FeedEntC EOL
ELSE
SeqC RapidC CRCOffC LastDCP3C EOL
END
END
END
DoEndOpPS

{Start new Operation}

GetStartOfSameTool
SeqC PlaneC AbsOrInc Rapid WFOStuff StrtPos SpeedC EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqC CoolOn EOL
END
END
END
END
END {common point for all operations}
IF Milling?
SeqC 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') { Milling ZShiftOnly SepSubs }
ZonlyRep
SetFlagF('1')
ELSE {no sep subs desired}
G92Sub
END
END {end Auto Cycle IF}
ELSE {not Z only}
G92Sub
END {end Z only IF}
ELSE {no repeat OPs}
Milling
END
ELSE
IF Drilling?
IF Repeats?
NewProg
StdSub
SeqC AbsOrInc Rapid StrtPos EOL
END
GetCycle
IF OptCyc1? AND NOT RigidTap? AND NOT FIStopOffWallRO? AND NOT BackBore?
SeqC StrtPosC EOL
IF Peck?
SeqC DCP2C EOL
END
ToolPath
ELSE
SeqC DDrillCP EOL
IF RigidTap?
SeqC 'M29' Speed EOL
ELSE
IF FIStopOffWallRO?
SeqC 'G76' FromCP StrtPos DDepth 'Q' Retract# 'R' ClearancePlane2# 'P' Dwell# FeedEnt EOL
ELSE
IF BackBore?
SeqC 'G87' FromCP StrtPos DDepth 'Q' Retract# 'R' CalcZSurf# 'P' Dwell# FeedEnt EOL
ELSE
SeqC Cycle FromCP StrtPos DDepth RLevel Dwell Peck Retract FeedEnt EOL
END
END
END
IF CallMasterOp?
SeqC SubCall CallLabB '1' CallMasterNum# EOL
SkipToLastFeat
ELSE
TrackZNO# FIRST SPZ#
IF MasterOp?
SetFlag('1') {std sep sub Zreps in effect}
NewMasterProg
SeqC SubCall CallLabB '1' Program# EOL
StartSub
ToolPath
SeqC EndSub EOL
CloseSub
SetFlagF('1') {not std sep sub Zreps in effect}
ELSE
ToolPath
END
END
SetDrillEndOpZ
SeqC DrillOff EOL
END
LoadFeat Num#('0') Num#('0') ClearancePlane3#
IF ZMove?
SeqC RapidC DCP3 EOL
END
IF Repeats?
FinishSubG92
END
END
END
NextOp {loops back to EachOP until last Operation}

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

{finish last operation}
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CloseMP
END
SeqC RapidC CRCOffC CoolOff EOL
IF MultipleParts? AND OneToolAllParts? AND FullUp?
CloseMP
END
DoEndOpPS
IF FIRST ToolChangeAtHome? {.71.2 added FIRST modifier}
SeqC Rapid FirstHome EOL
END
IF MultipleParts? AND AllToolsOnePart?
IF ProgStop?
SeqC 'M0' EOL
ELSE
SeqC ProgStop EOL
END
CloseMP
END
SeqC 'G53G49D0H0Z0M5' EOL { OfstOff }
SeqC 'M70' EOL
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


Wyszukiwarka

Podobne podstrony:
Fanuc 0M [NM] MZ26 89 3m
Fanuc 16M [AP] C789 13 5m
Fanuc 0M [NM] MZ26 89 3
Fanuc 5M [NM] M961 89 1
Fanuc 16M Rodrill [GTR] MZ23 89
Fanuc 16M Rodrill G10 MZ24 89
Fanuc 16M DP [WPM] MW54 89
Fanuc 16M Roku [SM] MT38 89 2
Fanuc 16M Edgetec L570 85
Fanuc 11M [EDMP] MW52 89
Fanuc 10M MS M031 89
Fanuc 16M Makino [EE] NMT56 16
Fanuc 16M Makino [APM] C427 12

więcej podobnych podstron