Separating Lines Into Specific Files
To put specific lines of code into the desired file, you use the command string &
followed by an integer that defines the file location as follows:
&1
Put this line in the first file defined. Inserting&1
is optional.&2
Put this line in the second file defined.&3
Put this line in the third file defined.&1&2
Put this line in the first and second file defined.
The only rule is that the &
characters must be the first characters on the line in which they appear. If no &
character appears, the line will be output to the first file (represented by &1
) by default.
Example - How to create a Tool List using the Split/Merge feature
Let’s look at an example of how to use the file handling features of ConfigPost by creating a tool list at the beginning of a G-code output file as well as a separate file, which only contains the tool list.
You can create a tool list in any Mill or Turn post processor that came with your PartMaker software. You have to take the following steps:
In the beginning of File Start format, insert:
#define TOOL LIST POST FILE<eob> #split <prog-name>.TXT <prog-name>.TMP <prog-name>.TLS OUT_NAME.TXT<eob> #merge <prog-name>.TXT <prog-name>.TLS <prog-name>.TMP<eob> #remove <prog-name>.TMP <eob> &2%<eob> &2O<prog-num1><eob> &2(T<tool-num> <tool-name><tool-note>)<eob>
Looking at the previous text:
&1
corresponds to<prog-name>.TMP
&2
corresponds to<prog-name>.TLS
&3
corresponds toOUT_NAME.TXT
Putting
%
and<prog-num>
at the beginning of the tool list ensures that the data needed at the beginning of the program is truly at the beginning and not after the tool list.
In the beginning of Tool Change format and Program Start format insert:
<if><first-tool-use><then> &2(T<tool-num> <tool-name><tool-note>)<eob> <endif>
This construction tells PartMaker to write data to the
<prog-name>.TLS
file if a tool is called for the first time.In the beginning of File End format insert:
&3FILES <prog-name>.TXT <prog-name>.TLS <eob> &3<32><32><eob> &3Files created are:<eob> &3 <prog-name>.TXT <eob> &3 <prog-name>.TLS <eob>
In this example,
OUT_NAME.TXT
is the last of three new files being created during the#split
operation, the appearance&3
tells PartMaker to place data into the fileOUT_NAME.TXT
.To view a post processed JOB file that outputs the two files constructed above:
a. In ConfigPost, save the Post file you just modified by choosing File > Save As, then name the file
TOOLLIST.PST
or a similar name when prompted.b. In PartMaker, load the Post file you just modified by choosing Job Optimizer > Post Config File=?.
c. In PartMaker, open a completed .JOB file and choose Job Optimizer > Generate NC Program.
d. When prompted, name your program
TOOLLIST.TXT
, and then click Save. You should see the contents of theOUT_NAME.TXT
file as:e. Click the View Program button and you should see the Tool List as:
TOOLLIST.TLS
is a text file containing just the list of tools for the job you opened in step c.TOOLLIST.TXT
is the completed .TXT file.