{10/20/89 Copied & modified: Heidenhain TNC 145C M082.53 For: Micro Metalsmiths Suppresssed all "M" codes except 2,3,5,25 & 99. Updated Processor PostScript commented out & SepSubs omitted. Jim Radcliffe}
{7/24/90, Added InitProg globally to posts with this remark, DWB}
{9/29/93 Modified: Heidenhain 145C (MM) M260.62 For: Gibbs & Associates Updated to .81.2 format per Fanuc 6M M001.81.2 Jim Radcliffe}
{12/3/93 Modified: Heidenhain 145C (MM) M260.81.2 To: Heidenhain 145C (MM) M260.81.3 Fixed the RestoreScale function to work with both english and metric parts. Also removed unneeded setscale commands and replaced them with math ( number ) commands. [cwh]}
{Prog Numeric Format Definitions *******************************************}
RestoreScale: IF Metric? {CAM file is in Metric, tools and tool path} SetScale('.03937007874') { change to English, this is an English post} ELSE SetScale('1') END RETURN
DoSubComment: IF UseComments? AND SubComment? '( 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 RestoreScale END RETURN
PSInit: {reset flags} NewWFOF RotateF 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
OpenMP: IF WorkFixtureOffsets? '( NOTE: This post processor does not support work fixture offsets!!! )' EOL ELSE NewProg SeqLab ' CALL LBL ' Program# ' REP' Parts# ' / ' Parts# EOL StartSub END RETURN
CheckMove: IF AutoCycle? {implies incremental} IF ArcFeat? ' IX' EPX# ' IY' EPY# ELSE IF XMove? ' IX' EPX# END IF YMove? ' IY' EPY# END END IF ZMove? ' IZ' EPZ# END ELSE IF RapidFeat? MoveXYZC ELSE MoveX MoveY MoveZC END END ' ' IF NOT ArcFeat? ' ' END RETURN
FormatArc: IF AutoCycle? {implies incremental} SeqLab ' CC IX' ArcI# ' IY' ArcJ# EOL ELSE SeqLab ' CC ' ArcIJ EOL END SeqLab ' C ' CheckMove IF ArcCW? 'DR-' ELSE 'DR+' END CRC RETURN
StdLine: {enables CRC on first call, .70} IF Decelerate? IF RoomToDecel? DecelMove1 SeqLab DoL CheckMove CRC FeedRate ' ' EOL DecelMove2 END SeqLab DoL CheckMove CRC DecelFeed ' ' EOL ELSE IF XMove? OR YMove? OR ZMove? SeqLab DoL CheckMove CRC FeedRate ' ' EOL END END RETURN
ToolPath: EACHFeat IF PointFeat? Rapid {no output} IF AutoCycle? IF NOT FirstFeat? SeqLab DoL MoveSXYC Do25Spaces NoCRC RapidF ' ' EOL END SeqLab ' CALL LBL ' Program# ' REP' EOL CalcACSRXY {calc tool position after sub call, CalcAutoCycleStatusRecordXY} ELSE Rapid {no output} SeqLab DoL MoveSXYC Do25Spaces NoCRC RapidF ' M99' EOL END ELSE IF RapidFeat? Rapid {no output} IF LastFeat? AND AutoCycle? {.70} SeqLab DoL CheckMove NoCRC RapidF ' ' EOL ELSE IF XMove? OR YMove? OR ZMove? SeqLab DoL CheckMove CRC RapidF ' ' EOL END END ELSE IF LineFeat? Feed {no output} IF AutoCycle? {.70} IF LastFeat? SeqLab DoL CheckMove NoCRC FeedRate ' ' EOL ELSE IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps} SeqLab DoL CheckMove NoCRC FeedRate ' ' EOL ELSE StdLine {enables CRC on first call} END END ELSE StdLine END ELSE IF ArcFeat? EACHQuadrant IF LastQuadrant? AND Decelerate? IF RoomToDecel? DecelMove1 FormatArc ArcFeed EOL DecelMove2 END FormatArc DecelFeed EOL ELSE FormatArc ArcFeed EOL END NEXTQuadrant END END END END NEXTFeat RETURN
ZonlyRepAutoCycle: AutoCycPat {write pattern moves and main calls} StartSub NewProg EachCycle IF FeedConnect? Feed {no output} SeqLab Do6Spaces ZInPlusInc Do34Spaces NoCRC FeedEnt ' ' EOL ELSE {we have an entry/exit connect} IF FeedEntry? IF NOT FirstCycle? Rapid {no output} SeqLab Do6Spaces ZCP2PlusIncC Do34Spaces NoCRC RapidF ' ' EOL END Feed {no output} SeqLab Do6Spaces ZInPlusInc Do34Spaces NoCRC FeedEnt ' ' EOL ELSE Rapid {no output} SeqLab Do6Spaces ZInPlusInc Do34Spaces NoCRC RapidF ' ' EOL END END IF FirstCycle? SetStatusOff {protect Z position for incremental sub} END SeqLab ' CALL LBL ' Program# ' REP' EOL NextCycle SetStatusOn AutoCycCutSub1 {build element sub} AutoCycCutSub2 IF FeedConnect? {there is no Z up in the sub, .69} IF FIFO? {.81} Feed SeqLab Do6Spaces ZCP2 Do34Spaces NoCRC FeedEntC ' ' EOL ELSE Rapid {no output} SeqLab Do6Spaces ZCP2 Do34Spaces NoCRC RapidF ' ' EOL END END SeqLab ' LBL 0' EOL CloseSub {Element shift, not pattern} RETURN
ZonlyRep: EachCycle IF NOT FirstCycle? SeqLab DoL StrtPos Do25Spaces NoCRC IF FeedConnect? FeedRate ' ' EOL ELSE RapidF ' ' EOL END END IF FeedConnect? FeedC {no output} SeqLab DoL ZInPlusInc Do34Spaces NoCRC FeedEnt ' ' EOL ELSE {we have an entry/exit connect} IF FeedEntry? IF NOT FirstCycle? RapidC {no output} SeqLab DoL ZCP2PlusIncC Do34Spaces NoCRC RapidF ' ' EOL END Feed {no output} SeqLab DoL ZInPlusInc Do34Spaces NoCRC FeedEnt ' ' EOL ELSE RapidC {no output} SeqLab DoL ZInPlusInc Do34Spaces NoCRC RapidF ' ' EOL END END SeqLab ' CALL LBL ' Program# ' REP' EOL NextCycle StartSub SkipZ ToolPath UnSkipZ FinishSub1 SeqLab ' LBL 0' EOL CloseSub RETURN
CheckPass: IF AutoCycle? {use the correct StrtPos} SetPass2 ELSE SetPass1 END RETURN
{Start of executable Prog **************************************************}
{setup and initializations} InitProg ReverseXZArcs UseSeparateSubCalls SetMaxSeparateSubCalls('50') {?} SetMaxRPM('10000') {?} SetMaxFeed('2500') {?} 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? ' '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 END IF NewTool? OR FirstOperation? SeqLab ' TOOL DEF ' Tool# Do6Spaces 'L+0.0000' Do25Spaces 'R+0.0000' EOL END NextOp
EachOp IF FirstOperation? IF NOT Metric? {do nothing, CAM is English} SetScale('1') ELSE SetScale('.03937007874') {convert metric CAM to English} END IF MultipleParts? AND AllToolsOnePart? OpenMP END Plane {no output} Rapid {no output} AbsOrInc {no output} SeqLab ' LBL 1' EOL SeqLab ' TOOL CALL 0 Z S 0.000' EOL SeqLab Do6Spaces ZCP1 Do34Spaces NoCRC RapidF ' ' EOL IF ToolChangeAtHome? SeqLab DoL Home Do25Spaces NoCRC RapidF ' ' EOL END SeqLab ' LBL 0' EOL DoOpComments DoPostScript ToolChng {no output} SeqLab ' TOOL CALL ' Tool# ' Z S 1.000' EOL IF MultipleParts? AND OneToolAllParts? OpenMP END CheckPass SeqLab DoL StrtPos Do25Spaces NoCRC RapidF SpinOn EOL ELSE IF NewTool? IF MultipleParts? AND OneToolAllParts? CloseMP END DoEndOpPS Rapid {no output} Plane {no output} SeqLab ' CALL LBL 1 REP' EOL IF LAST ProgStop? SeqLab ' STOP M02' EOL END
{Start new Operation}
DoOpComments DoPostScript ToolChng {no output} SeqLab ' TOOL CALL ' Tool# ' Z S 1.000' EOL IF MultipleParts? AND OneToolAllParts? OpenMP END CheckPass SeqLab DoL StrtPos Do25Spaces NoCRC RapidF SpinOn EOL ELSE IF SameTool? DoEndOpPS IF LAST ProgStop? SeqLab ' STOP M02' EOL END
{Start new Operation}
DoOpComments DoPostScript Rapid {no output} Plane {no output} CheckPass SeqLab DoL StrtPos Do25Spaces NoCRC RapidF ' ' EOL END END END IF Milling? SeqLab Do6Spaces ZCP2 Do34Spaces NoCRC RapidF ' ' 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? 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? SeqLab Do6Spaces Feed ZCP3 Do34Spaces NoCRC RapidF ' ' EOL ELSE IF FIFO? {.81} SeqLab Do6Spaces Feed ZCP3 Do34Spaces NoCRC FeedEnt ' ' EOL ELSE SeqLab Do6Spaces Feed ZCP3 Do34Spaces NoCRC RapidF ' ' EOL END END ELSE IF Drilling? IF Repeats? NewProg StdSub SeqLab DoL StrtPos Do25Spaces NoCRC RapidF ' ' EOL END SeqLab Do6Spaces DrillCP Do34Spaces NoCRC RapidF ' ' EOL IF Tap? SeqLab ' CYCL DEF 2.0 TAPPING'EOL SeqLab ' CYCL DEF 2.1 SETUP 'ClearancePlane2# EOL SeqLab ' CYCL DEF 2.2 DEPTH 'ZDepth# EOL SeqLab ' CYCL DEF 2.3 DWELL 0'EOL SeqLab ' CYCL DEF 2.4 F'FeedEntry# EOL ELSE SeqLab ' CYCL DEF 1.0 PECKING'EOL SeqLab ' CYCL DEF 1.1 SETUP 'ClearancePlane2# EOL SeqLab ' CYCL DEF 1.2 DEPTH 'ZDepth# EOL SeqLab ' CYCL DEF 1.3 PECKG ' IF Peck? Peck# EOL ELSE IncValue ZDepth# EOL AbsOrInc END SeqLab ' CYCL DEF 1.4 DWELL ' IF Dwell? Dwell# EOL ELSE '0'EOL END SeqLab ' CYCL DEF 1.5 F'FeedEntry# EOL END ToolPath IF Repeats? FinishSubG92 END Rapid {no output} SeqLab Do6Spaces ZCP3 Do34Spaces NoCRC RapidF ' ' EOL END END NEXTOp IF MultipleParts? AND OneToolAllParts? CloseMP END Rapid {no output} DoEndOpPS SeqLab ' TOOL CALL 0 Z S0.000' EOL SeqLab Do6Spaces ZCP1 Do34Spaces NoCRC RapidF ' ' EOL IF FIRST ToolChangeAtHome? SeqLab DoL FirstHome Do25Spaces NoCRC RapidF ' M05' EOL END IF ProgStop? SeqLab ' STOP M02' EOL END IF MultipleParts? AND AllToolsOnePart? CloseMP END SeqLab ' STOP M02' EOL Post Close Retag IF UseComments? SetScale('1') 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