machine fanuc10m
 
   define word ID
    address letter = ":"
   end define
 
   define word %D
    address letter = "( Date -"
   end define
 
   define word %M
    address letter = "."
   end define
 
   define word %Y
    address letter = "."
   end define
 
   define word %h
    address letter = " -"
   end define
 
   define word %m
    address letter = ":"
   end define
 
   define word %s
    address letter = ":"
   end define
 
   define word TPN
    address letter = "( TOOLPATH -"
   end define
 
   define word TNO
    address letter = "( TOOL NO."
   end define
 
   define word TN
    address letter = "( TOOL ID"
   end define
 
   define word TT
    address letter = "( TOOL TYPE"
   end define
 
   define word TD
    address letter = "( TOOL DIA."
   end define
 
   define word TR
    address letter = " TIP RAD"
   end define
 
   define word TLH
    address letter = " LENGTH"
   end define
 
   define word TOL
    address letter = "( Tolerance ="
   end define
 
   define word THK
    address letter = "( Allowance ="
   end define
 
   define word VER
    address letter = "( DP Version"
   end define
 
   define word CB
    address letter = ")"
   end define
 
   define word NT
    address letter = "N"
   end define
 
   define word M3
    address letter = "M"
   end define
 
   define word DW
    address letter = "P"
   end define

   define format ( ID )
    address width              =   1
    field width                =   4
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   1
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = true
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = true
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define

   define format ( %D )
    address width              =   9
    field width                =   2
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( %M %Y %m %s NT )
    address width              =   1
    field width                =   2
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( %h )
    address width              =   3
    field width                =   2
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( TPN )
    address width              =  13
    field width                =  20
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( TNO )
    address width              =  11
    field width                =   3
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = false
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( TN )
    address width              =  12
    field width                =  30
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( TT )
    address width              =  12
    field width                =  32
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = false
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( TD )
    address width              =  12
    field width                =   8
    exponent width             =   0
    scale factor               =   2
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = false
    decimal point              = true
    decimal places             =   3
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( TR )
    address width              =   9
    field width                =   8
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = false
    decimal point              = true
    decimal places             =   3
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( TLH )
    address width              =   8
    field width                =   8
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = false
    decimal point              = true
    decimal places             =   3
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( TOL )
    address width              =  14
    field width                =   5
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = false
    decimal point              = true
    decimal places             =   3
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( THK )
    address width              =  14
    field width                =   7
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = always
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = true
    decimal places             =   3
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( VER )
    address width              =  13
    field width                =   4
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   1
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( CB )
    address width              =   1
    field width                =   0
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   0
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( M3 )
    address width              =   1
    field width                =   3
    exponent width             =   0
    scale factor               =   1
    scale divisor              =   1
    tape position              =   1
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( DW )
    address width              =   1
    field width                =   2
    exponent width             =   0
    scale factor               = 100
    scale divisor              =   1
    tape position              =   1
    print position             =   1
    sign                       = none
    not permanent
    not modal
   metric formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   imperial formats
    leading zeros              = false
    trailing zeros             = true
    decimal point              = false
    decimal places             =   0
   end define
 
   define format ( N ) 
    permanent 
   end define

# linked words
   define format ( MS )
     link to EM
   end define
 
 
    word order = (    OP   G1   G2   G3   G4   G5   )
    word order = ( +  G6   G7   X    Y    Z    B    C    )
    word order = ( +  I    J    K    R    D    S    T    )
    word order = ( +  H    M1   M2   MS   msg  EM   Q    )
    word order = ( +  Q1   Z2   R2   ID   F    NT   M3   )
    word order = ( +  P    DW   CB   %D   %M   %Y   %h   )
    word order = ( +  %m   %s   TPN  TNO  TN   TT   TD   )
    word order = ( +  TR   TLH  TOL  THK  VER  )
 
  define keys
    blocknumber                       = N
    message start                     = MS
    message end                       = EM
    opskip                            = OP
    program id                        = ID
  end define
 
  define codes
  end define
 
  print header               = "Delcam Postprocessor"
  machine name               = "Fanuc10m         version 1.1"
  point                      = "."
  zero                       = "0"
  message output             = false
  block order                = true
  block start                =    1
  block increment            =    1
  maximum block number       = 9999
  tlo output                 = true
  tape split on tool change  = false
  use partid                 = true
  use progid                 = true
  maximum feedrate           = 99999.0000
  minimum feedrate           =     1.0000
  rapid feedrate             = 99999.0000
  arc radius limit           = 10000.0000
  arc minimum radius         =     0.005
 
  define block tape start
    "%"
    %D Day ; %M Month ; %Y Year ; "  TIME=HH:MM" ; %h Hours ; %m Minutes ; " )"
  end define
 
  define block tape end
     G2  91  ; G6  28  ; Z   0  ; Z =C
     M1  5
     M1  30
     "%"
  end define
 
  define block go home preamble
  end define
 
  define block tool change first
    compensation off ; G6  49    ; xy plane  ; G4  80
    TN ToolName ; " )"
    TD ToolRadius[ToolNum] ; TR TipRadius[ToolNum] ; TLH ToolLength[ToolNum] ; " )"
    "G91 G28 Z0"
    "G00 G17 G40 G49 G80 G90"
    change tool ; T ToolNum 
    "G0 G90 G54"
    "G0 X0 Y0 M08"
  end define
 
  define block tool change

    N   ; compensation off ; G6    ; xy plane  ; G4  80
    N   ; TN ToolName ; " )"
    N   ; TD ToolRadius[ToolNum] ; TR TipRadius[ToolNum] ; TLH ToolLength[ToolNum] ; " )"
    N   ; "G91 G28 Z0"
    "G00 G17 G40 G49 G80 G90"
    N   ; change tool ; T ToolNum
    N   ; "G0 G90 G54"
    N   ; "G0 X0 Y0 M08"
   end define
 
  define block tool change clear
  end define
 
  define block go home z move
  end define
 
  define block go home xy move
  end define
 
  define block move from
  end define
 
  define block move circle
    OP  ; N   ; G1  ; G2  ; G3  ; X   ; Y   ; Z   ; I   ; J    ; K   ; F   ; D   ;
    B   ; C
  end define
 
  define block move linear
    if ( swa)
      TPN ToolPathName ; " )"
      unset swa
    end if
    N   ; G1  ; G2  ; G3  ; X   ; Y   ; Z   ; F 
  end define
 
  define block move rapid
    if ( swa)
      TPN ToolPathName ; " )"
      unset swa
    end if
    N   ; S   ;   M1
    N   ; G1  ; X   ; Y   
    N   ; G6  ; Z   ; H  ; M2  
  end define
 
  define block move cycle
    N   ; G4  ; G6  ; X   ; Y   ; Z2  ; R2  ; Q   ; Q1  ; F   ; M2
  end define
 
  define block move tap
    N   ; G6  ; G4  ; X   ; Y   ; Z2  ; R2  ; F   ; M1  ; M2
  end define
 
  define block tape segment
  end define
 
  define block tape split start
  end define
 
  define block tape split end
  end define
 
  define block cycle start
  end define
 
  define block cycle end
  end define
 
  define block tape split move
  end define
 
  define block move spline
  end define

  define block cldat  1094
    set swa
  end define
 
end
