CNC 88 Retro Tek [TTD] M470 87


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

{12/6/91
Copied & modified: CNC 88 Retro-Tek M.81
For: Thor Tool Corporation
Machine: Retro-Tek
Control: CNC 88
Changes made per conversations with Patrick A. Silva, and sample Program and manual supplied.
Added Spaces in Form and Prog.
Added FORMAT #9 '##.#;0' for MUL# for Tap Retract Feeding Formula.
Added Recall# Num#(2) for User Macro ID#.
Added Special Handling of Tapping Cycle.
Created TapSub Sub to output Tapping Cycle in a User Macro.
Deleted AbsOrInc from G92Sub, NewTool, SameTool, Drilling Repeats and end of Prog.
Added Tool Change Macro at FirstOperation, and Call to same at NewTool and end of Prog.
Modified Start of Main Prog Output.
Changed Plane to PlaneC at NewTool.
Deleted StrtPos from Canned Drilling Cycle Line.
DWB}

{2/9/96, Updated .81 version to .84, MPK}

{3/22/96, Tested ZOnlyRepAutCycle, Incremented number to .87, MPK}

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

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(ToolDiameter#,4) {.72}
FORMAT(Recall#,5)
FORMAT(Program#,5) {.72}
FORMAT(Operation#,5) {.72}
FORMAT(Tool#,5) {.72}
FORMAT(Parts#,5) {.72}
FORMAT(Tag#,5)
FORMAT(Dwell#,6) {.72}
FORMAT(ClearancePlane2#,7)
FORMAT(SPZ#,7)
FORMAT(OriginUnshiftPX#,7)
FORMAT(OriginUnshiftPY#,7)
FORMAT(OriginUnshiftPZ#,7)
FORMAT(OriginUnshiftRX#,7)
FORMAT(OriginUnshiftRY#,7)
FORMAT(OriginUnshiftRZ#,7)
FORMAT(PartShiftX#,7)
FORMAT(PartShiftY#,7)
FORMAT(PartShiftZ#,7)
FORMAT(RepeatX#,7)
FORMAT(RepeatY#,7)
FORMAT(RepeatZ#,7)
FORMAT(ArcZRads#,8)
FORMAT(MUL#,9)

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

DoSubComment:
IF UseComments? AND SubComment?
NewProg
'! 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
IF Metric? {CAM file is in Metric, tools and tool path}
SetScale('.03937007874') { change to English, this is an English post}
END
END
RETURN

PSInit: {reset flags}
RotateF
RETURN

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

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

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

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

StartSub:
OpenSub
' ' EOL
DoSubComment
'>' Tag# EOL
SeqLab
RETURN

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

StdSub:
SeqLabC ' DÅ‚' Tag# ' Q²' Tag# RepLab RepCycs EOL
StartSub
RETURN

FinishSub1: {part 1}
SeqLabC
IF NOT FeedConnect?
IF Flag?('1') { Flag(1) set at ZonlyRep }
SeqLab {This is needed for '<' Tag# to work correctly}
END
IF AutoCycle?
ZCP3C
ELSE
IF FIFO? {.81}
FeedC ZCP3C FeedRateC
ELSE
RapidC ZCP3C
END
END
IF Flag?('1') AND EmptyLine? { Flag(1) set at ZonlyRep }
' ' {This is needed for '<' Tag# to work correctly}
END
END
EOL
RETURN

FinishSubG92: {part 2}
SeqLab
IF AbsoluteMoves?
IncValue
END
IF NotEqual? RepeatX# Num#('0')
' U' RepeatX#
END
IF NotEqual? RepeatY# Num#('0')
' V' RepeatY#
END
IF NotEqual? RepeatZ# Num#('0')
' W' RepeatZ#
END
IF AbsoluteMoves?
AbsOrInc
END
EOL
'<' Tag# EOL
TagDown
CloseSub
SeqLabC
IF NotEqual? RepeatX# Num#('0')
' U0'
END
IF NotEqual? RepeatY# Num#('0')
' V0'
END
IF NotEqual? RepeatZ# Num#('0')
' W0'
END
EOL
RETURN

OpenMP:
TagUp TagInc
SeqLabC ' DÅ‚' Tag# ' Q²' Tag# RepLab Parts EOL
StartSub
RETURN

CloseMP:
SeqLab
IF AbsoluteMoves?
IncValue
END
IF NotEqual? PartShiftX# Num#('0')
' U' PartShiftX#
END
IF NotEqual? PartShiftY# Num#('0')
' V' PartShiftY#
END
IF NotEqual? PartShiftZ# Num#('0')
' W' PartShiftZ#
END
IF AbsoluteMoves?
AbsOrInc
END
EOL
'<' Tag# EOL
TagDown
CloseSub
SeqLabC
IF NotEqual? PartShiftX# Num#('0')
' U0'
END
IF NotEqual? PartShiftY# Num#('0')
' V0'
END
IF NotEqual? PartShiftZ# Num#('0')
' W0'
END
EOL
RETURN

CheckHelix:
IF ZshiftOnly? AND NOT AutoCycle? { SkipZ set in ZRepOnly, ZMove always = TRUE }
MoveXYZC
IF ArcIJFormat?
ArcIJC
ELSE
ArcRC
END
ELSE
IF XYPlane? AND ZMove?
MoveXYZC ArcIJC ' K' ArcZRads#
ELSE
IF XZPlane? AND YMove?
MoveXYZC ArcIC ' J' ArcZRads# ArcJC
ELSE
IF YZPlane? AND XMove?
MoveXYZC ' I' ArcZRads# ArcIJC
ELSE { NOT Helical/Spiral Feature }
MoveXYZC
IF ArcIJFormat?
ArcIJC
ELSE
ArcRC
END
END
END
END
END
RETURN

FormatArc:
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
CheckHelix
RETURN

StdLine: {enables CRC on first call, .70}
IF Decelerate?
IF RoomToDecel?
DecelMove1
SeqLabC FeedC MoveXYZC FeedRateC EOL
DecelMove2
END
SeqLabC FeedC MoveXYZC DecelFeed EOL
ELSE
IF XMove? OR YMove? OR ZMove?
SeqLabC FeedC MoveXYZC FeedRateC EOL
END
END
RETURN

TapSub: { Macro for Tapping Cycle }
SetStatusOff
OpenSub
' ' EOL
DoSubComment
Save# Num#('2') ADD# Recall# Num#('2') Num#('1') { Increment User Macro Number }
SeqLab ' (G' Recall# Num#('2') EOL { Tool Change Macro }
SeqLabC SpinOn Feed ' Z' SPZ# FeedEnt SpinOff EOL
SeqLabC ' G4 X100' EOL { Dwell }
SeqLabC InverseSpinOn Feed ZCP2 ' F' MUL# FeedEntry# Num#('.85') SpinOff EOL
SeqLabC ' G4 X100' EOL { Dwell }
SeqLabC ')' EOL
CloseSub
SetStatusOn
RETURN

ToolPath:
ResetCRCNum {.72}
EACHFeat
IF PointFeat?
IF AutoCycle?
SeqLabC MoveSXYC EOL
SeqLabC ' DÅ‚' Tag# ' Q²' Tag# ' L1' EOL
CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY}
ELSE
IF Tap?
IF FirstFeat?
TapSub
ELSE
IF NotEqual? SPZ# LAST SPZ# {.80.01}
TapSub
END
Rapid
END
SeqLabC MoveSXYC ' G' Recall# Num#('2') EOL
ELSE
SeqLabC MoveSXYZC EOL {.80.01}
END
END
ELSE
IF LastFeat? AND Flag?('1') AND FeedConnect? { Flag(1) set at ZonlyRep }
SeqLab {This is needed for '<' Tag# to work correctly}
END
IF RapidFeat?
IF XMove? OR YMove? OR ZMove?
SeqLabC RapidC MoveXYZC EOL
END
ELSE
IF LineFeat?
StdLine
ELSE
IF ArcFeat?
EACHQuadrant { Do not use NOT, FIRST, LAST or NEXT modifiers in this loop }
IF LastQuadrant? AND Decelerate?
IF RoomToDecel?
DecelMove1
SeqLabC FormatArc ArcFeedC EOL
DecelMove2
END
SeqLabC FormatArc DecelFeed EOL
ELSE
SeqLabC FormatArc ArcFeedC EOL
END
NEXTQuadrant
END
END
END
END
NEXTFeat
RETURN

WFOStuff:
{Note: This processor does not handle work fixture offsets}
RETURN

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

AutoCycCutSub2: {part 2}
ToolPath
SeqLab AbsOrInc
IF Repeats? AND FeedConnect? AND ZshiftOnly?
{.69 removed RapidC}
ELSE
IF FIFO? {.81}
FeedC ZCP2 FeedRateC
ELSE
RapidC ZCP2
END
END
EOL
'<' Tag# 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?
TagUp TagInc
AutoCycCutSub1
EntryMove
AutoCycCutSub2
AutoCycPat
TagDown
ELSE
EntryMove
ToolPath
END
RETURN

G92Sub:
SubWarning
StdSub
SeqLabC Connect StrtPos EOL
Milling
FinishSub1
FinishSubG92
RETURN

ZonlyRepAutoCycle:
AutoCycPat {write pattern moves and main calls}
StartSub
TagUp TagInc
Save# Num#('1') Num#('0') {This is needed for '<' Tag# to work correctly}
EachCycle
SetSRXYtoEP
IF FeedConnect?
IF NOT FirstCycle?
IF SPXMove? OR SPYMove?
SeqLabC Feed IncValue StrtPosC EOL
SeqLabC AbsOrInc
ELSE
SeqLabC Feed
END
ELSE
SeqLabC Feed
END
ZInPlusInc FeedEnt EOL
ELSE
IF NOT FirstCycle?
IF SPXMove? OR SPYMove?
SeqLabC Rapid IncValue StrtPosC EOL
IF FeedEntry?
SeqLabC AbsOrInc ZCP2PlusInc EOL
SeqLabC Feed ZInPlusInc FeedEnt EOL
ELSE
SeqLabC AbsOrInc ZInPlusInc EOL
END
ELSE
IF FeedEntry?
SeqLabC Rapid ZCP2PlusInc EOL
SeqLabC Feed ZInPlusInc FeedEnt EOL
ELSE
SeqLabC Rapid ZInPlusInc EOL
END
END
ELSE
IF FeedEntry?
SeqLabC Feed ZInPlusInc FeedEnt EOL
ELSE
SeqLabC Rapid ZInPlusInc EOL
END
END
END
IF FirstCycle?
SetStatusOff {protect Z position for incremental sub}
END
IF NOT FeedConnect? {This is needed for '<' Tag# to work correctly}
Save# Num#('1') ADD# Recall# Num#('1') Num#('1')
IF Equal? Recall# Num#('1') Repeats#
SeqLab
END
END
SeqLabC ' DÅ‚' Tag# ' Q²' Tag# ' L1' EOL
NextCycle
SetStatusOn
AutoCycCutSub1 {build element sub}
AutoCycCutSub2
{.69, removed FinishSub1}
IF FeedConnect? {there is no Z up in the sub, .69}
IF FIFO? {.81}
SeqLab Feed ZCP2 FeedRate EOL {.69}
ELSE
SeqLab Rapid ZCP2 EOL {.69}
END
END {.69}
TagDown
'<' Tag# EOL
CloseSub
{Element shift, not pattern}
RETURN

ZonlyRep:
EachCycle
IF NOT FirstCycle?
SeqLabC Connect StrtPos EOL {.71.2, added Connect}
END
IF FeedConnect?
SeqLabC FeedC ZInPlusInc FeedEnt EOL {.71.2, changed to FeedC}
ELSE {Entry/Exit Connect}
IF FeedEntry?
IF NOT FirstCycle?
SeqLabC RapidC ZCP2PlusIncC EOL {can't call for cycle =1} {.69 added Rapid, reads better} {.71.2, changed to RapidC, reads better}
END
SeqLabC Feed ZInPlusInc FeedEnt EOL
ELSE
SeqLabC RapidC ZInPlusInc EOL {.69 added Rapid, reads better} {.71.2, changed to RapidC, reads better}
END
END
SeqLabC ' DÅ‚' Tag# ' Q²' Tag# ' L1' EOL
NextCycle
StartSub
SkipZ
SetFlag('1') {This is needed for '<' Tag# to work correctly}
ToolPath
UnSkipZ { Moved from FinishSub1 }
FinishSub1
SetFlagF('1')
'<' Tag# EOL
TagDown
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
ReverseXZArcs
NoIJKSigns
SetFlood
UseSeparateSubCalls
SetMaxSeparateSubCalls ('50')
SetMaxRPM('3750')
SetMaxFeed('500')
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
' 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?
EOR EOL
IF ToolChangeAtHome?
SetHome
END
IF UseComments?
IF ProgramNameComment?
'! PROGRAM: ' ProgramName$ EOL
END
IF ProgramComment?
'! ' ProgramComment$ EOL
END
IF FormatNameComment?
'! FORMAT: ' FormatName$ EOL
END
IF TimeComment?
'! ' Date$ ' AT ' Time$ EOL
END
IF MovesComment?
'! OUTPUT IN ' MoveType$ ' INCHES' EOL
END
IF PartsComment?
'! PARTS PROGRAMMED: ' Parts# EOL
END
IF StartToolComment?
'! FIRST TOOL NOT IN SPINDLE' EOL
END
END
OpenSub
IF Metric? {CAM file is in Metric, tools and tool path}
SetScale('.03937007874') { change to English, this is an English post}
END
OpenSub
' ' EOL
DoSubComment
Save# Num#('2') Num#('70') { Set for User Macro Number }
SeqLab ' (G' Recall# Num#('2') EOL { Tool Change Macro }
SeqLabC ' G80' AbsOrInc Rapid OfstOff SpinOff CoolOff EOL
SeqLabC ' U0 V0' Home EOL
SeqLabC ')' EOL
CloseSub
IF MultipleParts? AND AllToolsOnePart?
OpenMP
END
DoOpComments
DoPostScript
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
SeqLab SpinOn CoolOn Speed Plane AbsOrInc Rapid ' U0 V0' StrtPos EOL
SeqLabC ToolOfst ZCP1 EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
SeqLabC StrtPos EOL
END
ELSE
IF NewTool?

{Finish off last Operation}

IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CloseMP
END
IF MultipleParts? AND OneToolAllParts? AND FullUp?
SeqLabC CoolOff OfstOff EOL
CloseMP
END
DoEndOpPS
IF LAST ProgStop?
SeqLabC ' M0' EOL
ELSE
SeqLabC ProgStop EOL
END

{Start new Operation}

SeqLab ' G70' ToolChng EOL { Call Tool Change Macro }
DoOpComments
DoPostScript
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
SeqLabC SpinOn CoolOn Speed PlaneC Rapid ' U0 V0' StrtPos EOL
SeqLabC ToolOfst ZCP1 EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
SeqLabC StrtPos EOL
END
ELSE
IF SameTool?
DoEndOpPS
IF LAST ProgStop?
SeqLabC SpinOff CoolOff OfstOff ' M0' EOL

{Start new Operation}

GetStartOfSameTool
SeqLabC SpinOn CoolOn SpeedC PlaneC Rapid StrtPos EOL
SeqLabC ToolOfst ZCP1 EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqLabC CoolOff EOL
END
IF NewToolOffset?
SeqLabC OfstOff EOL

{Start new Operation}

GetStartOfSameTool
SeqLabC SpeedC PlaneC Rapid StrtPos EOL
SeqLabC ToolOfst ZCP1 EOL
ELSE

{Start new Operation}

GetStartOfSameTool
SeqLabC SpeedC PlaneC Rapid StrtPos EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqLabC CoolOn EOL
END
END
END
END
END {common point for all operations}
IF Milling?
SeqLabC ZCP2C EOL
IF Repeats?
TagUp TagInc
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
IF AutoCycle?
SeqLabC ZCP3C EOL
ELSE
IF FIFO? {.81}
SeqLabC FeedC ZCP3C FeedRateC EOL
ELSE
SeqLabC RapidC ZCP3C EOL
END
END
ELSE
IF Drilling?
IF Repeats?
TagUp TagInc
StdSub
SeqLabC Rapid StrtPos EOL
END
SeqLabC DrillCP EOL
GetCycle
IF NOT Tap? { Special Case Handled at ToolPath }
SeqLabC Cycle RLevel ZDepth ' K' ClearancePlane2# Peck FeedEnt EOL { K = Retract }
END
TrackZNO# ZDepth# {.81}
ToolPath
IF RetractToCP1? {.81}
TrackZNO# ClearancePlane1#
ELSE
TrackZNO# ClearancePlane2#
END
SeqLabC
IF Tap?
' '
ELSE
' G80'
END
EOL
IF Repeats?
FinishSubG92
END
SeqLabC 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?
SeqLabC CoolOff OfstOff EOL
CloseMP
END
DoEndOpPS
IF ProgStop?
SeqLabC ' M0' EOL
END
IF MultipleParts? AND AllToolsOnePart?
CloseMP
END
SeqLabC ' G70' EOP EOL { Call Tool Change Macro }
CloseSub
Post2 {organize Subs into one program}
EOR EOL
Close
Retag
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:
CNC 88 Retro Tek M471 87
CNC 8800 Retro Tek M045 89
87 88 by darog83
Fanuc 10M MVJr[G43r] M192 87
Tosnuc 600M BMC 40 M440 87

więcej podobnych podstron