machine fanuc15m
# Original option by Faw_DDEW Li GuangQuan
define word NT
address letter = "T"
address width = 1
field width = 2
not modal
end define
define word TS
address letter = "N"
address width = 1
field width = 3
not modal
end define
define word TPN
address letter = "( TOOLPATH :******* "
address width = 20
field width = 30
end define
define format ( ID )
address letter = ":"
end define
define format ( N )
not permanent
end define
define format ( G1 )
leading zeros = true
not modal
end define
define format ( F )
modal
decimal point = true
decimal places = 2
trailing zeros = false
imperial formats = metric formats
end define
define format ( H M1 M2 )
leading zeros = true
end define
define format ( P )
field width = 3
metric formats
decimal point = false
decimal places = 0
trailing zeros = true
imperial formats = metric formats
end define
define word PF
address letter = "F"
field width = 5
not modal
metric formats
decimal point = true
decimal places = 2
trailing zeros = false
imperial formats = metric formats
end define
define format all
tape position = 0
end define
word order = ( + TPN NT TS P PF D )
define keys
tool radius = D
cycle dwell = P
dwell not used
end define
define codes
cycle retract = G6 99
linear = G1 1
comp off = G2 40
comp on left = G2 41
comp on right = G2 42
end define
message output = false
block order = true
tool reset coordinates = 3
integer 51 = 4
integer 69 = 2
incremental centre = false
integer 34 = 0
integer 35 = 1
integer 36 = 0
integer 37 = 1
define block tape start
"%"
ID ProgID
rapid ; incremental data ; G6 28 ; z coord 0
incremental data =C ; G6 30 ; y coord 0 ; x coord 0
end define
define block tool change first
tool number ToolNumber
change tool
if ( NextTool <> 0 )
NT NextTool
end if
TS ToolNumber
set swa
end define
define block tool change
if ( word[30] = 7 or word[30] = 8 )
M2 9
end if
rapid ; incremental data ; G6 28 ; z coord 0
incremental data ; G6 30 ; y coord 0 ; x coord 0
compensation off ; G1 49 ; G4 80 =C
change tool
if ( NextTool <> 0 )
NT NextTool
end if
TS ToolNumber
set swa
end define
define block move rapid
if ( swa )
TPN ToolPathName ; ")"
G2 59 ; absolute data ; rapid ; G6 ; x coord ; y coord ; z coord ; spindle ; tool length ; M1 ; M2
unset swa
else
rapid ; G6 ; x coord ; y coord ; z coord ; spindle ; tool length ; M1 ; M2
end if
end define
define block move linear
linear ; G2 ; x coord ; y coord ; z coord ; tool radius ; feedrate ; M1 ; M2
end define
define block move circle
N ; G1 ; G3 ; x coord ; y coord ; z coord ; key i ; key j ; key k ; feedrate
end define
define block cycle start
if ( cycle = 1 )
G4 ; cycle retract ; x coord ; y coord ; drill hole depth ; clearplane ; feedrate Prat
end if
if ( cycle = 2 or cycle = 3 or cycle => 5 )
G4 ; cycle retract ; x coord ; y coord ; drill hole depth ; clearplane ; cycle dwell ; feedrate Prat
end if
if ( cycle = 4 )
G4 ; cycle retract ; x coord ; y coord ; drill hole depth ; clearplane ; cycle dwell ;
PF ( Cycfed / ToolSpeed[ToolNum] )
end if
end define
define block move cycle
x coord ; y coord ; M1 ; M2
end define
define block move tap
x coord ; y coord ; M1 ; M2
end define
define block cycle end
end of drill
end define
define block tape end
if ( word[30] = 7 or word[30] = 8 )
M2 9
end if
rapid ; incremental data ; G6 28 ; z coord 0
rapid ; incremental data =C ; G6 28 ; y coord 0
G1 40 ; G2 49 ; G4 80 =C
change tool
end of tape
end define
end