Step Report Format
The following describes sections of the Milling Step Report (ASCII version). Important aspects of report
format files are highlighted and described. Click here to see an
un-annotated version of the mill_stepreport_prn.fmt
file.
This format file contains the general structure for the step report that is produced when you select File - Print - JOS Report from the SmartCAM menu and enable the Step report type.
MILL_STEPREPORT_PRN.FMT
//------------------------------------------------------------------------
// MILLING Step Report Format File (main)
//------------------------------------------------------------------------
The comment lines at the top of the file identify it as the format file for a milling step report. These comment lines only appear in the format file, they are not printed.
extern string jof_file;
Declare all variables before using them in the format statements. This file references a single variable,
jof_file
.
procedure header
{
format("--------------------------------------------------------------\n");
format(" MILLING Step Report for %s\n", jof_file);
format("--------------------------------------------------------------\n");
format("\n\n");
}
This procedure formats the header for each page of the report.
The format statements provide the content for the header, in this case the name of the report.
Notice that the variable jof_file
, which provides the name of the active job operations
setup file, is formatted as a string.
#include "mjobinf.fmt"
#include "mstepinf.fmt"
There are two include statements that call other report format files; each containing formatting
commands for different aspects of the final report. The mjobinf_prn.fmt
includes the
procedures to print the Job Information content and mstepinf_prn.fmt
contains
the procedures to print the Step content.
procedure footer
{
format(" -- %d --\n", page());
}
This procedure formats the footer for each page of the report. Notice that the format statement specifies that the page number will be formatted as an integer. The spaces in the format statement produce spaces in the printed report.
MSTEPINF_PRN.INC
This is an example of the Milling Step Report Format file. Click here to see an unannotated version of this report file.
This format file contains the directives that format the body of the step report. Notice that there
are no header
or footer
procedures in this file. The header and footer
procedures are defined in mill_stepreport_prn.fmt
file. This file is included by the main
report file, which has the header/footer procedures, and is only used for format the Step specific output
lines.
//------------------------------------------------------------------------
// MILLING Step Report Format File (report body)
// NOTE: Formats are driven off of the op SNCS associated with a step.
//------------------------------------------------------------------------
The comment lines at the top of the file identify it as the body of the milling step report. These lines only appear in the format file, they are not printed.
extern integer doff, loff, step_num, tl_num, outspeed, unspmode, unfdmode;
extern string st_desc, tl_desc;
extern float outfeed1;
Declare all variables before using them in a format statement. Notice that you can list like variable types on the same line by separating them with a comma.
procedure speed_mode
{
format ("%s",
map(unspmode, [ 1 = "SFM", 2 = "RPM", 11 = "m/min", 12 = "RPM"]));
}
procedure feed_mode
{
format ("%s",
map(unfdmode, [ 1 = "IPR", 2 = "IPM", 11 = "mm/r", 12 = "mm/min"]));
}
These defined procedures set the format for displaying feeds and speeds. Notice that these procedures are called from within other procedures in the file.
procedure section_1030000
{
format ("%d: %s\n", step_num, st_desc);
format (" Tool No=%-d - %s\n", tl_num, tl_desc);
format (" Doff:%-d Loff:%-d Speed:%-d", doff, loff, outspeed);
call (speed_mode);
format (" Feed:%-0.4f", outfeed1);
call (feed_mode);
format ("\n\n");
}
This section number procedure sets the format for all operations. 1030000 is the section number for all operations. You can format different types of operations (for example, hole and milling operations) in different ways by declaring a section procedure for each type.
Within the procedure section_1030000
brackets, notice that the format statements format the
step number as an integer (%d
) and the step description as a string (%s
). Also
note that each format statement ends with a new line character (\n
); without the newline
character, all of the lines would be appended onto the end of each other.
Related Topics
Creating a Custom JOS Report Format File