;
; Fanuc G - Code 3-Axis post processor
;
; History
;
; Who When     What
; === ======== ========================================
; TM  04/07/95 Written
; BEM 06/08/96 Modified for Rotary Axis support
; BEM 19/06/00 Fixed 
; BEM 03/02/00 Added description
; SKL 04/11/02 Modified for Roland 650 rotary Axis support
; SKL 03/07/03 Mirror Y (output as X) to allow for rotation
; SKL 05/08/03 Remove space and fix code cannot execute error
; GOB 10/12/07 1)Adapt to MDX 540 3 axis 
;              2)Add toolchanger support
;              3)Enable arc moves
; GOB 10/14/07 remove program number from header, caused cannot execute error
;
DESCRIPTION = "Roland MDX 540 Toolchange mm(*.txt)"
;
; Note - machine is equipped with 4 tools
;
FILE_EXTENSION = "txt"
;
UNITS = MM
;
; Carriage return - line feed at end of each line
;
END_OF_LINE = "[13][10]"
;
; Block numbering 
;
LINE_NUM_START     = 0
LINE_NUM_INCREMENT = 10
LINE_NUM_MAXIMUM   = 999999
;
; Set up default formating for variables
;
; Line numbering
FORMAT = [N|@|N|1.0]
; Spindle Speed
FORMAT = [S|@|S|1.0]
; Feed Rate
FORMAT = [F|#|F|1.1]
; Tool moves in x,y and z
FORMAT = [X|#|X|1.3]
FORMAT = [Y|#|Y|1.3]
FORMAT = [Z|#|Z|1.3]
; Home tool positions 
FORMAT = [XH|@|X|1.3]
FORMAT = [YH|@|Y|1.3]
FORMAT = [ZH|@|Z|1.3]
; Arc Centre Cordinates
FORMAT = [I|@|I|1.3]
FORMAT = [J|@|J|1.3]
;
; Set up program header
;
START="%"
; start data
START = "G90"
; set to absolute coordinates
START = "G21"
; set to metric mode
START = "G17"
; specify XY plane for circular interpolation
START = "G40"
; cancel tool diameter offset
START = "G49M06T[T]"
; cancel tool length offset, select first tool
START = "G43H[T]"
; start tool length offset for tool selected
START = "G54"
; set to workpiece origin 1"
START = "M03[S]"
; turn on spindle at specified speed
START = "G00[ZH]"
; send Z to home at rapid rate
START = "G00[XH][YH]"
; send XY to home at rapid rate
;
; Program moves
;
FIRST_RAPID_RATE_MOVE  = "G00[X][Y][Z]"
FIRST_FEED_RATE_MOVE   = "G01[X][Y][Z][F]"
FEED_RATE_MOVE         = "[X][Y][Z]"
;
FIRST_CW_ARC_MOVE      = "G02[X][Y][I][J]"
CW_ARC_MOVE            = "G02[X][Y][I][J]"
;
FIRST_CCW_ARC_MOVE     = "G03[X][Y][I][J]"
CCW_ARC_MOVE           = "G03[X][Y][I][J]"
;
;  Toolchange
;
TOOLCHANGE = "M05"
; stop spindle
TOOLCHANGE = "G49M06T[T]"
; cancel tool length offset, select next tool
TOOLCHANGE = "G43H[T]"
; start tool length offset for tool selected
TOOLCHANGE = "M03[S]"
; turn on spindle at specified speed
;
; End of file
;
END = "G00[ZH]" 
; send Z home at rapid rate
END = "G00[XH][YH]"
; send XY home at rapid rate
END = "M05"
; turn off spindle
END = "G49M06T0"
; return tool to magazine
END = "M30"
; end file
END = "%"
; end data

