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: Batch= 25;
ASSIGN: Setup_time= 1.5;
ASSIGN: Prog_id= "51";
ASSIGN: Prog_desc= "Job 4545";
ASSIGN: Tcode= 101;
ASSIGN: Tool_desc= "80 deg roughing insert";
ASSIGN: Tnose_rad= .031;
ASSIGN: Tnose_quad= 1;
ASSIGN: Odid_cycle= 1;
ASSIGN: Speedcode= 350;
ASSIGN: Feed= .015;
MACRO: startup
ASSIGN: Zstart= 0; Xstart= 0; Startpt= 1;
ASSIGN: Zend= 2; Xend= 2; Endpt= 1;
ASSIGN: Path= 1;
MACRO: Turn_contour
ASSIGN: Tcoder= Tcode;
ASSIGN: Tcode= 202;
ASSIGN: Tool_desc= "Drill";
ASSIGN: Tnose_rad= 0;
ASSIGN: Tnose_quad= 8;
ASSIGN: Odid_cycle= 0;
ASSIGN: Speedcode= 350;
ASSIGN: Speedmax= 1500;
ASSIGN: Range= 3;
ASSIGN: Feed= .015;
ASSIGN: Zfeed= Feed;
MACRO: tool_change
ASSIGN: Rap_level= 0.5;
ASSIGN: Zend= -1.5;
ASSIGN: Pen= 5;
ASSIGN: Peck= .06;
ASSIGN: Feed= Zfeed;
ASSIGN: Finish_depth= Rap_level-Zend;
MACRO: peckdrill_m
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 MACRO calls are preceded by variable assignments.    All that appears in the MACRO command line is the file name.

Command files may be edited in 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.

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.