{Change Comments ***********************************************************} {6/14/95, Updated for Catalyst v2.20 per Fanuc 6M M001.85 Format, DWB} {7/18/95, Added IF NOT LastFeat? at CkCRC sub, DWB} {8/18/95, .85.01.01, Added format CallMasterNum#, changed 'P' to CallLabB, added OptCyc1F, JR} {8/19/95, .85.01.02, Modified CRC handling, set up for Virtual, not Gibbs System DogBone!, JR} {8/20/95 Initial: Fanuc 6M M001.85.01 Created: Fanuc 18GCA Weldon 1632 Mxxx.85 ForUser: Unitech Control: GE Fanuc 18GCA Machine: Weldon Grinder model 1632 Gold Develop: ComPost 4.21.32, ncCAD 4.33.01, ncCAM 4.33, ncPost 4.33.07 Comment: New Post Processor for a Grinder that grinds punches for a punch press. This grinder is more like a lathe than a mill. The tool is a grinding wheel, the part is mounted in a chuck, the grinding wheel moves in X and Z and the chuck rotates as axis C. The programs are written with conditional statements and variables to make program length manageable. Fanuc Lathe G Code Group B? Which system will he be using? Cannot use both due to specification of number of passes! Gibbs System would use repeats Virtual would use ???? Jim Radcliffe} {Prog Numeric Format Definitions *******************************************} #1 = '#.00' #2 = '###.###;0.' #3 = '*###.###;0.' #4 = '####.####;0.' #5 = '#######0' #6 = '####^##0' #7 = '##.#####;0' #8 = '####.###;0' FORMAT(FileFeet#,1) FORMAT(FileMeters#,1) FORMAT(ToolDiameter#,4) {.72} FORMAT(Program#,5) {.72} FORMAT(CallMasterNum#,5) FORMAT(Operation#,5) {.72} FORMAT(Tool#,5) {.72} FORMAT(NewWFO#,5) {.72} FORMAT(Parts#,5) {.72} FORMAT(Dwell#,6) {.72} FORMAT(TCZ#,7) FORMAT(SQRT#,7) FORMAT(ADD#,8) FORMAT(MUL#,8) {Special Command Subroutines ***********************************************} SetPolarOn: SeqC Rapid ' C0' EOL {rotate to zero degrees} SeqC ' G12.1' EOL {Set output to polar coordinates inches, assumes C0} SeqC StrtPos EOL {be sure we are at the right start position} RETURN SetPolarOff: SeqC ' G13.1' EOL {Set output to angle coordinates degrees, control keeps track of position} RETURN Hypot#: SQRT# ADD# MUL# Recall# NUM#('1') Recall# NUM#('1') MUL# Recall# NUM#('2') Recall# NUM#('2') RETURN Angle#: IF Equal? Hypot# NUM#('0') ADD# Num#('0') Num#('0') ELSE IF GTEqual? Recall# NUM#('2') NUM#('0') { Y?0 } ADD# Num#('0') MUL# Num#('57.29577951') ACOS# DIV# Recall# NUM#('1') Hypot# ELSE { Y<0 } Save# Num#('1') MUL# Recall# Num#('1') Num#('-1') ADD# Num#('180') MUL# Num#('57.29577951') ACOS# DIV# Recall# NUM#('1') Hypot# END END RETURN PolarPosition: ' X' Hypot# ' C' Angle# RETURN PolarHome: Save# NUM#('1') HomeX# Save# NUM#('2') HomeY# PolarPosition RETURN PolarFirstHome: Save# NUM#('1') FIRST HomeX# Save# NUM#('2') FIRST HomeY# PolarPosition RETURN PolarStrtPos: Save# NUM#('1') StartPosX# Save# NUM#('2') StartPosY# PolarPosition RETURN PolarMoveSXY: Save# NUM#('1') SPX# Save# NUM#('2') SPY# PolarPosition RETURN Var1#: SUB# MUL# NUM#('3') SUB# Operation# NUM#('1') NUM#('-100') RETURN Var2#: SUB# MUL# NUM#('3') SUB# Operation# NUM#('1') NUM#('-101') RETURN Var3#: SUB# MUL# NUM#('3') SUB# Operation# NUM#('1') NUM#('-102') RETURN DoStatement: SeqC ' WHILE [#' Var1# ' GT 0] DO ' Operation# EOL SeqC ' G10 P' CRCOffset# ' R#' Var3# EOL RETURN EndStatement: SeqC ' #' Var1# '=#' Var1# '-1' EOL SeqC ' END ' Operation# EOL RETURN {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 DoSubComment: IF UseComments? AND SubComment? '( SUB NUMBER: ' Program# ' )' END RETURN DoOpComments: IF UseComments? SetScale('1') IF OperationIDComment? SeqC '( OPERATION ' Operation# ': ' OperationType$ ' )' EOL END IF OperationComment? SeqC '( ' OperationComment$ ' )' EOL END IF WorkGroupComment? SeqC '( ' WorkGroupComment$ ' )' EOL END IF ToolTypeComment? SeqC '( TOOL ' Tool# ': ' ToolDiameter# ' ' ToolType$ ' )' EOL END IF ToolComment? SeqC '( ' ToolComment$ ' )' EOL END RestoreScale END RETURN PSInit: {reset flags} NewWFOF RotateF OptCyc1F MasterOpF CallMasterOpF RETURN PSStuff: {revised.72} IF FourthCW? FORMAT(FourthDegree#,2) SeqC ' A' FourthDegree# EOL FourthCWF {reset flag} END IF FourthCCW? FORMAT(FourthDegree#,3) SeqC ' A' FourthDegree# EOL FourthCCWF {reset flag} END IF FifthCW? FORMAT(FifthDegree#,2) SeqC ' B' FifthDegree# EOL FifthCWF {reset flag} END IF FifthCCW? FORMAT(FifthDegree#,3) SeqC ' B' FifthDegree# EOL FifthCCWF {reset flag} END RETURN DoPostScript: PSInit EachPS SeqC PostScript EOL {literals} PSStuff {commands} NextPS RETURN DoEndOpPS: PSInit EachEOPS SeqC EndOpPS EOL {literals} PSStuff {commands} NextPS RETURN EntryMove: IF FeedEntry? SeqC Feed ZIn FeedEnt EOL ELSE SeqC RapidC ZIn EOL END RETURN StartSub: OpenSub SubID DoSubComment EOL 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: SeqC SubCall CallLab RepLab RepCycs EOL StartSub RETURN FinishSub1: {part 1} SeqC CRCOffC IF NOT FeedConnect? IF AutoCycle? ZCP3C ELSE IF FIFO? {.81} FeedC ZCP3C FeedEntC ELSE RapidC ZCP3C END END END EOL RETURN FinishSubG92: {part 2} SeqC Preset ShiftRC EOL SeqC EndSub EOL CloseSub SeqC Preset UnshftRC EOL RETURN OpenMP: NewProg IF WorkFixtureOffsets? NewWFO EachWFO SeqC SetWFO EOL SeqC SubCall CallLab RepLab OnePart EOL IncWFO NextWFO ELSE SeqC SubCall CallLab RepLab Parts EOL END StartSub RETURN CloseMP: IF WorkFixtureOffsets? SeqC EndSub EOL CloseSub SeqC WFO1 EOL ELSE SeqC Preset ShiftPC EOL SeqC EndSub EOL CloseSub SeqC Preset UnshftPC EOL 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 MoveXYZC IF ArcIJFormat? ArcIJC ELSE ArcRC END RETURN ToolPath: ResetCRCNum EACHFeat IF PointFeat? IF AutoCycle? SeqC PolarMoveSXY EOL SeqC SubCall CallLab EOL CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY} ELSE SeqC DoDrillAbsOrInc PolarMoveSXY MoveSZC EOL {.80.01} END ELSE IF RapidFeat? IF LastFeat? SeqC DoAbsOrInc CRCOffC RapidC MoveXYZC EOL ELSE IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps} SeqC DoAbsOrInc RapidC MoveXYZC EOL ELSE IF XMove? OR YMove? OR ZMove? SeqC DoAbsOrInc CRCOnC RapidC MoveXYZC CRCOffsetC EOL END END END ELSE IF LineFeat? IF LastFeat? SeqC DoAbsOrInc CRCOffC FeedC MoveXYZC FeedRateC EOL ELSE IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps} SeqC DoAbsOrInc FeedC MoveXYZC FeedRateC EOL ELSE IF Decelerate? IF RoomToDecel? DecelMove1 SeqC DoAbsOrInc CRCOnC FeedC MoveXYZC FeedRateC CRCOffsetC EOL DecelMove2 END SeqC DoAbsOrInc CRCOnC FeedC MoveXYZC DecelFeed CRCOffsetC EOL ELSE IF XMove? OR YMove? OR ZMove? SeqC DoAbsOrInc CRCOnC FeedC MoveXYZC FeedRateC CRCOffsetC EOL END END 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 WFOStuff: IF NewWFO? IF MultipleParts? '*** WARNING *** DO NOT USE NEWWFO() WITH NCPOST MULTIPLE PARTS' ELSE ' G' NewWFO# END ELSE IF NOT SameTool? IF NeedWFO1? ' G' NewWFO# END END END RETURN AutoCycCutSub1: {part 1} SaveSubStatus {save tool position} SetPass1 {element cut moves} StartSub SetSRXYtoSP Seq IncValue EOL RETURN AutoCycCutSub2: {part 2} SetPolarOn ToolPath SetPolarOff SeqC AbsOrInc IF Repeats? AND FeedConnect? AND ZshiftOnly? {.69 removed RapidC} {.71.2 removed CRCOffC, gets turned off in ToolPath} ELSE IF FIFO? {.81} FeedC ZCP2 FeedEntC ELSE RapidC ZCP2 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 DoStatement SetPolarOn...
kmex