SAMPLE MACROS

# MACRO cut_contour
# this is a macro to cut a path defined before the macro call.
# It will position over the XY point defined by Xstart,Ystart
# Rapid in Z to the Rap Level
# Feed in Z to the Finish depth
# Insert diameter comp in a move to the path start point
# Cuts the path
# Turns off comp in a move away from the contour
# retracts to the rap level.
#
RAPID: X= Xstart; Y= Ystart;
RAPID: Z= Rap_level+ Tool_clearance; Codes= Spindle;
FEED: Z= Rap_level- Finish_depth; Codes= Coolant;
ASSIGN: Pathstartpt
OUTPUT: G01G{Comp_dir}X{Xstart}Y{Ystart}D{Dia_comp}
CUTPATH:
OUTPUT: G01G{Comp_cancel}X{Xend}Y{Yend}
RAPID: Z= Rap_level+ Tool_clearance; Codes= Coolant_off;

# MACRO ramp_contour
# This macro ramps into a path
#
ASSIGN: Xtemp= Xstart; Ytemp= Ystart;
RAPID: X= Xstart; Y= Ystart;
RAPID: Z= Rap_level+ Tool_clearance; Codes= Spindle;
ASSIGN: Pathstartpt
ASSIGN: X1= Xtemp+ .75*(Xstart- Xtemp); Y1= Ytemp+ .75*(Ystart- Ytemp);
FEED: X= X1; Y= Y1; Z= Rap_level- Finish_depth; Codes= Coolant;
OUTPUT: G01G{Comp_dir}X{Xstart}Y{Ystart}D{dia_comp}
CUTPATH:
OUTPUT: G01G{Comp_cancel}X{Xend}Y{Yend}
RAPID: Z= Rap_level+ Tool_clearance; Codes= Coolant_off;

# MACRO round_cut
# This macro creates a round milling cycle
#
ASSIGN: Xtemp= Xstart; Ytemp= Ystart;
ASSIGN: Roundstartpt X= Xstart; Y= Ystart;
ASSIGN: R1= .5*diameter+ (cutter_offset+clearance)*inout;
ASSIGN: X1= R1*SIN(Starting_angle); Y1= R1*COS(Starting_angle);
RAPID: X= Xtemp+ X1; Y= Ytemp+ Y1;
ASSIGN: Xret= X; Yret= Y;
RAPID: Z= Rap_level+ tool_clearance; Codes= Spindle;
FEED: Z= Rap_level- finish_depth; Codes= Coolant;
OUTPUT: G{Comp_dir}X{Xstart}Y{Ystart}D{Dia_comp}
ROUND: X= Xtemp; Y= Ytemp;
OUTPUT: G{Comp_cancel}X{Xret}Y{Yret}
RAPID: Z= Rap_level+ tool_clearance; Codes= Coolant_off;