{Change Comments ***********************************************************}
{8/16/95,
Updated for Catalyst v2.20 per Fanuc 10T MS [-] L001.85.01 Format.
DWB}
{2/4/96
Modified: Okuma OSP 5000 LB15 L103.85
Created: Okuma OSP5k LB15 [IM] Lxxx.85.1
For: Isimac; per Jim Adams
Changed tool start-up and end code per their samples.
Added DoCSS sub in Approach to output G96 stuff right after AppMove.
Changed AppMove to support triple offset number (T010101 format). The last two digits
are the cutter comp number; they ALWAYS need this number, even in a drilling op which
has no CRC number. This is why I added the IF CutterRadiusComp? part; if CutterRadiusComp?
is false, then there is no CRC number to output, which is bad. So I used LatheOffset to output
a good value when cuttercomp is false.
Added blank line between tools.
Added hard-coded start-up code before first op.
Changed tool start-up code at FirstOp and NewTool to their specifications.
Changed DoOpComments; they only want Operation and Tool comments.
Added SetGearRange, SetNewGearFlag, and GetGearRange subs to handle high/low spindle logic
(low speed/M41 for roughing ops, high speed/M42 for finish or contouring ops;
low speed is <= 1000 and high speed is >1000. This logic is required in order to work
correctly in SameTool (CheckOffset sub).
Fixed thread canned cycle (they use 'M73' for ConstantVolumeCut).
Changed G74 (peck cycle) to their specifications.
Added DoCRCOnCannedRough sub to break up first move in canned rough cycle to two moves;
this serves two purposes - to properly turn on cutter comp and to produce a legal rough cycle.
Also added same logic to long hand rough to correctly turn on cuttercomp.
Changed CheckRapid sub to output G40 on line by itself.
Added logic to ApproachSP to correctly turn on CRC in long hand rough cycles. In Rough Plunge,
this is done by adding a move between the Operation clearance Dia or Plane, and in all other
long hand roughs this is done by turning on CRC on the move from XOpCD or ZOpCP to CycleStartX/Z.
Deleted the EOR after ProgramName$ at the program header section.
Joe Cusimano}
{Prog Numeric Format Definitions *******************************************}
#1 = '#.00'
#2 = '+####.####;0'
#3 = '#######0'
#4 = '###.##;0'
#5 = '####.####;0'
#6 = '###0'
#7 = '#'
FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(MUL#,2) { Non-Canned Threading AutoFinish }
FORMAT(XCutDepth#,2)
FORMAT(ZCutDepth#,2)
FORMAT(Program#,3) {.72}
FORMAT(Operation#,3) {.72}
FORMAT(Tool#,3) {.72}
FORMAT(Dwell#,4) {.72}
FORMAT(Peck#,5)
FORMAT(Retract#,5)
FORMAT(CalcEPRPM#,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
DoOpComments:
IF UseComments?
SetScale('1')
IF OperationComment?
'( ' OperationComment$ ' )' EOL
END
IF ToolComment?
'( ' ToolComment$ ' )' EOL
END
RestoreScale
END
RETURN
PSInit: {reset flags from last Op, .70}
RETURN
PSStuff:
RETURN
DoPostScript:
PSInit
EachPS
SeqLabC PostScript EOL {literals}
PSStuff {commands}
NextPS
RETURN
DoEndOpPS:
PSInit
EachEOPS
SeqLabC EndOpPS EOL {literals}
PSStuff {commands}
NextPS
RETURN
StockOnNoCan:
IF NOT CannedCycle?
StockOn {need stock for SP positioning, if not a canned cycle}
END
RETURN
FeedNoCan:
IF NOT CannedCycle?
FeedC
END
RETURN
FeedRateNoCan:
IF NOT CannedCycle?
FeedRateC
END
RETURN
DoCRCOnCannedRough:
IF ApproachFace?
SeqLabC StepMove ZSP EOL
SeqLabC CRCOnC FeedC XSP EOL
ELSE { ODApproach/IDApproach }
SeqLabC StepMove XSP EOL
SeqLabC CRCOnC FeedC ZSP EOL
END
RETURN
ApproachSP:
IF ApproachFace?
SeqLabC StockOnNoCan XSPC EOL
SeqLabC StockOff ZOpCPC EOL
StockOnNoCan
IF Roughing? AND CutterRadiusCompensation? AND NOT CannedCycle? { turn on CRC in long hand rough }
IF NotEqual? CycleStartZ# ZOpCP#
SeqLabC CRCOn FeedC ZSPC FeedRateC EOL { pick up CRC on move from ZOpCP to CycleStartZ }
ELSE
IF RoughPlunge? { add a CRC move for Plunge Rough cycle condition }
{ subtract .05 from CycleStartZ# and save in variable 1 }
SAVE# NUM#('1') SUB# CycleStartZ# NUM#('.05')
FORMAT(TrackZ#,5)
SeqLabC CRCOn FeedC TrackZ# ' Z' RECALL# NUM#('1') FeedRateC EOL
ELSE
'*** Warning - bad cutter comp move - change Z Oper Clearance Plane ***' EOL
END
END
ELSE { normal case }
IF NotEqual? CycleStartZ# ZOpCP#
SeqLabC FeedNoCan ZSPC FeedRateNoCan EOL
END
END
ELSE { ODApproach/IDApproach }
SeqLabC StockOnNoCan ZSPC EOL
SeqLabC StockOff XOpCDC EOL
StockOnNoCan
IF Roughing? AND CutterRadiusCompensation? AND NOT CannedCycle? { turn on CRC in long hand rough }
IF NotEqual? CycleStartX# XOpCD#
SeqLabC CRCOn FeedC XSPC FeedRateC EOL { pick up CRC on move from XOpCD to CycleStartX }
ELSE
IF RoughPlunge? { add a CRC move for Plunge Rough cycle condition }
IF ApproachOD?
{ subtract .05 from CycleStartX# and save in variable 2 }
SAVE# NUM#('2') SUB# CycleStartX# NUM#('.05')
ELSE { Approach ID }
{ add .01 to CycleStartX# and save in variable 2 }
SAVE# NUM#('2') ADD# CycleStartX# NUM#('.01')
END
FORMAT(TrackX#,5)
SeqLabC CRCOn FeedC TrackX# ' X' RECALL# NUM#('2') FeedRateC EOL
ELSE
'*** Warning - bad cutter comp move - change X Oper Clearance Dia ***' EOL
END
END
ELSE { normal case }
IF NotEqual? CycleStartX# XOpCD#
SeqLabC FeedNoCan XSPC FeedRateNoCan EOL
END
END
END
RETURN
DoCSS:
IF ConstantSurfaceFeed? AND NOT SameTool?
SeqLabC Preset MaxRPM EOL
SeqLabC CSSOn ' G96' Speed EOL
END
RETURN
AppMove:
StockOff ThisOpEntryZCP OpToolID LatheOffset
IF CutterRadiusCompensation?
CRCOfstNum
ELSE
LatheOffset
END
RETURN
Approach: { NOT FOR TAILSTOCK, .82 }
RapidF# { RapidF# Forces FeedRate }
IF ApproachOD?
SeqLabC ThisOpEntryXCP AppMove EOL
DoCSS
ELSE
IF ApproachID?
SeqLabC XOpCD AppMove EOL
DoCSS
ELSE {ApproachFace}
SeqLabC StockOnNoCan XSP AppMove EOL
DoCSS
END
END
ApproachSP
RETURN
SetGearRangeFlag: { Flag 1 is used for gear range; true is low and false is high }
IF ConstantSurfaceFeed?
IF Roughing?
SetFlag('1') {low speed}
ELSE
SetFlagF('1') {high speed}
END
ELSE
IF LTEqual? SpeedRPM# Num#('1000')
SetFlag('1') {low speed}
ELSE
SetFlagF('1') {high speed}
END
END
RETURN
GetGearRange:
IF Flag?('1')
' M41' {low speed}
ELSE
' M42' {high speed}
END
RETURN
SetNewGearFlag: { Flag 2 is used to flag a gear range change }
IF ConstantSurfaceFeed?
IF Roughing?
IF Flag?('1')
SetFlagF('2') { no gear range change }
ELSE
SetFlag('2') { gear range change true }
END
ELSE
IF Flag?('1')
SetFlag('2') { gear range change true }
ELSE
SetFlagF('2') { no gear range change }
END
END
ELSE
IF LTEqual? SpeedRPM# Num#('1000')
IF Flag?('1')
SetFlagF('2') { no gear range change }
ELSE
SetFlag('2') { gear range change true }
END
ELSE
IF Flag?('1')
SetFlag('2') { gear range change true }
ELSE
SetFlagF('2') { no gear range change }
END
END
END
RETURN
CheckOffset:
DoEndOpPS
IF LAST ProgStop?
SeqLabC ' M0' EOL
ELSE
IF CoolOff? AND LAST NOT CoolOff?
SeqLabC CoolOff EOL
END
END
IF NewToolOffset?
SeqLabC LOfstOff '00' EOL
SeqLabC OpToolID LatheOffset CRCOfstNum EOL
END
CSSOff
IF ConstantSurfaceFeed?
IF LAST ConstantSurfaceFeed?
IF NotEqual? MaxRPM# LAST MaxRPM#
SeqLabC Preset MaxRPM EOL
END
IF LAST ProgStop?
CSSOn ' G96' Speed
ELSE
IF NotEqual? SpeedRPM# LAST SpeedRPM#
CSSOn ' G96' Speed
END
END
ELSE
SeqLabC Preset MaxRPM EOL
CSSOn ' G96' Speed
END
ELSE
IF LAST ConstantSurfaceFeed?
' G97' Speed
ELSE
IF LAST ProgStop?
' G97' Speed
ELSE
IF NotEqual? SpeedRPM# LAST SpeedRPM#
' G97' Speed
END
END
END
END
IF LAST ProgStop?
SeqLabC {SpeedC} GetGearRange SpinOn EOL
SeqLabC CoolOn EOL
ELSE
IF Flag?('2') { New gear range required }
SeqLabC {SpeedC} GetGearRange EOL
ELSE
SeqLabC {SpeedC} EOL
END
IF NOT CoolOff? AND LAST CoolOff?
SeqLabC CoolOn EOL
END
END
DoPostScript
RETURN
FormatArc:
IF ArcCW?
CWArcC
ELSE
CCWArcC
END
MoveXC MoveZC
IF ArcIJFormat?
ArcIJC
ELSE
ArcRC
END
RETURN
CkCRC: { 4.2 }
IF XMove? OR ZMove? { Approach Length Feature and Multiple Pockets }
IF NOT LastFeat?
CRCOnC
END
END
RETURN
ToolPath:
EACHFeat
GetToolTip
IF LastFeat?
IF Drilling?
IF Tap?
SeqLabC SpinOff EOL
SeqLabC ' G4 P2000' EOL
SeqLabC Speed InverseSpinOn EOL
ELSE
IF Dwell?
SeqLabC ' G4 P' Dwell# EOL
END
END
END
END
IF PointFeat?
SeqLabC MoveSXYC EOL
ELSE
IF RapidFeat?
SeqLabC RapidC MoveXC MoveZC EOL
ELSE
IF LineFeat?
SeqLabC CkCRC FeedC MoveXC MoveZC FeedRateC EOL
IF LastFeat?
SeqLabC CRCOffC EOL
END
ELSE
IF ArcFeat?
EACHQuadrant { Do not use NOT, LAST, FIRST or NEXT modifiers in this loop }
SeqLabC FormatArc FeedRateC EOL
NEXTQuadrant
ELSE
IF ThreadFeat?
SeqLabC ' G33' MoveXC MoveZC ThrdLead EOL
Rapid
END
END
END
END
END
NEXTFeat
RETURN
CheckRapid:
CRCOffC
IF EmptyLine?
Rapid
ELSE
SeqLabC EOL
END
RETURN
{Start of executable Prog **************************************************}
{setup and initializations}
InitProg
TagInit
SetAbs
PosSideLathe
StandardXZArcs
SetMaxRPM('10000')
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: must be all capital letters when typed in.' 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
END
EachOp {Start of post processing *********************}
GetLCycle
IF FirstOperation?
'$' ProgramName$ '.MIN' EOL
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 ABSOLUTE INCHES )' EOL
END
END
RestoreScale
OpenSub
StockOff {.71.2}
SetHome
SeqLab ' G0 X15. Z7.' EOL
SeqLabC ' M25' EOL
SeqLabC ' M1' EOL
DoPostScript
Plane
SetGearRangeFlag
' ' EOL
IF ConstantSurfaceFeed?
SeqLab Rapid CSSOff ' G97' CalcRPM1
ELSE
SeqLab Rapid CSSOff ' G97' Speed
END
GetGearRange SpinOn CoolOn EOL
DoOpComments
Approach
ELSE
IF NewTool?
{Finish off last Operation}
StockOff {.62}
CheckRapid
IF LAST ApproachOD?
SeqLabC LAST OpExitXCPC EOL
ELSE
IF LAST ApproachID?
SeqLabC LAST XOpECDC EOL
END
END
SeqLabC LAST OpExitZCPC EOL
DoEndOpPS
IF LAST ConstantSurfaceFeed?
SeqLabC CSSOff ' G97' CalcRPM2 EOL
END
SeqLabC NewHome LOfstOff '00' EOL
IF LAST ProgStop?
SeqLabC 'M0' EOL
ELSE
SeqLabC ProgStop EOL
END
{Start new Operation}
' ' EOL
DoPostScript
SetNewGearFlag
SetGearRangeFlag
IF ConstantSurfaceFeed?
SeqLab Rapid CSSOff ' G97' CalcRPM1
ELSE
SeqLab Rapid CSSOff ' G97' Speed
END
GetGearRange SpinOn CoolOn EOL
DoOpComments
Approach
ELSE
IF SameTool? {.62}
{Start new Operation}
StockOff
SetNewGearFlag
SetGearRangeFlag
DoOpComments
IF LAST StraightConnect?
CheckOffset
CheckRapid
SeqLabC StockOnNoCan XSPC ZSPC EOL
ELSE
CheckRapid
IF ApproachOD?
IF LAST ApproachOD?
SeqLabC LAST XOpECDC EOL
ELSE {around}
IF LAST ApproachID?
SeqLabC LAST XOpECDC EOL
END
SeqLabC LAST OpExitZCPC EOL
SeqLabC LAST OpExitXCPC EOL
END
ELSE
IF ApproachID?
IF LAST ApproachID?
SeqLabC LAST XOpECDC EOL
ELSE
IF LAST ApproachOD? {around}
SeqLabC LAST OpExitXCPC EOL
END
SeqLabC LAST OpExitZCPC EOL
SeqLabC XOpCDC EOL
END
ELSE {ApproachFace}
IF LAST ApproachFace?
SeqLabC LAST ZOpECPC EOL
ELSE
IF LAST ApproachOD? {around}
SeqLabC LAST OpExitXCPC EOL
ELSE {LAST ApproachID}
SeqLabC LAST XOpECDC EOL
END
SeqLabC LAST OpExitZCPC EOL
END
END
END
CheckOffset
ApproachSP
END
END
END
END {common point for all operations}
IF CannedCycle?
StockOff
IF Roughing?
IF NOT RoughSimple?
TagInc
SetPass2
IF RoughContour?
SeqLabC ' G85 Nł' Tag#
IF ApproachFace?
' D' ZCutDepth#
ELSE
' D' XCutDepth#
END
FeedRate XStkLeft ZStkLeft EOL
'>' Tag# EOL
IF ApproachFace?
SeqLab ' G82' EOL
ELSE
SeqLab ' G81' EOL
END
ELSE
IF RoughPatternShift?
SeqLabC ' G86 Nł' Tag#
IF ApproachFace?
' D' ZCutDepth#
ELSE
' D' XCutDepth#
END
FeedRate XStkLeft ZStkLeft EOL
'>' Tag# EOL
IF ApproachFace?
SeqLab ' G82' EOL
ELSE
SeqLab ' G81' EOL
END
END
END
IF CutterRadiusCompensation?
DoCRCOnCannedRough
ELSE
SeqLabC StepMove StrtPos EOL
END
ToolPath
SeqLabC ' G80' EOL
IF AutoFinish?
SeqLabC ' G87 Nł' Tag# EOL
END
SetPass1
TrackXNO# CycleStartX#
TrackZNO# CycleStartZ#
END
ELSE
IF Threading?
{ G72 Face Threads modification would require changes to XTapAtZ command with W Address }
SeqLabC ' G71' XatFinZ FinZ XTapAtZ
IF SingleEdgeCut?
ToolAngle
ELSE
' B0'
END
CutDepth ThrdHeight ThrdLead ' M32'
IF ConstantVolumeCut?
' M73'
ELSE
' M74'
END
IF Chamfer?
' M23'
ELSE
' M22'
END
EOL
IF AutoFinish?
SeqLabC ' G33' XatFinZ FinZ XTapAtZ ThrdLead EOL
SeqLabC Rapid XCSP EOL
SeqLabC ZCSP EOL
END
ELSE
IF Drilling?
SeqLabC
IF Tap? AND NOT CWSpindle?
' G78'
ELSE
LCycle
END
XCSP ZDepth
IF PeckFullRetract? { they use this format for a peck mid-retract cycle }
Peck
IF Equal? Retract# NUM#('0')
' DA0'
ELSE
' DA=' Retract#
END
' L' Peck#
ELSE
IF PeckChipBreaker?
Peck ' DA=.02' ' L' Retract#
END
END
FeedRate Dwell EOL
END
END
END
ELSE
StockOn
SetPass1
ToolPath
IF AutoFinish? { .82.1c }
StockOff
IF Turning?
IF ApproachFace?
SeqLabC RapidC ZOpECPC EOL
ELSE
SeqLabC RapidC XOpECDC EOL
END
ApproachSP
SeqLabC StockOff StrtPosC EOL
ToolPath
ELSE
IF Roughing? AND NOT RoughSimple?
SetPass2
SeqLabC RapidC XSPC ZSPC EOL
SeqLabC StockOff StrtPosC EOL
ToolPath
SetPass1
ELSE
IF Threading?
SeqLabC ' X' MUL# Num#('2') ADD# FinishXRadius# Taper# EOL
SeqLabC ' G33'
IF Taper?
XatFinZ
END
FinZ ThrdLead EOL
SeqLabC Rapid XSP EOL
SeqLabC ZSP EOL
END
END
END
END
IF Drilling? AND Tap?
SeqLabC SpinOff EOL
SeqLabC ' G4 P2000' EOL
SeqLabC Speed SpinOn EOL
END
END
NextOp {loops back to EachOP until last Operation}
{End of program ************************************************************}
{finish last operation}
StockOff
CRCOffC Rapid
IF ApproachOD?
SeqLabC OpExitXCPC EOL
ELSE
IF ApproachID?
SeqLabC XOpECDC EOL
END
END
SeqLabC OpExitZCPC EOL
DoEndOpPS
SeqLabC CoolOff EOL
IF ConstantSurfaceFeed?
SeqLabC CSSOff ' G97 S' CalcEPRPM# EOL
END
SeqLabC FirstHome OpToolID '00' EOL
IF LAST ProgStop?
SeqLabC 'M0' EOL
END
SeqLabC ' M24' EOL
SeqLabC EOP EOL
Post
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:
Okuma OSP 5020L [PB] L604 85 1Seiki Multi [IM] L435 85 1mOkuma OSP 5000 [NC] L606 85 1Okuma OSP 5020 [TPM] L572 85Seiki Multi [IM] L435 85 1Yasnac LX1 MS [IM] L436 85 1Okuma OSP 5020L [CP] L787 85Okuma OSP 7000L [JDHW] L707 85 1mOkuma OSP 3000 LC20 L049 85Okuma 5000 LB15 (CE) L171 82 1Cin Acr 850 TC [IM] L289 85Okuma OSP 5020L [WMC] L676 85 3Okuma OSP 5500 Cadet L331 85Okuma OSP 5020L [GCS] L540 85więcej podobnych podstron