Macros

Macros are ASCII files which contain user definable command sequences. Several examples are provided in the standard Lathe post.

For example, the FINISH_PATH macro is defined in the file "turn_contour":


ASSIGN: Tnose_shift= Tnose_rad;
ASSIGN: Shift_off= 1-Startpt;
RAPID: X= Xstart; Z= Zstart;
CUTPATH:
ASSIGN: Shift_off= 1-Endpt;
RAPID: X= Xend; Z= Zend;
ASSIGN: Tnose_shift= 0;
ASSIGN: Startpt= 0 Endpt= 0;


In the first two ASSIGN lines we set variables to shift the startpt for stock safety clearance.

In the macro the RAPID block rapids the XZ location defined by the variables Xstart and Zstart.    These variables are defined when the path is selected.

The next block calls the system command CUTPATH which tells the program to generate the tape code for cutting the current path which is specified outside the macro.

The final RAPID block rapids the cutter to the XZ location defined by the variables Xend and Zend.    These variables are defined when the path is selected.

And finally we cancel these variables back to a default value.

Associated with this macro is the question file "turn_ques":

Uncut_angle          force        prompt= "TOOL RAKE ANGLE";
ASSIGN: Pen= 6;
Feed                       force        prompt= "FEED RATE";
ASSIGN: Pen= 6;

The question file is user definable.    It allows relevant variables to be prompted whenever the macro is selected.    The variable must be specified with the correct spelling.    The force command means that the question is always asked when the macro is selected.    The default command allows the variable to be listed for reference, but the variable is used with its current value.

In addition, value assignments can be made by the question file. Whenever this macro is called the plotting pen color is changed to pen 6.