Citizen F Ser [REN] L598 85 3m


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

{5/27/97,
Initial: Cincom L16 Citizen L064.82
Created: Citizen F Ser [REN] Lxxx.85m
For: Renishaw
Changes too numerous to list, this post is customized for use with a dual turret lathe, MPK}

{8/6/97,
Initial: Citizen F Ser [REN] L598.85m
Created: Citizen F Ser [REN] L598.85.1m
For: Renishaw
changed the initializeTurret sub to output every tool,
changed all erroneous SeqLabCs to SeqCs,
moved output of ToolOffset to AppMove sub,
changed all dwells to output in 'G4X' format instead of 'G4P' format,
changed PeckFullOut to only dwell before final retract,
Removed SetTCZ from initializeTurret, added it to program inits,
added logic to output G50s with the vales entered in the TurretShift TE
boxes when they are nonzero at the beginning of a tool and the additive inverse
at the end,
modified the clearance moved in NewTool and the end of program to not
output the Z clearance plane after an OD op because of the inherent movment
restrictions of screw machines,
Forced output of Rapid on lines following G50 blocks,
added format 7 to invert the sign of the Z stock size in start up blocks,
added the ability to output code for customer's standard eject procedure
when OptCyc1? is true,
MPK}

{9/25/97
Initial: Citizen F Ser [REN] L598.85.1m
Created: Citizen F Ser [REN] L598.85.2m
Made output of Feed and FeedRate in ApproachSP conditional upon ZSPC (Face) or XSPC (ID/OD) outputting. This
is to avoid the Feed and FeedRate outputting on a line without a move.
Heavily modified the offsetting of boring bars,
Reversed G41 and G42 for CRC in form,
made SetAddTools conditional upon Drilling? being true,
MPK
}

{10/17/97
Initial: Citizen F Ser [REN] L598.85.2m
Created: Citizen F Ser [REN] L598.85.3m
added OptCyc1 to PSInit,
modified doEjectProcedure per customer request,
added OptCyc1F to PSInit,
changed SetTCZ in prog inits to 110,
added 10 more calls to getNextOpsTool in getNextTool,
Changed FirstOp and NewTool to force a G0 before befor doEjectProcedure is called,
MPK
}
{Prog Numeric Format Definitions *******************************************}

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

FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(FirstMoveEPX#,2)
FORMAT(Dwell#,2)
FORMAT(SUB#,2)
FORMAT(MUL#,2)
FORMAT(TCZ#,2)
FORMAT(TrackX#,2)
FORMAT(TrackZ#,2)
FORMAT(FeedTapIPR#,2)
FORMAT(TurretX#,2)
FORMAT(TurretZ#,2)
FORMAT(Operation#,3)
FORMAT(Tool#,3)
FORMAT(Program#,4)
FORMAT(Recall#,5)
FORMAT(ToolOffset#,6)
FORMAT(ZStockMin#,7)

{SPECIAL DUAL TURRET SUBS *************************}

saveToolNums:
SAVE# Num#('50') Num#('0')
EachOp
IF LessThan? Operation# Num#('40')
SAVE# Num#('50') ADD# Recall# Num#('50') Num#('1') {increment operation counter by one}
IF Equal? Operation# Recall# Num#('50')
Save# Operation# Tool#
END
ELSE
'**** ERROR - MAXIMUM OPERATION NUMBER HAS BEEN EXCEEDED ****' EOL
'********** OPERATION NUMBER SHOULD NOT EXCEED 40 ***********' EOL
END
NextOp
RETURN

setCurrentTurret: {Determines which turret the current tool is on}
IF Flag?('2') {This boolean saves the info on which turret was in use during the previous op}
SetFlag('3')
ELSE
SetFlagF('3')
END
IF GreaterThan? Tool# Num#('10') AND LessThan? Tool# Num#('16')
SetFlag('2')
ELSE
IF GreaterThan? Tool# Num#('30') AND LessThan? Tool# Num#('36')
SetFlag('2')
ELSE
SetFlagF('2')
END
END
RETURN

checkNextOpsTool:
Save# Num#('49') ADD# Recall# Num#('49') Num#('1')
IF NOT Flag?('1')
IF NOT GreaterThan? ADD# Operation# Recall# Num#('49') Recall# Num#('50') {Check x Operations ahead if operation exists}
IF Flag?('2') {currently using turret 1}
IF GreaterThan? Recall# ADD# Operation# Recall# Num#('49') Num#('20') AND LessThan? Recall# ADD# Operation# Recall# Num#('49') Num#('26')
'T' Recall# ADD# Operation# Recall# Num#('49')
SetFlag('1') {Found next tool for turret 2}
ELSE
IF GreaterThan? Recall# ADD# Operation# Recall# Num#('49') Num#('40') AND LessThan? Recall# ADD# Operation# Recall# Num#('49') Num#('46')
'T' Recall# ADD# Operation# Recall# Num#('49')
SetFlag('1') {Found next tool for turret 2}
END
END
ELSE {currently using turret 2}
IF GreaterThan? Recall# ADD# Operation# Recall# Num#('49') Num#('10') AND LessThan? Recall# ADD# Operation# Recall# Num#('49') Num#('16')
'T' Recall# ADD# Operation# Recall# Num#('49')
SetFlag('1') {Found next tool for turret 1}
ELSE
IF GreaterThan? Recall# ADD# Operation# Recall# Num#('49') Num#('30') AND LessThan? Recall# ADD# Operation# Recall# Num#('49') Num#('36')
'T' Recall# ADD# Operation# Recall# Num#('49')
SetFlag('1') {Found next tool for turret 1}
END
END
END
END
END
RETURN

getNextTool: {This sub looks up to 10 operations ahead to find what the next tool used in the other turret is. It assumes that
the user has not left any blank spaces between ops in the operation list, if they have, an error may result.}

SetFlagF('1') {Haven't found next tool in other turret}
Save# Num#('49') Num#('0') {Initialize variable that stores the how many operations ahead we are currently looking}

checkNextOpsTool checkNextOpsTool checkNextOpsTool checkNextOpsTool checkNextOpsTool
checkNextOpsTool checkNextOpsTool checkNextOpsTool checkNextOpsTool checkNextOpsTool
checkNextOpsTool checkNextOpsTool checkNextOpsTool checkNextOpsTool checkNextOpsTool
checkNextOpsTool checkNextOpsTool checkNextOpsTool checkNextOpsTool checkNextOpsTool

RETURN

getFirstTools:
IF Flag?('2') {If first op's tool is in turret 1}
SeqC OpToolID EOL {output turret 1's first tool}
SeqC getNextTool EOL {output turret 2's first tool}
ELSE {If first op's tool is in turret 2}
SeqC getNextTool EOL {output turret 1's first tool}
SeqC OpToolID EOL {output turret 2's first tool}
END
RETURN

opSequenceNum:
FORMAT(Recall#, 3)
'N' Recall# Num#('48')
IF ToolComment?
'( ' ToolComment$ ' )' EOL
END
FORMAT(Recall#, 5)
Save# Num#('48') ADD# Recall# Num#('48') Num#('1')
RETURN

initializeTurret:
IF Flag?('2') {Turret 1 for current ops tool}
'G69G99' {Initiate Turret 1}
ELSE
'G68G99' {Initiate Turret 2}
END
RETURN

doEjectProcedure:
IF OptCyc1?
SeqC 'X-20.0Z-3.0' EOL
SeqC 'G4X0.5' EOL
SeqC Rapid 'Y63.0' EOL
SeqC 'M34' EOL
SeqC Rapid 'X' TrackY# Num#('0')EOL
SeqC 'M22' EOL
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

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# ': ' ToolSize$ ' ' ToolType$ ' )' EOL
END
restoreScale
END
RETURN

psInit: {reset flags from last Op, .70}
OptCyc1F
RETURN

psStuff:
RETURN

doPostScript:
psInit
EachPS
SeqC PostScript EOL {literals}
psStuff {commands}
NextPS
RETURN

doEndOpPS:
psInit
EachEOPS
SeqC EndOpPS EOL {literals}
psStuff {commands}
NextPS
RETURN

stockOnNoCan:
IF NOT CannedCycle?
StockOn {need stock for SP positioning, if not a canned cycle}
END
RETURN

ApproachSP:
IF ApproachFace?
SeqC stockOnNoCan XSPC EOL
SeqC StockOff ZOpCPC EOL
stockOnNoCan
IF NOT Equal? ZOpCP# CycleStartZ#
SeqC Feed ZSPC FeedRate EOL
END
ELSE { ODApproach/IDApproach }
SeqC stockOnNoCan ZSPC EOL
SeqC StockOff XOpCDC EOL
stockOnNoCan
IF NOT Equal? XOpCD# CycleStartX#
SeqC Feed XSPC FeedRate EOL
END
END
RETURN

appMove:
IF Flag?('5') AND ApproachID?
ELSE
ThisOpEntryZCP 'T' ToolOffset#
END
RETURN

approach: { NOT FOR TAILSTOCK, .82 }
IF ApproachOD?
SeqC ThisOpEntryXCP appMove EOL
ELSE
IF ApproachID?
SeqC XOpCD appMove EOL
ELSE {ApproachFace}
SeqC stockOnNoCan XSP appMove EOL
END
END
approachSP
RETURN

checkOffset:
doEndOpPS
IF LAST ProgStop?
SeqC 'M0' EOL
END
IF NewToolOffset?
END
SeqC SpeedC EOL
IF LAST ProgStop?
SeqC SpinOn EOL
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
IF LastFeat? AND EmptyLine? { Exit Length Feature }
CRCOffC
END
RETURN

toolPath:
EACHFeat
GetToolTip
IF LastFeat?
IF Drilling?
IF Tap?
{SeqC SpinOff EOL
SeqC 'G4X2.0' EOL}
SeqC Rapid 'W-1.5' InverseSpinOn EOL
ELSE
IF Dwell?
SeqC 'G4X' Dwell# EOL
END
END
END
END
IF PointFeat?
SeqC MoveSXYC EOL
ELSE
IF RapidFeat?
SeqC RapidC MoveXC MoveZC EOL
ELSE
IF LineFeat?
IF Tap?
IF NOT LastFeat?
SeqC 'G32' MoveZC FeedrateC EOL
ELSE
SeqC 'G32' MoveZC 'F' FeedTapIPR#('1') EOL
SeqC 'G4X1.0' EOL
END
ELSE
SeqC ckCRC FeedC MoveXC MoveZC FeedRateC EOL
END
ELSE
IF ArcFeat?
EACHQuadrant { Do not use NOT, LAST, FIRST or NEXT modifiers in this loop }
SeqC formatArc FeedRateC EOL
NEXTQuadrant
ELSE
IF ThreadFeat?
SeqC 'G32' MoveXC MoveZC ThrdLead EOL
Rapid
END
END
END
END
END
NEXTFeat
RETURN

checkRapid:
CRCOffC
IF LAST CannedCycle?
Rapid
ELSE
RapidC
END
RETURN

SpringPass:
FORMAT(Recall#,2)
IF GreaterThan? Recall# NUM#('9') NUM#('0')
SeqC 'X' Recall# NUM#('10') EOL
END
Save# NUM#('9') SUB# Recall# NUM#('9') NUM#('1') {counter}
FORMAT(Recall#,5)
RETURN

DoThreadSpringPass:
Save# NUM#('9') SpringPasses#
SpringPass SpringPass SpringPass SpringPass SpringPass
RETURN

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

{setup and initializations}
InitProg
ReverseXZArcs
PosSideLathe
NegateZ
SetMaxRPM('10000')
SetMaxFeed('500')
SetAddTools
SetTCZ('110')

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: ' EOL
' SetTCZ(n) - will change the default X toolchage position' EOL
' for all following operations to the user specified value (n).' EOL
' OptCyc1 - will cause the eject procedure to be output at the beginning of' EOL
' the operation. ' EOL
END

Save# Num#('48') Num#('1')
saveToolNums

EachOp {Start of post processing *********************}
GetLCycle
IF FirstOperation?
':' Program# EOL
IF UseComments? AND ProgramNameComment?
'( ' 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$ ' MM )' EOL
END
END
RestoreScale
OpenSub
StockOff {.71.2}
SetHome

'M48' EOL
' ' EOL
'/#3000=99(CHECK BARFEED)' EOL
'M49' EOL
doPostScript
Plane
SeqC 'G68G99' CoolOff EOL
SeqC CoolOn EOL
SeqC 'M52' EOL
SeqC 'G28U0W0V0' EOL
SeqC Rapid 'W' ZStockMin# EOL
SeqC Preset 'X-3.0Z-0.2Y0' EOL
SeqC Preset 'W17.5' EOL
SeqC ToolChng EOL
setCurrentTurret
getFirstTools
SeqC Speed SpinOn EOL

' ' EOL
opSequenceNum
doOpComments
initializeTurret EOL
IF ApproachID?
IF NOT Equal? PRIME TurretX# Num#('0')
SeqC Rapid 'X' MUL# Num#('2') ToolOffsetXRadius# ThisOpEntryZCP 'T' ToolOffset# EOL
SeqC 'G50X' PRIME TurretX# EOL
SetFlag('5')
ELSE
SetFlagF('5')
END
ELSE
IF NOT Equal? PRIME TurretX# Num#('0')
SeqC 'G50U' PRIME TurretX# 'W' PRIME TurretZ# EOL
SetFlag('5')
ELSE
IF NOT Equal? PRIME TurretZ# Num#('0')
SeqC 'G50U' PRIME TurretX# 'W' PRIME TurretZ# EOL
SetFlag('5')
ELSE
SetFlagF('5')
END
END
END
Rapid
doEjectProcedure
IF Drilling?
SetAddTools
ELSE
SetAddToolsF
END
approach
ELSE
IF NewTool?

{Finish off last Operation}

StockOff {.62}
checkRapid
IF LAST ApproachOD?
SeqC LAST OpExitXCPC EOL
ELSE
IF LAST ApproachID?
SeqC LAST XOpECDC EOL
END
SeqC LAST OpExitZCPC EOL
END
IF LAST Tap?
SeqC SpinOn Speed EOL
END
doEndOpPS
setCurrentTurret
SeqC 'T00' EOL
IF Flag?('5')
IF LAST ApproachID?
FORMAT(Recall#,2)
SeqC Rapid 'X' Recall# Num#('41') EOL
FORMAT(Recall#,5)
SeqC Preset 'X' MUL# Num#('2') Recall# Num#('44') EOL
ELSE
SeqC 'G50U' MUL# Num#('-1') Recall# Num#('41') 'W' MUL# Num#('-1') Recall# Num#('42') EOL
END
END
IF Flag?('3') AND NOT Flag?('2') {If switching turrets}
SeqC getNextTool EOL
ELSE
IF NOT Flag?('3') AND Flag?('2') {If switching turrets}
SeqC getNextTool EOL
ELSE {If using same turret as last op}
SeqC Rapid 'X' TCZ# OpToolID 'B0' Speed EOL
END
END
IF LAST ProgStop?
SeqC 'M0' EOL
ELSE
SeqC ProgStop EOL
END
' ' EOL

{Start new Operation}

opSequenceNum
doOpComments
SeqC initializeTurret EOL
doPostScript
SeqC Speed SpinOn EOL
IF ApproachID?
IF NOT Equal? PRIME TurretX# Num#('0')
SeqC Rapid 'X' MUL# Num#('2') ToolOffsetXRadius# ThisOpEntryZCP 'T' ToolOffset# EOL
SeqC Preset 'X' PRIME TurretX# EOL
SetFlag('5')
ELSE
SetFlagF('5')
END
ELSE
IF NOT Equal? PRIME TurretX# Num#('0')
SeqC 'G50U' PRIME TurretX# 'W' PRIME TurretZ# EOL
SetFlag('5')
ELSE
IF NOT Equal? PRIME TurretZ# Num#('0')
SeqC 'G50U' PRIME TurretX# 'W' PRIME TurretZ# EOL
SetFlag('5')
ELSE
SetFlagF('5')
END
END
END
Rapid
doEjectProcedure
IF Drilling?
SetAddTools
ELSE
SetAddToolsF
END
approach
ELSE
IF SameTool?

{Start new Operation}

StockOff
doOpComments
IF LAST StraightConnect?
checkOffset
checkRapid
SeqC stockOnNoCan XSPC ZSPC EOL
ELSE
checkRapid
IF ApproachOD?
IF LAST ApproachOD?
SeqC LAST XOpECDC EOL
ELSE {around}
IF LAST ApproachID?
SeqC LAST XOpECDC EOL
END
SeqC LAST OpExitZCPC EOL
SeqC LAST OpExitXCPC EOL
END
ELSE
IF ApproachID?
IF LAST ApproachID?
SeqC LAST XOpECDC EOL
ELSE
IF LAST ApproachOD? {around}
SeqC LAST OpExitXCPC EOL
END
SeqC LAST OpExitZCPC EOL
SeqC XOpCDC EOL
END
ELSE {ApproachFace}
IF LAST ApproachFace?
SeqC LAST ZOpECPC EOL
ELSE
IF LAST ApproachOD? {around}
SeqC LAST OpExitXCPC EOL
ELSE {LAST ApproachID}
SeqC LAST XOpECDC EOL
END
SeqC LAST OpExitZCPC EOL
END
END
END
checkOffset
IF Drilling?
SetAddTools
ELSE
SetAddToolsF
END
approachSP
END
END
END
END {common point for all operations}
IF CannedCycle?
StockOff
IF Threading?
SetFlag('10')
'G92'
EachFeat
IF ThreadFeat?
SeqC MoveXC MoveZC
IF Flag?('10')
SetFlagF('10')
XTapAtZ ThrdLead
END
EOL
Save# Num#('10') EPX#
END
NextFeat
IF GreaterThan? SpringPasses# Num#('0')
DoThreadSpringPass
END
END
ELSE
StockOn
SetPass1
toolPath
IF AutoFinish?
IF NOT Drilling? AND NOT Grooving?
StockOff
IF Turning?
SetPass1
ELSE
SetPass2
END
SeqC RapidC StrtPos EOL
toolPath
END
END
END
IF Drilling? AND Tap?
{SeqC SpinOff EOL
SeqC 'G4X2.0' EOL
SeqC SpinOn Speed EOL}
END
Save# Num#('41')PRIME TurretX#
Save# Num#('42')PRIME TurretZ#
Save# Num#('43') TurretX#
Save# Num#('44') ToolOffsetXRadius#

NextOp {loops back to EachOP until last Operation}

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

{finish last operation}
StockOff
CRCOffC
IF CannedCycle?
Rapid
ELSE
RapidC
END
IF ApproachOD?
SeqC OpExitXCPC EOL
ELSE
IF ApproachID?
SeqC XOpECDC EOL
END
SeqC OpExitZCPC EOL
END
doEndOpPS
IF CutOff? AND Turning?
SeqC Feed 'X-3.0F0.02' EOL
SeqC SpinOff EOL
SeqC CoolOn EOL
SeqC 'M53' EOL
SeqC 'M56' EOL
END
SeqC 'G28U0W0V0T00' EOL
'N1000' EOP EOL
Post
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:
Fagor 810D [JBM] L594 85 3m
Fanuc 18T Ikegai REN L562 85 1m
85 (12)
Acr A2100 [VG] MT97 16 3m
Fanuc 10T HS [KMT] L759 85
Bridgeport EZPath WF L554 85 2
Fanuc 0T DP [TTT] L567 85
Cin Acr CNC TC [12] L273 85 1
Okuma OSP 5020L [PB] L604 85 1
Fanuc 15T Dianichi CGB L754 85 2
La respuesta planeada será un regalo a Bin Laden

więcej podobnych podstron