{7/24/90, Added InitProg globally to posts with this remark, DWB}
{6/17/92
Modified: BP Series 1 (R2E4) M128.62
Updated to Version 4.0 per Heidenhain 145C BP M215.79.
KLM}
{12/3/93
Modified: Heidenhain TNC 145C M082.79
To: Heidenhain TNC 145C M082.79.1
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]}
#1 = '0.00'
#2 = 'ą0.0000'
#3 = '###^0'
#4 = '###0.000'
#5 = '##0'
FORMAT(FileFeet#,1)
FORMAT(FileMeters#,1)
FORMAT(ToolDiameter#,2)
FORMAT(CycleStartZ#,2)
FORMAT(HomeX#,2)
FORMAT(HomeY#,2)
FORMAT(FeedEntry#,3)
FORMAT(ClearancePlane2#,2)
FORMAT(ClearancePlane1#,2)
FORMAT(FinishZ#,2)
FORMAT(Peck#,2)
FORMAT(Dwell#,4)
FORMAT(FeedContour#,3)
FORMAT(StartPosX#,2)
FORMAT(StartPosY#,2)
FORMAT(PartShiftX#,2)
FORMAT(PartShiftY#,2)
FORMAT(PartShiftZ#,2)
FORMAT(OriginUnShiftPX#,2)
FORMAT(OriginUnShiftPY#,2)
FORMAT(OriginUnShiftPZ#,2)
FORMAT(ArcI#,2)
FORMAT(ArcJ#,2)
FORMAT(EPX#,2)
FORMAT(EPY#,2)
FORMAT(EPZ#,2)
FORMAT(TLLength#,2)
FORMAT(TLDia#,2)
FORMAT(DIV#,2)
FORMAT(TLNum#,5)
DoSubComment:
IF UseComments? AND SubComment?
'( SUB NUMBER: 'Program# ')'EOL
END
RETURN
PSInit: {reset flags}
NewWFOF
RotateF
RETURN
PSStuff: {revised.72}
IF FourthCW?
FORMAT(FourthDegree#,2)
SeqLab 'A' FourthDegree# EOL
FourthCWF {reset flag}
END
IF FourthCCW?
FORMAT(FourthDegree#,3)
SeqLab 'A' FourthDegree# EOL
FourthCCWF {reset flag}
END
IF FifthCW?
FORMAT(FifthDegree#,2)
SeqLab 'B' FifthDegree# EOL
FifthCWF {reset flag}
END
IF FifthCCW?
FORMAT(FifthDegree#,3)
SeqLab 'B' FifthDegree# EOL
FifthCCWF {reset flag}
END
RETURN
DoPostScript:
PSInit
EachPS
SeqLab PostScript EOL {literals}
PSStuff {commands}
NextPS
RETURN
DoEndOpPS:
PSInit
EachEOPS
SeqLab EndOpPS EOL
PSStuff
NextPS
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
EntryMove:
IF FeedEntry?
Feed {no output}
SeqLab ' ' ZIn ' R0' FeedEnt ' M'EOL
ELSE
SeqLab ' ' ZIn ' R0 F2500 M' EOL
END
RETURN
StartSub:
OpenSub
DoSubComment
SeqLab ' LBL 'Program# 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:
SubWarning
SeqLab ' CALL LBL 'Program# ' REP 'Repeats# '/ 'Repeats# EOL
StartSub
SeqLab ' L ' StrtPos ' R0 F2500 M' EOL
RETURN
FinishSub1: {part 1}
UnSkipZ
IF NOT FeedConnect?
Feed {no output}
SeqLab ' ' ZCP3 ' R0 F2500 M'EOL
END
RETURN
FinishSubG92: {part 2}
SeqLab ' CYCL DEF 7.0 DATUM SHIFT'EOL
SeqLab ' CYCL DEF 7.1 IX'RepeatX# EOL
SeqLab ' CYCL DEF 7.2 IY'RepeatY# EOL
SeqLab ' CYCL DEF 7.3 IZ'RepeatZ# EOL
SeqLab ' LBL 0'EOL
CloseSub
SeqLab ' CYCL DEF 7.0 DATUM SHIFT'EOL
SeqLab ' CYCL DEF 7.1 IX'OriginUnShiftRX#('0') EOL
SeqLab ' CYCL DEF 7.2 IY'OriginUnShiftRY#('0') EOL
SeqLab ' CYCL DEF 7.3 IZ'OriginUnShiftRZ#('0') EOL
RETURN
OpenMP:
NewProg
SeqLab ' CALL LBL ' Program# ' REP' Parts# ' / ' Parts# EOL
OpenSub
DoSubComment
SeqLab ' LBL ' Program# EOL
SeqLab ' L X' StartPosX# ' Y' StartPosY# ' R0 F2500 M' EOL
RETURN
CloseMP:
SeqLab ' CYCL DEF 7.0 DATUM SHIFT' EOL
SeqLab ' CYCL DEF 7.1 IX' PartShiftX# EOL
SeqLab ' CYCL DEF 7.2 IY' PartShiftY# EOL
SeqLab ' CYCL DEF 7.3 IZ' PartShiftZ# EOL
SeqLab ' LBL 0' EOL
CloseSub
SeqLab ' CYCL DEF 7.0 DATUM SHIFT'EOL
SeqLab ' CYCL DEF 7.1 IX' OriginUnShiftPX#('0') EOL
SeqLab ' CYCL DEF 7.2 IY' OriginUnShiftPY#('0') EOL
SeqLab ' CYCL DEF 7.3 IZ' OriginUnShiftPZ#('0') EOL
RETURN
CRC:
IF CutterRadiusCompensation?
IF CRCleft?
'RL'
ELSE
'RR'
END
ELSE
'R0'
END
RETURN
FormatArc:
IF AutoCycle? {implies incremental}
SeqLab ' CC IX' ArcI# 'IY' ArcJ# EOL
SeqLab ' C ' 'IX' EPX# 'IY' EPY#
IF ZMove?
'IZ' EPZ#
END
ELSE
SeqLab ' CC ' ArcIJ EOL
SeqLab ' C 'MoveX MoveY MoveZC
END
IF ArcCW?
' DR-' CWArc {no output}
ELSE
' DR+' CCWArc {no output}
END
' '
CRC
RETURN
StdLine: {enables CRC on first call, .70}
IF Decelerate?
IF RoomToDecel?
DecelMove1
SeqLab ' L ' MoveX MoveY MoveZC ' ' CRC FeedRate ' M' EOL
DecelMove2
END
SeqLab ' L ' MoveX MoveY MoveZC ' ' CRC DecelFeed ' M' EOL
ELSE
SeqLab ' L ' MoveX MoveY MoveZC ' ' CRC FeedRate ' M' EOL
END
RETURN
AutoCycleRapid: {implies incremental}
IF XMove?
SeqLab ' L IX' EPX#
IF YMove?
'IY' EPY#
IF ZMove?
'IZ' EPZ# ' ' CRC ' F2500 M' EOL
ELSE
' ' CRC ' F2500 M' EOL
END
ELSE
IF ZMove?
'IZ' EPZ# ' ' CRC ' F2500 M' EOL
ELSE
' ' CRC ' F2500 M' EOL
END
END
ELSE
IF YMove?
SeqLab ' L IY' EPY#
IF ZMove?
'IZ' EPZ# ' ' CRC ' F2500 M' EOL
ELSE
' ' CRC ' F2500 M' EOL
END
ELSE
IF ZMove?
SeqLab ' L IZ' EPZ# ' ' CRC ' F2500 M' EOL
END
END
END
RETURN
AutoCycleLine: {implies incremental}
IF XMove?
SeqLab ' L IX' EPX#
IF YMove?
'IY' EPY#
IF ZMove?
'IZ' EPZ# ' ' CRC FeedRate ' M' EOL
ELSE
' ' CRC FeedRate ' M' EOL
END
ELSE
IF ZMove?
'IZ' EPZ# ' ' CRC FeedRate ' M' EOL
ELSE
' ' CRC FeedRate ' M' EOL
END
END
ELSE
IF YMove?
SeqLab ' L IY' EPY#
IF ZMove?
'IZ' EPZ# ' ' CRC FeedRate ' M' EOL
ELSE
' ' CRC FeedRate ' M' EOL
END
ELSE
IF ZMove?
SeqLab ' L IZ' EPZ# ' ' CRC FeedRate ' M' EOL
END
END
END
RETURN
ToolPath:
EACHFeat
IF PointFeat?
IF NOT FirstFeat?
Rapid {no output}
SeqLab ' L ' MoveSXYC ' R0 F2500 M99' EOL
END
IF AutoCycle?
SeqLab ' CALL LBL ' Program# EOL
END
ELSE
IF RapidFeat?
Rapid {no output}
IF AutoCycle?
IF LastFeat?
AutoCycleRapid {incremental moves}
IF CutterRadiusCompensation?
SeqLab ' L IX+0.0000 IY+0.0000 R0 F2500 M' EOL
END
ELSE
AutoCycleRapid {incremental moves}
END
ELSE
SeqLab ' L ' MoveX MoveY MoveZC ' CRC F2500 M' EOL
END
ELSE
IF LineFeat?
Feed {no output}
IF AutoCycle? {.70}
IF LastFeat?
AutoCycleLine {incremental moves}
IF CutterRadiusCompensation?
SeqLab ' L IX+0.0000 IY+0.0000 R0 F2500 M' EOL
END
ELSE
IF ZMove? {skip CRCOn until first non-Z move line, skipping ramps}
IF XMove?
SeqLab ' L IX' EPX#
IF YMove?
'IY' EPY#
IF ZMove?
'IZ' EPZ# ' ' 'R0' ' F2500 M' EOL
ELSE
' ' 'R0' ' F2500 M' EOL
END
ELSE
IF ZMove?
'IZ' EPZ# ' ' 'R0' ' F2500 M' EOL
ELSE
' ' 'R0' ' F2500 M' EOL
END
END
ELSE
IF YMove?
SeqLab ' L IY' EPY#
IF ZMove?
'IZ' EPZ# ' ' 'R0' ' F2500 M' EOL
ELSE
' ' 'R0' ' F2500 M' EOL
END
ELSE
IF ZMove?
SeqLab ' L IZ' EPZ# ' ' 'R0' ' F2500 M' EOL
END
END
END
ELSE
AutoCycleLine {incremental moves, enables CRC on first call}
END
END
ELSE
StdLine
END
ELSE
IF ArcFeat?
EACHQuadrant
IF LastQuadrant? AND Decelerate?
IF RoomToDecel?
DecelMove1
FormatArc ArcFeed ' M' EOL
DecelMove2
END
FormatArc DecelFeed ' M' EOL
ELSE
FormatArc ArcFeed ' M' EOL
END
NEXTQuadrant
END
END
END
END
NEXTFeat
RETURN
AutoCycCutSub1: {part 1}
SaveSubStatus {save tool position}
SetPass1 {element cut moves}
StartSub
SetSRXYtoSP
IncValue {no output}
SeqLab ' L IX' StartPosX# 'IY' StartPosY# ' R0 F2500 M' EOL
RETURN
AutoCycCutSub2: {part 2}
ToolPath
IF Repeats? AND FeedConnect? AND ZshiftOnly?
AbsOrInc {no output}
ELSE
AbsOrInc {no output}
SeqLab ' ' ZCP2 ' R0 F2500 M' EOL
END
SeqLab ' LBL 0'EOL
CloseSub
SetSRSubXY {restore tool position}
SetSRSubMove
RETURN
AutoCycPat:
SetPass2 {position pattern}
ToolPath {call after NewProg for correct sub calls}
RETURN
Milling:
IF AutoCycle?
NewProg
AutoCycCutSub1
EntryMove
AutoCycCutSub2
AutoCycPat
ELSE
EntryMove
ToolPath
END
RETURN
G92Sub:
StdSub
Milling
FinishSub1
FinishSubG92
RETURN
ZonlyRepAutoCycle:
AutoCycPat {write pattern moves and main calls}
StartSub
NewProg
SetPass1 {for correct Z's}
EachCycle
IF FeedConnect?
Feed {no output}
SeqLab ' ' ZInPlusInc ' R0' FeedEnt ' M'EOL
ELSE
IF FeedEntry?
IF NOT FirstCycle?
Rapid {no output}
SeqLab ' ' ZCP2PlusInc ' R0 F2500 M' EOL
END
Feed {no output}
SeqLab ' ' ZInPlusInc ' R0' FeedEnt ' M'EOL
ELSE
Rapid {no output}
SeqLab ' ' ZInPlusInc ' R0 F2500 M' EOL
END
END
IF FirstCycle?
SetStatusOff {protect Z position for incremental sub}
END
SeqLab ' CALL LBL ' Program# EOL
NextCycle
SetStatusOn
AutoCycCutSub1 {build element sub}
AutoCycCutSub2
{.69, removed FinishSub1}
IF FeedConnect? {there is no Z up in the sub, .69}
Rapid {no output}
SeqLab ' ' ZCP2 ' R0 F2500 M' EOL
END {.69}
SeqLab ' LBL 0'EOL
CloseSub
{Element shift, not pattern}
RETURN
ZonlyRep:
EachCycle
IF NOT FirstCycle?
SeqLab ' L ' StrtPos ' R0 F2500 M' EOL
END
IF FeedConnect?
Feed {no output}
SeqLab ' ' ZInPlusInc ' R0' FeedEnt ' M'EOL
ELSE
IF FeedEntry?
IF NOT FirstCycle?
Rapid {no output}
SeqLab ' ' ZCP2PlusInc ' R0 F2500 M' EOL
END
Feed {no output}
SeqLab ' ' ZInPlusInc ' R0' FeedEnt ' M'EOL
ELSE
Rapid {no output}
SeqLab ' ' ZInPlusInc ' R0 F2500 M' EOL
END
END
SeqLab ' CALL LBL ' Program# EOL
NextCycle
StartSub
SkipZ
ToolPath
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('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
IF FirstOperation?
' '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 'MoveType$ ')'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
EachTool
SeqLab ' TOOL DEF ' TLNum# ' L' TLLength# ' R'
DIV# TLDia# NUM#('2') EOL
NextTool
IF ToolChangeAtHome?
SetHome
END
IF MultipleParts? AND AllToolsOnePart?
OpenMP
END
Plane Rapid {no output}
SeqLab ' LBL 1' EOL
SeqLab ' TOOL CALL 0 Z S 0.000' EOL
SeqLab ' Z' ClearancePlane1# ' R0 F2500 M' EOL
SeqLab ' L X' HomeX# ' Y' HomeY# ' R0 F2500 M06'EOL
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 ' L X' StartPosX# ' Y' StartPosY# ' R0 F2500' SpinOn EOL
ELSE
IF NewTool?
IF MultipleParts? AND OneToolAllParts?
CloseMP
END
DoEndOpPS
Plane Rapid {no output}
SeqLab ' CALL LBL 1 REP' EOL
DoOpComments
DoPostScript
ToolChng {no output}
SeqLab ' TOOL CALL ' Tool# ' Z S 1.000' EOL
IF MultipleParts? AND OneToolAllParts? AND FullUp?
OpenMP
END
CheckPass
SeqLab ' L X' StartPosX# ' Y' StartPosY# ' R0 F2500' SpinOn EOL
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
OpenMP
END
ELSE
IF SameTool?
DoEndOpPS
DoOpComments
DoPostScript
Plane Rapid {no output}
CheckPass
SeqLab ' L X' StartPosX# ' Y' StartPosY# ' R0 F2500 M' EOL
END
END
END
IF Milling?
SeqLab ' Z' ClearancePlane2# ' R0 F2500 M08' 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
SeqLab ' ' Feed ZCP3 ' R0 F2500 M09'EOL
ELSE
IF Drilling?
IF Repeats?
NewProg
SeqLab ' CALL LBL 'Program# ' REP 'Repeats# ' / 'Repeats# EOL
OpenSub
DoSubComment
SeqLab ' LBL 'Program# EOL
SeqLab ' L ' StrtPos ' R0 F2500 M'EOL
END
SeqLab ' ' DrillCP ' R0' 'F2500 M08'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?
SeqLab ' CYCL DEF 7.0 DATUM SHIFT'EOL
SeqLab ' CYCL DEF 7.1 IX'RepeatX# EOL
SeqLab ' CYCL DEF 7.2 IY'RepeatY# EOL
SeqLab ' CYCL DEF 7.3 IZ'RepeatZ# EOL
SeqLab ' LBL 0'EOL
CloseSub
SeqLab ' CYCL DEF 7.0 DATUM SHIFT'EOL
SeqLab ' CYCL DEF 7.1 IX'OriginUnShiftRX#('0') EOL
SeqLab ' CYCL DEF 7.2 IY'OriginUnShiftRY#('0') EOL
SeqLab ' CYCL DEF 7.3 IZ'OriginUnShiftRZ#('0') EOL
END
Rapid {no output}
SeqLab ' 'ZCP3 ' R0 F2500 M09'EOL
END
END
NEXTOp
IF MultipleParts? AND OneToolAllParts? AND ExitClearancePlane?
CloseMP
END
DoEndOpPS
Rapid {no output}
SeqLab ' TOOL CALL 0 Z S0.000'EOL
SeqLab ' Z'ClearancePlane1# ' R0 F2500'EOL
IF MultipleParts? AND OneToolAllParts? AND FullUp?
CloseMP
END
SeqLab ' L X' HomeX# ' Y' HomeY# ' R0 F2500 M05'EOL
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
Wyszukiwarka
Podobne podstrony:
Heidenhain TNC 131 M721 81 4Heidenhain TNC 151 M115 89 3mHeidenhain TNC 155 M281 81 3mHeidenhain TNC 155 M281 84Heidenhain 145C BP M215 79 1Heidenhain 145C (MM) M260 81 3programow heidenhain 1 Programowanie TNCHeidenhain frezarka iTNC 530 G kody plp (79)TNC 122 manual guideen 79Heid TNC 426 [RT] MV46 15m13 79 Pistons and connecting rods assembly79 atytHeidenhain01?dania makroskopowe instrukcja 2id 79więcej podobnych podstron