Command Files

The command file is an ASCII file which holds the command sequence selected for a job.

The command file is automatically created by selecting the commands from the command menu or by selecting variables from the variable menu.    Every menu action will create a command file entry.

The following is a command file created to drill some holes and mill a contour:


ASSIGN: X_g92= 0;
ASSIGN: Y_g92= 0;
ASSIGN: Z_g92= 10;
ASSIGN: Tool_num= 2;
ASSIGN: Speed= 750;
ASSIGN: Feed= 2.5;
ASSIGN: Initial_z= 5;
ASSIGN: Length_comp= Tool_num; Dia_comp= Tool_num;
Zfeed= Feed; Ztoolch= Z_g92;
MACRO: startup
ASSIGN: Rap_level= 0;
ASSIGN: Finish_depth= 0.5;
ASSIGN: Feed= Zfeed; Plot_pen= 3;
DRILL: Start_hole= 1; End_hole= 10;
DRILL: Start_hole= 15; End_hole= 15;
DRILL: Start_hole= 17; End_hole= 17;
ASSIGN: X =-2.5; Y =-4.5;
DRILL:
ASSIGN: X =8.5; Y =2.75;
DRILL:
ASSIGN: Tool_num= 3;
ASSIGN: Speed= 500;
ASSIGN: Feed= 1.5;
ASSIGN: Length_comp= Tool_num; Dia_comp= Tool_num;
Zfeed= Feed;
MACRO: tool_change
ASSIGN: Rap_level= 0;
ASSIGN: Finish_depth= 0.5;
ASSIGN: Plot_pen= 5;
ASSIGN: Xstart= -3; Ystart= 0;
ASSIGN: Xend= -3; Yend= 0;
ASSIGN: Path= 2;
MACRO: cut_contour
MACRO: end_codes


The entries in the command file are created from selecting the commands from the menus.    When a command has a question file associated with it, a sequence of ASSIGN:'s will be generated to assign values to variables.    Note that TEMPLATES and MACRO calls are preceded by variable assignments.    All that appears in the MACRO or TEMPLATE command line is the file name.

Canned cycles are designed to be output at multiple hole locations.    The holes drilled for example are specified by Start_hole and End_hole.    If a canned cycle command does not have a Start_hole variable in it, the canned cycle will be executed at the current X,Y location.

Command files may be edited in the TurboPost by using the vi editor.

Variable assignments can have calculations.

New variables may be introduced into command files which are not in the user_variables file.    As long as the variable is introduced by assigning it a specific value.    This is also true for MACROs.

A MACRO is just a mini command file.    MACROs may contain other MACROs.

NOTE: All variable values are global. This means that a variable used in the main command file will have the same value in a macro and if that value is changed in the macro it will be changed in the main body of the command file.

The idea behind the command file is this:

Any machining operation consists of a series of operations performed on geometry, along with setting up the parameters for the machine control.    If an operation or a series of operations is to be repeated a macro should be made with User Variables for that operation.

The other main reason for macros is to handle variations in NC controls in a way that is user definable.    An example is the CUT_CONTOUR macro defined in the samples.    The CUTPATH command only generates the XY data for machining the path.    Positioning in Z and inserting cutter diameter compensation is very control specific.    By necessity these operations must be handled by a macro.    Macros allow the user to customize the behavior of these standard machining operations.

If a user has several different machine tools to support, some care should be taken to insure that the command files are portable between the two different post formats.    This may be done by making sure that macros written for different formats have the same name when they do the same thing.    The internal differences between the machine controls can then be accounted for within the body of the macro.    The same is true of User Variables avoid creating lots of unique variables for different machines.    Use the same name on the different format files for variables with the same function.