You are on page 1of 150

Click To See:

How to Use Online Documents

SURFCAM Online Documents


6 8 5 )&$ 0 6 X SSR UW 8 W L O L WL HV 0 DQ X DO

2
3267352&(66,1*,1752'8&7,21
$1'03267
After a general introduction to Post Processing, this chapter will be devoted mainly to MPost. Refer
to Section 2.2.2: The MPOST Post Processor Package on page 36 and then to the main MPost topics
beginning with Section 2.6: Post Processor Configuration on page 47.

2.1

INTRODUCTION

In the final phase of an NC project, the NC operation toolpaths are processed to convert them to
the NC code needed by the machine that will cut the part. This conversion process, called post
processing, is accomplished with programs called post processors.
After NC code has been created for the specific machine that will do the cutting, it must be
transmitted to that machine. One common method of doing this is to make an RS-232 connection
between a computer and the NC machine and then download the NC code directly to the machine.
This process is referred to as Direct Numerical Control or DNC communications.
SURFCAM is shipped with two post processor systems and one DNC system.

2.2

POST PROCESSOR BASICS

Post processors are programs that take toolpath information from a file created by a CAM program
and machine information from a machine configuration file (often called a post) to create the final
NC code understood by the NC machines controller. Post processors usually come in a package
consisting of a processor for each general type of NC machine (that is lathe, mill, and wire EDM)
and files and/or programs that help you create machine configuration files or posts for individual
NC machines.
SURFCAM is shipped with two such post processor packages. One consists of three separate
post processors called MPOST, LPOST and EPOST. For convenience, this package is referred
to as MPOST. The other, called SPOST, has more powerful post processors and a machine
configuration utility for developing posts or machine configuration files. Both packages contain a
library of existing posts for a number of NC machines.

2.2.1

The SPost Post Processor

The SPost post processor system contains two post processors: SPOSTM.EXE used with
mills and wire EDM and SPOSTL.EXE used with lathes. These programs are stored in the
SURFCAM\Surf2000\SPost directory. The posts for the SPOST system are saved in the
SURFCAM\PostLib\SPost directory as files with names in the form of either UNCX01.Pnn for
SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost
Copyright 2000 by Surfware, Inc. All Rights Reserved.

32

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

mill/wire EDM posts or UNCL01.Pnn for lathe posts. The nn in these file names is the
machine number that is assigned by the person who creates the post.

2.2.1.1

Creating SPOST Posts and FIL Files

Posts are created in the SPost system using a program called SPOSTCFG.EXE. This
post configuration program is stored in the SURFCAM\Surf2000\SPost directory.
For a detailed explanation of SPost, refer to the online SPost Reference Manual and to the
online SPost FIL Manual.
Often a post has an accompanying FIL (Factory Interface Language) file whose function
is to handle special circumstances regarding the machine that cannot be addressed by
a post file alone. Refer to the online SPost FIL Manual, Chapter 1: Fil Introduction starting on
page 1 if you need to create your own FIL file for a particular machine. FIL files are saved
in the SURFCAM\PostLib\SPost directory with names in a form that is similar to the
names of posts: UNCX01.Fnn for mill and wire EDM machines and UNCL01.Fnn for
lathe machines. The nn in a FIL file name is the same as the nn in its corresponding
post file name.

2.2.1.2

Running an SPOST Post Processor

You run an SPost post processor from the NC Operations Manager dialog
box. To access the NC Operations Manager dialog box, either click the
button on the SURFCAM toolbar or press Ctrl + N.

Figure 1: NC Operations Manager dialog box

Several features of the NC Operations Manager dialog box are used in post processing.

2.2.1.2.1

Operations Tree

First, the NC Operations Tree is used to select the operations for post processing.
You can process a single operation, all the operations in a single Setup Section,
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

33

or all the operations in the NC Project by clicking the corresponding icon. If you
post process the entire project, however, you get a separate output file (an NCC
file) for each Setup Section rather than a single NCC file.

2.2.1.2.2

Post List Box

Next, the post to be used in the post processing is


selected from the NC Post List box.
The SPost posts that are listed in the NC Post List box are
the ones that are available for the currently active NC
mode. If you choose a different mode, a corresponding
list will be displayed.
When you click an entry in the NC Post List box, a
comment related to that item will be displayed on the NC
Status Line.
The contents of the NC Post List box and NC Status Line are determined by the
contents of the SURFCAM.PST file. This file also contains commands required to
invoke the correct SPost post processor and to complete the post processing
cycle. When you need to add a new post to those already available, you will have
to make changes to the SURFCAM.PST file.

2.2.1.2.3

Starting Post Processing

To start the SPost post processing cycle, double-click the desired post name in the
NC Post List box (or click the post name once and click the Post button).
SURFCAM will create an NCD sub-directory if one has not already been created.
Refer to the SURFCAM Getting Started Manual, Chapter 2: NC Project Basics, Section 2.2.4:
NCD Sub-directories on page 53. All the files created during post processing will be
saved in the NCD sub-directory. The NC Operations Manager then executes a
series of commands, stored in the SURFCAM.PST file, that lead to the creation of
the final NCC code.

2.2.1.2.4

Post Processing Details

From the ICD file, the NC Operations Manager extracts INC files of the operations
you selected from the NC Operations Tree. These INC files are temporary and are
deleted when you exit SURFCAM.
If you selected a single operation, its INC file is extracted and saved with the
Operation File Name shown on the Operation Information dialog box. Refer to the
SURFCAM Getting Started Manual, Chapter 5: NC Operations Manager, Section 5.3.1: NC
Operation Information Dialog Box on page 127.

If you selected a Setup Section, the INC files of each of its operations are
extracted, merged into one INC file and saved with the Section File Name on the
NC Section Information dialog box. Refer to the SURFCAM Getting Started Manual,
Chapter 5: NC Operations Manager, Section 5.3.2: NC Section Information Dialog Box on
page 129.
Copyright 2000 by Surfware, Inc. All Rights Reserved.

34

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Next, the INC file is translated by the INC2APT translator into APT format, an
industry standard, and saved as a file with the APT extension and the same name
as the INC file. This APT file is temporary and is deleted as the last step of post
processing.
Next, the applicable SPost post processor (SPOSTM.EXE or SPOSTL.EXE) will
take input from the APT file and from the designated post file to create a file
containing the final NC code. This file is saved with either the Section File Name
or Operation File Name, mentioned previously, and the NCC extension. At the
same time, a process list file is created having the same name as the NCC file and
the LST extension. The LST file is a diagnostic tool used when you are creating a
new SPost post.
If the file names of any of the files created in the previous steps already appear in
the NCD sub-directory, an NCPOST dialog box similar to the following one will be
displayed.

Figure 2: File Already Exists dialog box

If you click No, post processing will stop. You can choose not to have these
warning boxes displayed by checking the Dont warn if files already exist while
posting box on the NC Settings dialog box. Refer to the online SURFCAM Reference
Manual, Chapter 1: Menus and Dialog Boxes, Section 1.8.5: Options > NC Settings on page
161.

Next, a dialog box will be displayed and you will be prompted to enter a program
number.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

35

Figure 3: Posting dialog box

Type in a program number and press Enter to continue. After you do so, the
SPOST post processor will create the final NC code and save it as a file with an
NCC file extension.
Then the SURFCAM Editor will be launched with the newly created NCC file
opened and displayed on the screen. You can view the NCC file and make any
necessary changes. Use the Save command to save your changes using the
SURFCAM-assigned file name or use the Save As command to save it with a
name of your choosing.
Refer to the online SURFCAM SEdit Editor Manual.

2.2.1.3

Summary SPost Post Processing

The following is a step by step summary of post processing using SPOST.


1. Before you start post processing, make sure you are in the correct NC mode.
Remember, the NC mode menu determines the posts that are displayed on the
Operations Manager dialog box. Refer to the SURFCAM Getting Started Manual,
Chapter 2: NC Project Basics, Section 2.3.2: Select the NC Menu on page 55.
2. Click the Operations Manager button on the SURFCAM toolbar to display the NC
Operations dialog box.
3. Click the icon in the NC Operations Tree that represents the operations for which
you want to produce NC code: the NC Project icon, one Setup Section icon or one
operations icon.
4. In the NC Post List box double-click the desired post name (or click it once and
click the Post button).
5. Respond to any dialog boxes that may be displayed.
6. When the NCC file is displayed in the SURFCAM Editor, make any modifications
that are needed and use the Save or Save As command to save it. You can also
Copyright 2000 by Surfware, Inc. All Rights Reserved.

36

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

send your NCC file directly to your NC machine by clicking the SDNC icon on the
SURFCAM Editor toolbar to run SDNC.

2.2.2

The MPOST Post Processor Package

The other post processor package shipped with SURFCAM contains three post processors:
MPOSTWIN used with mills, LPOSTWIN used with lathes, and EPOSTWIN used with wire
EDM. Each is an EXE file. (For simplicity we often refer to all three as the MPost post
processor.) These programs are stored in the SURFCAM\SURF2000\MPost directory. The
post files for this post processor package are located in the SURFCAM\Postlib\Mpost
directory. The name of each post indicates the manufacturer, the model name and NC
machine type. For example, CIN850.M3 is the post for a 3 axis mill made by Cincinnati
Milacron. The model number is 850M.
To get machine configuration data, the post processors MPOSTWIN, LPOSTWIN and
EPOSTWIN read the corresponding POSTFORM library files POSTFORM.M,
POSTFORM.L AND POSTFORM.E. These are text files that contain copies of several posts
that you want to have readily available. The post processors read the POSTFORM files to
get the post names and display them in a menu. You select the post you want and the post
processor goes to that part of the POSTFORM file to get the machine data it needs.
By using a text editorsuch as the SURFCAM Editoryou can add posts to, or delete posts
from, your POSTFORM library files to make them better fit your needs.
The first line in a post file contains the word name followed by the name of the post. The file
can be several pages long. The POSTFORM files consists of the contents of several post
files appended together. To add a post, append the contents of the post file to the
POSTFORM file. To delete a post from a POSTFORM file, delete the name line for that post
and all the following lines up to the next name line.

2.2.2.1

Creating an MPost Post File

IF the SURFCAM post library does not contain one of these earlier posts for your
machine, you can create one. SURFCAM is shipped with two post template
files: Generic.M and Generic.L. These files contain a set of quasi-standard
characteristics for mills and lathes. By taking the machine characteristics provided by
the manufacturer, you should be able to modify one of these generic post template files
with a text editor to produce a post for your machine.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.2.2.2

37

Running an MPOST Post Processor

These post processors are run from the NC Operations Manager dialog box.

Figure 4: NC Operations Manager dialog box

From the NC Operations Tree, select the NC operation or set of operations you want to
post process. Then double-click List All in the NC Post List box. This will display a menu
of the available posts.

Figure 5: Choose a Machine dialog box

Specify the machine tool by clicking on its name and number. Then click OK.
Depending on the post you select and the parameter values you enter in the Tool
Information dialog box, a series of additional dialog boxes may be displayed prompting
you to enter additional data. The following examples prompt you to enter values for work
offset number and program number.
Copyright 2000 by Surfware, Inc. All Rights Reserved.

38

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Figure 6: Examples of dialog boxes requesting additional information


After you have responded to any prompts for additional information, the post processor will
create the final NC codeusing the data from the toolpath file(s) and the postand save it
as an NCC file with a file name that is automatically assigned by the NC Operations
Manager. This newly created NCC file will then automatically be loaded into the SURFCAM
Editor and displayed on the screen.

Figure 7: An NCC file displayed in the SURFCAM Editor


You can now modify the NCC file, if needed, and re-save it. If the assigned file name is not
acceptable, now is the best time to use the Save As command to assign a more useful name.

2.3

THE SURFCAM.PST FILE

The SURFCAM.PST file contains commands that are used by the NC Operations Manager when
performing functions related to post processing. It also contains other commands, not related to
post processing, that can be executed from the NC Operations Manager dialog box.
To work with the SURFCAM.PST file you must become familiar with its structure and contents. It
is located in the C:\SURFCAM\surf2000 directory. It would be helpful to obtain a printed copy of
the file to study. You can do this by opening the file in any text editoror double-click on the file
name to open it in the SURFCAM Editorand printing it from there.
We will first look at the structure of the PST file and then consider the meaning of the commands
contained in it.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

39

# sign
The # sign placed at the beginning of some lines designates a comment line that will be
ignored when the file is read by the NC Operations Manager. The comment lines at the
beginning of the file form a heading while those at the end provide a file description. Those
used throughout the rest of the file act as separators.
Begin Post
Refer to Section 2.3.1: PST BeginPost Sections on page 39.
Post Item
Refer to Section 2.3.2: PST PostItem Sub-Sections on page 40.
Commands
Execute the commands contained in the PST file using the NC Operations Manager dialog
box. Some are executed by clicking buttons located on the toolbar. Others are executed by
double-clicking on an entry in either the Post List box or the Filter List box. Clicking once on
an entry and clicking the Post button also works.
Refer to Section 2.3.3: PST File Commands, Variables and Switches on page 41, and Section 2.3.4:
Special PST File Commands on page 42.

2.3.1

PST BeginPost Sections

The main commands in the PST file relate to post processing and are divided into six NC
mode sectionsEDM, Lathe, 2 Axis, 3 Axis, 4 Axis, and 5 Axis. The contents of these mode
sections determines what gets listed in the Post List box in the NC Operations Manager
dialog box. The NC Mode SURFCAM is in when the NC Operations Manager is opened tells
the Operations Manager which of these PST file NC mode sections to read. Following are
the first several lines in the 3 Axis mode section.

Figure 8: Begin Post 3 Axis with Post Item for MPost

Each NC mode section begins with a line that reads BeginPost <name> Default:<n> where
<name> is the name of the NC mode and <n> is a number designating which post in the Post
List box will be highlighted when the NC Operations Manager dialog box is first opened. A 4
Copyright 2000 by Surfware, Inc. All Rights Reserved.

40

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

indicates the fourth post in the Post List box will be highlighted. The highlighted post is
referred to as the default post.
Because NC mode sections begin with the Begin command they will also be referred to as
BeginPost sections.

2.3.2

PST PostItem Sub-Sections

BeginPost sections are divided into sub-sections which begin with the command PostItem.
Some PostItem sub-sections contain commands to run one of the SPOST post processors
SPOSTM or SPOSTLusing one of the SPOST posts.

Figure 9: Post Item for SPost

Such a PostItem sub-section begins with a line that reads PostItem <name> where <name>
is the name of the SPost post as it appears in the Post List box of the NC Operations
Manager dialog box.
Other PostItem sub-sections contain commands to run MPost.

Figure 10: Post Item for MPost

The first PostItem sub-section contains commands to run an MPost post processor (which,
by convention, means an MPOSTWIN, LPOSTWIN or EPOSTWIN post processor).
The APT-CL PostItem sub-section contains the commands to run the INC2APT program
which will convert the selected operations into the standard APT format used by many other
commercial post processors.

Figure 11: Post Item APT-CL


Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

41

The PostItem APT-CL sub-section will usually be the last in a BeginPost section.
The last command in each PostItem sub-section is a Task command. This causes the NCC
or APT output file to be loaded into the SURFCAM Editor and displayed on the screen.
Each PostItem line is followed by several lines of commands that accomplish post processing
using that post.

2.3.3

PST File Commands, Variables and Switches

The function of the commands following a PostItem line are as follows:


Status
Designates one line of help to be printed on the Status line of the NC Operations
Manager dialog box.
Command
Executes programs and Windows applications within SURFCAM using a command
expressed in the command line format.
ChDir
The change directory command.
Delete
Deletes a temporary file.
Rename
Renames a file.
CopyFile
Copies a file.
Task
Executes Windows applications for multi-tasking within SURFCAM.
The description of the variables appearing with the post commands is as follows:
%p
%q
%n
%s
%N
%S

256 character directory path (for example, c:\SURFCAM\INC\).


8 character directory path.
256 character file name with extension.
8 character file name with extension.
256 file name without extension (for example, 2DRIBS).
8 character file name without extension.

The description of the switches appearing with the post commands is as follows:
-I
-O

Input path ( for example %p%n ).


Output path ( for example c:\SURF2000\APT )

The order in which posts appear in each NC mode section is the order in which they appear
in the Post List box.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

42

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

The most significant line in a post sub-sectionfor the task of adding a postis the second
Command line, such as in the following example:
Command C:\SURFCAM\SURF2000\SPOST\SPOSTM C:\SURFCAM\APT\%N.apt 06
The first part of this command line (C:\SURFCAM\SURF2000\SPOST\SPOSTM) tells which
SPost post processor will be usedin this case, SPOSTM.exe for mills. The number at the
end of this line tells which post will be used in the post processing. This number corresponds
to the machine number designated by the last two digits in the file name for the postin this
case, UNCX01.P06, which is the post for the Haas VF-1 machine.

2.3.4

Special PST File Commands

The following command is listed near the end of the PST file. It is executed from the NC
Operations Manager toolbar. It creates a Setup Sheet.
SetupSheet

C:\SURFCAM\SURF2000\sview -m SSHEET.TXT

The next commands are executed from the Filter List box by clicking the appropriate entry
and clicking Filter Only or Post. Refer to Section 2.5.1: Arc Filter on page 43 to Section 2.5.2:
ArcFltrMx Filter on page 45 and to Section 2.5.3: NURB Filter on page 45.
IncFilter
#IncFilter
IncFilter

2.4

C:\SURFCAM\SURF2000\filters\ArcFltr.dll
C:\SURFCAM\SURF2000\FILTERS\ArcFltrMx.dll
C:\SURFCAM\SURF2000\FILTERS\NurbFltr.dll

MODIFY THE PST FILE


2.4.1

PST WIZARD

Use the PST Wizard to add or remove a Post or to


modify one. To open the wizard click Start > Programs
> SURFCAM 2000 > SURFCAM Tools > PST Wizard.
The Post Menu Wizard dialog box will be displayed.
Follow the prompts to make additions or modifications.

2.4.2

Change the Default Post

It is convenient to have your most frequently used posts pre-selected in the Operations
Manager Post List box. The post highlighted when you first open the NC Operations Manager
dialog box is the default post. Refer to Section 2.3.1: PST BeginPost Sections on page 39 for a
description of how the default post is determined.
To make your favorite post the pre-selected or highlighted one, first determine the number of
the position that your post holds in the Post List box. Then open SURFCAM.PST, using a text
editor such as the SURFCAM Editor. Change the number following Default: in the

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

43

BeginPost line to that number. Remember to Save the SURFCAM.PST file after you make
the change.

2.5

FILTERS
2.5.1

Arc Filter

This section describes the use of SURFCAMs arc filter program that converts a sequence of
linear moves, that approximate an arc, to a single arc move. The table below shows
corresponding lines of NCC file code from the same project. The sample on the left shows
code before filtering. The one on the right shows the corresponding code after filtering.
SECTION OF UNFILTERED CODE
SHOWING ALL LINE SEGMENTS
X.3588 Y3.3916
X.4565 Y3.46
X.5575 Y3.5224
X.662 Y3.5793
X.7697 Y3.6309
X.8807 Y3.6776
X.9948 Y3.7194

SAME SECTION WITH


FILTERED CODE SHOWING ONE ARC
X.3588 Y3.3916
G02 X.7697 Y3.6309 I.8892 J-3.1263
G01 X.8807 Y3.6776
X.9948 Y3.7194

EXPLANATION

EXPLANATION

The above seven lines of code describe


the creation of six line segments. Lines
1 through 5 describe four line segments
that approximate a small arc. Arc Filter
will convert these four segments to a
single arc.

Arc Filter has converted the old lines 2 through 5


to the single line 2, above. Line 2 is the G02 code
that describes an arc with center at (.8892, 3.1263), starting at the point (.3588, 3.3916) and
ending at the point (.7697, 3.6309). Line 3 is the
G01 code required to switch back to linear mode.

Run the SURFCAM arc filter program from the Operations


Manager dialog box. The Filter List boxbelow the Post
List boxcontains the SURFCAM filter options: <None>,
ArcFltr, ArcFltrMix (Section 2.5.2: ArcFltrMx Filter on page 45),
and NurbFltr (Section 2.5.3: NURB Filter on page 45).
ArcFltr can be run in conjunction with performing a post
processing operation. To do so, click ArcFltr before you
proceed with post processing.
Immediately after you double-click the desired post (or click
the POST button) to start the post processing, SURFCAM
will display the ArcFit dialog box to set parameters that will
control how the filtering will be performed.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

Figure 12: Filter List Box

44

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Figure 13: Arc Fit dialog box

Tolerance
This is the arc fitting tolerance. It is the maximum chordal deviation allowedthe
maximum distance between the line segments being optimized and the calculated arc.
HINT: You may want this to be generally the same (or same order of magnitude) as the
surface tolerance used to cut the tool path.
Minimum Radius
This is the smallest allowed arc radius. Any arcs found smaller than this value are output
as the original input line segments.
Maximum Radius
This is the largest allowed arc radius. Any arcs found larger than this value are output
as the original input line segments.
Arc In Plane
Arcs may be restricted to lie in a specified plane. The default is to arc in any best fit
plane. You can restrict arcs to XY, YZ, or ZX plane for machines that may not support
arc movement in any arbitrary plane.
UCS Planes Only
Use UCS Planes Only for best fit.
Fit Arcs Tangent
Arcs must be tangent to the current tool path position.
Fit Area Least Squares
Use Area Least Squares (ALS) Arc fitting function instead of the default Total Least
Squares (TLS) fit. ALS fit is much faster if you have a very large tool path, but may not
be quite as accurate a fit to the arcs. ALS method may also not produce quite as much
optimization as the TLS method.
After you make the desired parameter settings click OK. SURFCAM, will display the ArcFit
Optimizing Toolpath dialog box as it analyzes the tool path to convert linear moves to arc
moves.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

45

When finished with the arc filter, SURFCAM will then perform the rest of the post processing.

2.5.2

ArcFltrMx Filter

The ArcFltrMx filter analyzes linear 5 axis moves in the NC output and translates them into
separate XY and UV arc moves if they lie within a specified tolerance. This utility is
specifically useful for 4 axis wire EDM machines and 5 axis controls that support arc
interpolation. It is available on SURFCAM 4 Axis and above.
To use this, double-click the SURFCAM.PST file in the Explorer. The file will open in the
SURFCAM Editor. Locate the INC Filters section, then the line:
#IncFilter

C:\SURFCAM\SURF2000\FILTERS\ArcFltrMx.dll

The # symbol at the beginning of the line indicates that this line is a comment only.
Delete the # symbol and save the file. Then open SURFCAM. When you open the NC
Operations Manager, you will see the ArcFltrMx listed.

2.5.3

NURB Filter

This section describes SURFCAMs NURB filter program that analyzes sequences of linear
moves in an NC file and converts them to NURB spline moves.
The SURFCAM NURB filter program is run from the Operations Manager dialog box. The
Filter List box contains the SURFCAM filter options. Refer to Figure 12: Filter List Box on page
43. When the default option <None> is selected, no filtering will occur.
NURB Filter can be run in conjunction with performing a post processing operation. To do so,
click NurbFltr in the Filter List box before you proceed with post processing.
Immediately after you double-click the desired post (or click the POST button) to start the
post processing, SURFCAM will display the NURB Filter Options dialog box.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

46

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Figure 14: NURB Filter Options dialog box

Do not check linear moves for tolerance


All lines will be fit to splines without checking the Surface/Curve Tolerance parameter.
This is the fastest method. It is best used when the tool path is known to follow only
NURB curves.
Check tolerance for each NURB spline
Lines are fit to splines and the Surface/Curve Tolerance parameter is checked only
when the spline is completed. The spline is completed when records other than lines
are encountered, such as an Arc or an end of row. This is the fastest method to use
when the toolpath is known to follow some NURB curves.
Check tolerance for every linear move
Check the Surface/Curve Tolerance parameter as each line is added to fit a spline. This
is the slowest method.
Surface / Curve Tolerance
The maximum deviation of the spline from the original line segments will be kept to less
than this value.
Check Points Per Span
Specify the number of points along each span of the NURB curve to check the distance
against the tolerance value.
Note

The following parameters relate to optimizing splines. Refer to the online


SURFCAM Reference Manual, Chapter 1: Menus and Dialog Boxes, Optimize on page
61.

Do Not Optimize
NURB spline moves are created by interpolations that use the original data points
describing linear moves. No data points are discarded. This results in the fastest time
through the NURB filter but the most data sent on to the post processor.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

47

Use SURFCAM Spline Optimization


Use the optimization method used by the Create > Spline > Optimize and the Edit >
Splines > Optimize commands. Optimization is achieved by discarding some of the
original linear data points resulting in fewer nodes and control points (that describe
spline moves) being sent to the post processor.
Use Total Least Squares Optimization
This usually results in the greatest number of data points being discarded, thus
providing maximum optimization. Due to the number of calculations required, this
method results in the slowest time through the NURB filter.
Optimize Deviation
This is the maximum deviation to be allowed between the original linear moves and the
resulting NURB spline moves.
After you make the desired parameter settings, click OK. SURFCAM will display the NURBS
Optimizing Toolpath dialog box as it analyzes the tool path to convert linear moves to arc
moves.
When finished with the filter, SURFCAM will then perform the rest of the post processing.

2.6

POST PROCESSOR CONFIGURATION

With this section, we begin the main purpose of this chapter: a discussion of the post processing
package referred to as MPOST. This package consists of the following three post processors:
MPOSTWIN.EXE
LPOSTWIN.EXE
EPOSTWIN.EXE

Mill machines
Lathe machines
Wire EDM machines

These post processors convert generic INC files into a variety of standard EIA / ISO,
conversational, and columnar style NC code formats.
The EIA standard requires that every address or word of the NC program language is a letter
followed by a number. This format usually uses G, X, Y, Z, and/or M codes for various machine
operations and functions. The output format can be Standard G code, Conversational, or
Columnar.
The following example program sections indicate the different code formats:
STANDARD EIA / ISO

CONVERSATIONAL

O1

BEGIN PGM 1 INCH

M6 T1 ( Tool Radius: 0.25 Tool Diam: 0.5 Tool Corner: 0

0 TOOL DEF 8 L+0 R0.25

G0 G90 S760 M3 E1 X0.9417 Y-2.212 A0

1 TOOL CALL 8 Z S760.0

H1 M9 Z1.

2 L X+0.9417 Y-2.212 R F6000 M6


Figure 15: Standard G code / Conversational
Copyright 2000 by Surfware, Inc. All Rights Reserved.

48

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

STANDARD EIA / ISO

CONVERSATIONAL

G0 Z0.5

3 L Z+1. R F6000 M13

G1 Z0 F4.

4 L Z+0.5 R F6000 M

X1.5638 F9.

5 L Z+0 R F40 M

Y-2.0875

6 L X+1.5638 Z+0 R F90 M

G2 X1.1215 Y-1.7203 I0 J0.45

7 L Y-2.0875 Z+0 R F M

X0.9209 Y-1.373 I0.7923 J0.689

8 CC Y-1.6375

Y-0.6896 I0.2929 J0.3417

9 C X+1.1215 Y-1.7203 DR- R F M

X1.1183 Y-0.346 I0.9929 J-0.3417

10 CC X+1.9138 Y-1.0313

G1 X0.9509 Y0.1139

11 C X+0.9209 Y-1.373 DR- R F M

G2 X0.9002 Y0.1494 I0.2322 J0.3855

12 CC X+1.2138 Y-1.0313

G1 X0.3196

13 C X+0.9209 Y-0.6896 DR- R F M

Y-2.212

14 CC X+1.9138 Y-1.0313

X0.9417

15 C X+1.1183 Y-0.346 DR- R F M

G0 Z1.

16 L X+0.9509 Y+0.1139 Z+0 R F M

M5 M9

17 CC X+1.183 Y+0.4994

G0 G49 G90 Z0

18 C X+0.9002 Y+0.1494 DR- R F M

E0 X0 Y0

19 L X+0.3196 Z+0 R F M

M2

20 L Y-2.212 Z+0 R F M
21 L X+0.9417 Z+0 R F M
22 L Z+1. R F6000 M
23 L Z+0 R F6000 M91
24 L X+0 Y+0 M2
25 END PGM 1 INCH
Figure 15: Standard G code / Conversational (Continued)

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

5
10

49

1
0

90

15

9417

-22120

760
13

20

78

25

9417

-22120

30

79

9417

-22120

40

35

79

15638

-22120

-7071

7071

90

40

79

15638

-20875

-7071

-7071

90

45

11215

-17203

15638

-16375

-9003

-4353

90

50

9209

-13730

19138

-10313

-8271

-5620

90

55

7638

-10313

12138

-10313

-10000

90

60

9209

-6896

12138

-10313

-8271

5620

90

65

11183

-3460

19138

-10313

-9837

1800

90

70

79

9509

1139

-7719

-6357

90

75

9002

1494

-3333

-9428

90

80

79

3196

1494

7071

-7071

90

85

79

3196

-22120

7071

7071

90

90

79

9417

-22120

-10000

90

95

81

11830

4994

26
Figure 16: Columnar

Many different formats can be created and revised for each type of machine/control combination.
These formats are described in the user configurable POSTFORM file.
The post processor receives data from the POSTFORM library to create the NC code. These files
are completely user configurable for the machine format desired. The POSTFORM libraries are
listed below for the appropriate machine tool types.
POSTFORM.M
POSTFORM.L
POSTFORM.E

MPOSTWIN.EXE
LPOSTWIN.EXE
EPOSTWIN.EXE

Milling machines
Lathe machines
Wire EDM machines

Additional posts are available that can be added to the POSTFORM library files if you need them.
Refer to Section 2.23: POST Sample Libraries on page 159.

2.6.1

Inc Files

Before the final NC code can be created, toolpaths for cutting operations on a part must first
be created. For the purposes of this chapter you can assume that each separate toolpath is
Copyright 2000 by Surfware, Inc. All Rights Reserved.

50

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

stored as an INC file within a larger file called an ICD file. The letters INC refer to Intermediate
Numerical Code. This is SURFCAMs version of the traditional CL or cutter location file. Refer
to the SURFCAM Getting Started Manual, Chapter 2: NC Project Basics starting on page 51.
These INC files store instructions on how the tool is changed, how it is positioned, how it cuts,
and various other machining information such as spindle speeds and feed rates. These files
are machine tool independent so they must be converted into actual CNC instructions (G
codes) later.
The merged INC files from an ICD file provide data to the post processor on how the part is
to be cut. The data in the POSTFORM libraries provide it information about the machine
doing the cutting. With data from these two files the post processor creates the final NC code.
With SURFCAM you can generate NC programs in a local coordinate system. Thus you can
machine different sections of the work with independent machining orientationsa necessity
with most parts. SURFCAM can be used to change the machining orientation of the part by
using construction views. This is accomplished by setting the CView (construction view)
parameter to the number of the view that matches the machining orientation of the piece
currently being cut.
Note:

2.7

SURFCAM defaults to machining in CView:1 (Top View). Machining in another


view requires setting the CView parameter to the desired view number and
indicating VIEW for the coord parameter in the status area before cutting.

POSTFORM STRUCTURE

You can configure the post processor for the desired NC code output format. This output format
is directed by the POSTFORM file used. These formats can be configured for machine control
types, output style, or variations of usage.
To create or modify machine code formats, edit the contents of the POSTFORM file with a text
editor. This can be accomplished using the SURFCAM Editor.
When the POSTFORM file is edited for each machine format, the post processor should generate
the proper NC code. In addition to EIA / ISO formats, the post processor can also create programs
using a columnar or conversational format.
The following sections cover the general Post Processor structure for Mill, Lathe, and Wire EDM
machines. The machine type sections cover the specific structure for the individual machine types.

2.7.1

NC Code Format

The post expects to find the NC code formats in the POSTFORM file written in a particular
way. File modifications must be made according to the rules outlined in this document.
Following is the structure the post expects to find in the POSTFORM file:
1. A command word, such as Name, followed by a semicolon (;).
2. A single space separating the word from the instructions.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

51

3. A strictly formatted series of characters and/or lines instructing the post how to process
the command.
The POSTFORM file requires that each numerical designation be enclosed with the Greater
Than and Less Than signs, for example G0. You must bracket numerical values because the
post accepts not only numerical values, but also variables. You can direct the post to a
particular and significant numerical value assigned to a particular address, but it is a value
that changes. The brackets delimit the numbers or variables that are in the POSTFORM file
and are not output in the resultant NC code.

2.7.2

Comments

If there are two or more adjacent spaces on a line, the post will consider anything following
to be a comment. Put comments in the file in either of two ways:
1. Move the cursor three or more spaces past the end of a command line, then type the
comment.
2. Type any comment on its own line. Be sure that the line has two or more leading spaces.
Note:

Be careful not to accidentally "comment out" part of the actual formatting


information by entering two spaces instead of one.

2.7.3

Name

Multiple machine formats can be stored in the POSTFORM file. The Name line indicates the
name of the next machine or controller that will appear in the menu when the post is run. The
text following the word Name will appear on the screen as a menu choice. The name line
indicates the beginning of the format section for that particular machine. The lines following
the Name line describe the configuration of the post until the next Name line appears. The
examples below indicate a variety of names that can be used. These names are listed when
the Post is executed.

name Fanuc
name Fanuc Incremental
name Fanuc Metric
name Heidenhein Conversational
2.7.4

Case Sensitivity

The case sensitivity of the entries made in the POSTFORM file is dependent upon the data
entered. The only entries that must be in upper case characters are those that are required
by the machine tool to be upper case. These are typically the Word Address characters.
Commands, sequences, and variables can be entered as either upper or lower case
characters.
Note:

When lower case character output is desired, the entire POST file should be in
lower case characters. When a single letter code is required to be in lower case
characters, all entries for that letter code should be in lower case characters.
Copyright 2000 by Surfware, Inc. All Rights Reserved.

52

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

This manual uses upper case characters for the first letter of each word of the commands
and sequences. All variable entries are in lower case characters.

2.7.5

Entry Types

The POSTFORM file consists of four separate entry types. These include the following:

Word Address Formats


Commands
Sequences
Variables
Each of these types can be placed in different sections of the POSTFORM file. This section
describes each type in alphabetical order for ease of reference. The right margin of the entry
indicates the valid Post processor type for that entry. This is indicated by the letter M for
MPOSTWIN.EXE, L for LPOSTWIN.EXE, and E for EPOSTWIN.EXE post processors.

2.8

STRUCTURED LOGIC

The post offers limited structured logic capabilities. This functionality allows logical decisions when
necessary. The following describes the format and required syntax.

2.8.1

IF, ELSE, and ENDIF Statements

IF, ELSE and ENDIF statements can now be added to your machine format to either allow
or disallow any lines in the sequence.
The IF line must have 3 parameters: 2 VARIABLES (or a variable and a constant) with a 1 or
2-character logical operator between themall items separated by a single space.
The ELSE line (which is optional) and ENDIF line cannot have any "parameters."
Following are some sample "IF" lines:

IF [Val1] = 2
IF [Tool] > 24
IF [Speed] <= 50
If [Cycle] = 19

2.8.1.1

Restrictions

1. IF can only be used within a sequence or canned cycle.


2. An ENDIF line is required (even if there are no more lines after ENDIF within that
sequence).
3. The ELSE line is optional.
4. The IF, ELSE and ENDIF lines must have at least 1 line of "code" between them.
5. IF statements cannot yet be nested.
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

53

6. You are limited to fifty IF structures within each machine format area.

2.8.2

Operators

Legal operators are >, <, =, <> (not equal), <= and >=
Following is an example of a tool change sequence using logic to control dual-range spindle
speed (M41,M42) and suppression of the pre-indexing of the last tool. (Blank lines were
added for clarity to separate the "logic" sections from the rest of the sequence):

Toolchange
M<9>
G<28> G<49> Z<0> S<100>
N<Block> M<6>
This "IF" structure sets the "gear range" (M41 or 42):

IF [Speed]>500
G<0> G<40> G<80> G<Work> X<H> Y<V> M<42>
ELSE
G<0> G<40> G<80> G<Work> X<H> Y<V> M<41>
ENDIF
G<43> Z<D> H<Lcomp> M<Direct> S<Speed>
M<Cool>
Here the pre-indexing of the last Tool is suppressed:

IF [NextTool] <> [Tool1]


T<NextTool>
ENDIF
END
As you can see, either one or both of the 2 values must be a [variable]. It may be a variable
that is set from an ASK statementletting you give the operator a set of processing "options."

2.8.3

The Set Command

The SET command allows a variable to be set to any other variable or constant. Place this
within an IF structure, and you can set a variable to a number.
Following is an example of how to support spindle ranges:
1stToolchange
G0 G90 G80 G40 G17
T[Tool] M6
Set [Val2] to 65

This line sets the "default" spindle range.

If [Speed] > 1000

This is the "IF" line.


Copyright 2000 by Surfware, Inc. All Rights Reserved.

54

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Set [Val2] to 66
endif

Replace the line of code with a "SET"...

If [Speed] > 2000


Set [Val2] to 67
endif

...and we do it againone If/Set structure for


each range you want.

If [Speed] > 3000


Set [Val2] to 68
endif
If [Speed] > 4000
Set [Val2] to 69
endif
G[Val2] M[Direct] S[Speed]

This line will output the code you want.

G0 G[Work] X[H] Y[V]


G43 Z[D] H[Lcomp]
M[Cool]
End

2.9

WORD ADDRESS FORMATS: MILL, LATHE, EDM

This is a series of lines that each start with a specific character, usually a letter, followed by some
numbers and signs. It is a list of all the characters that the NC machine needs, in the order they
appear on any line of NC code. You can add, change, and delete lines so that they are arranged
in the order appearing in a line of NC code. The examples below indicate the Word Address format
and the output order.
These examples show a portion of the Word Address and Tool Change code with the
corresponding NC code that is output.

% 00
O>4
X ->3.>4
Y ->3.>4
Z ->3.>4
F >2
G >2
S >4
M >2
ToolChange
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

55

M6 T[tool]
G0 G90 S[speed] M3 X[h] Y[v]
Z[h] G1 F[plunge]
End
The NC code for this POSTFORM.M excerpts is shown below. The letter output is determined by
the order of the Word Address Formats.

M6 T2
X1. Y2.5 G0 G90 S2000 M3
Z.1 F3.5 G1
The next example uses the same Tool Change sequence with the Word Address Format order
changed. The example indicates the NC code output change as it is effected by the
POSTFORM.M change.

% 00
O>4
G >2
S >4
M >2
X ->3.>4
Y ->3.>4
Z ->3.>4
F >2
ToolChange
M6 T[tool]
G0 G90 S[speed] M3 X[h] Y[v]
Z[h] G1 F[plunge]
End
The NC code for this POSTFORM.M excerpt is shown below. The letter output is determined by
the order of the Word Address Formats.

M6 T2
G0 G90 S2000 M3 X1. Y2.5
G1 Z.1 F3.5
The Word Address characters are formatted according to the following information.
These entries are valid for all SURFCAM post processors.
/ 00
The 00 indicates that the character is output without numbers. This is normally used for the
block skip character as shown.
N >4
This outputs the letter N with up to 4 numerals. There is no minus sign or decimal point
output.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

56

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

X ->3.>4
This format outputs the X address character with up to 3 numerals to the left and 4 numerals
to the right of the decimal point. The decimal point is output. The minus sign is output when
applicable.
F >32
The F character is output with up to 3 numerals to the left and 2 numerals to the right of the
decimal point. The decimal point and the minus sign are not output. This format will output
trailing zeros, for example, the code F200 is output for an F-2.0 value.
G2
The G character is always output with 2 numerals. Leading zeros are output for single digit
numbers. The code G02 is output for a value of 2.
R +->24
The R address is output with a plus sign unless it is a minus value. The output has 2 numerals
to the left and no less than 4 numerals to the right of the decimal point. The decimal point is
not output. Trailing zeros are output to fill the 4 numerals to the right of the decimal. The code
of R+15000 is output for an R1.5 value.
COLUMNAR STYLE FORMATS:
T C27 S5 >4 T
The T address will appear with the T in column 27; the complete word will occupy 5 spaces
(up to 4 of which will hold the actual numerical information).
K C14 S6 >32
The K address starts at column 14 (but NO K is output); it has no minus sign, and occupies
6 spaces (up to 3 of which are before the invisible decimal).
When required by the machine tool, commas can be used instead of decimal points. The
MPOSTWIN accepts characters with the ASCII values between 33 (!) and 122 (z).
DETAILS AND EXAMPLES OF LETTER FORMATS:
The maximum possible format is something like this:
? Caa Sb +->c.>d x Limit -40 40 Mult 25.4 Add 2.5 Inc
where "?" is the character (usually a letter) to be formatted, each "n" can be any numeral, and "x"
is an optional character.
Caa
The number following the C denotes the column number at which this word starts.
Note:

There is a space after the number to separate this information from the next part.
(Columnar only)

Sb
The numeral after the S determines how many spaces this word will take in the NC block.
Note:

The column number and spaces number are used only for columnar programs.
(Columnar only)

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

57

+ (plus sign)
This causes the post to output a plus sign on the number if it is not negative. It must be the
first formatting character in this line of the POSTFORM file, if used.
X +>3.>4
INC FILE VALUE

NC CODE OUTPUT

2.5

X+2.5

-1.3000

X-1.3

0.2135

X+.2135

When no sign is entered, the value is output without a sign.


X >3.>4
INC FILE VALUE

NC CODE OUTPUT

2.5

X2.5

-1.3000

X1.3

0.2135

X.2135

- (minus sign)
This causes the post to output a minus sign on the number if it is indeed a negative value. It
must be the next formatting character if a minus sign is ever to be used for this character
address.
X ->3.>4
INC FILE VALUE

NC CODE OUTPUT

2.5

X2.5

-1.3000

X-1.3

0.2135

X.2135

When both the + and - signs are entered the appropriate sign is output with the value.
X +->3.>4
INC FILE VALUE

NC CODE OUTPUT

2.5

X+2.5

-1.3000

X-1.3

0.2135

X+.2135

Copyright 2000 by Surfware, Inc. All Rights Reserved.

58

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

> (greater than)


This symbol indicates the number of numerals to output for the letter code. When the decimal
is placed before this symbol it indicates the number of numerals after the decimal. When it is
placed before the decimal it indicates the number of numerals before the decimal. This
symbol causes no leading zeros to be output in the address. When this symbol is not used,
the post will add leading zeros so that the number of digits will always be the number that
follows the greater than sign.
X >3.>4
INC FILE VALUE

NC CODE OUTPUT

2.5

X2.5

-1.3000

X1.3

0.2135

X.2135

This Word address without the first > symbol forces the output of leading zeros.
X 3.>4
INC FILE VALUE

NC CODE OUTPUT

2.5

X002.5

-1.3000

X001.3

0.2135

X000.2135

This Word address without both > symbols forces the output of leading and trailing zeros.
X 3.4
INC FILE VALUE

NC CODE OUTPUT

2.5

X002.5000

-1.3000

X001.3000

0.2135

X000.2135

c (a numeral)
This is always a single digit that indicates the number of digits available. In this example, it is
the number of digits before the decimal point.
If the above > symbol is used, then this is the maximum number of digits that can appear
before the decimal point.
If the above > symbol is not used, then this is the number of digits that will always appear
before the decimal point.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

59

G >2
INC FILE VALUE

NC CODE OUTPUT

01

G1

00

G0

G3

G2
INC FILE VALUE

NC CODE OUTPUT

01

G01

00

G00

G03

. (decimal point)
The presence of the decimal point in the line indicates that the address outputs a decimal
point. If this character is not used, it will not be output in the NC code.
X >3.>4
INC FILE VALUE

NC CODE OUTPUT

2.5

X2.5

-1.3000

X1.3

0.2135

X.2135

When the decimal point is not placed in the Word address format, it is not output in the NC
code. The following example shows that this may not be suitable code for the machine. When
the decimal is not in the Word address the > symbols should be removed to ensure proper
NC code as displayed in the next example.
X >3>4
INC FILE VALUE

NC CODE OUTPUT

2.5

X25

-1.3000

X13

0.2135

X2135

Copyright 2000 by Surfware, Inc. All Rights Reserved.

60

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

X 34
INC FILE VALUE

NC CODE OUTPUT

2.5

X0025000

-1.3000

X0013000

0.2135

X0002135

d (another numeral)
This is always a single digit that indicates the number of digits available. In this example it is
the number of digits before the decimal point.
If the above > symbol is used, then this is the maximum number of digits that can appear
before the decimal point.
If the above > symbol is not used, then this is the number of digits that will always appear
before the decimal point.
G>2
INC FILE VALUE

NC CODE OUTPUT

01

G1

00

G0

G3

G2
INC FILE VALUE

NC CODE OUTPUT

01

G01

00

G00

G03

x - OUTPUT character
This is used to replace a character described in the format with another character in the NC
program. This is useful when the same letter must be formatted differently when used in
different places. In some controls, any negative Z value with a minus is usually below the Z0
point, but in the case of drilling cycles, no minus sign is required for the Z. The example below
shows that the letter Z is output when the letter A is used in the POSTFORM file.
A >3.>4 Z
Below is a sample line of a POSTFORM sequence using this output character.
G81 X[h] Y[v] A[d] F[frate]

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

61

This line shows the NC code output using the line in the POSTFORM file.
G81 X2.5 Y1.25 Z.5 F20.
In other words, the post formats for A, but outputs a Z word address.
Note:

When the open parenthesis "(" is used as the output character, as in the case of
the Dynapath conversational control, the closed parenthesis ")" is automatically
coded at the end of the character output. The following code shows this use for G
codes in the Dynapath post.

G 02 (
INC FILE VALUE

NC CODE OUTPUT

01

(01)

00

(00)

(03)

The output letter can be suppressed by placing empty quotes at the end of the letter format.
For example this can be used to suppress the letter N for line numbers. Below, the letter N
is suppressed while the line number is output.
N >4 ""
The examples use the following sequence line.
G0 G90 S[speed]
INC FILE VALUE

NC CODE OUTPUT

1 G0 G91 S1000

23

23 G0 G90 S1000

3237

3237 G0 G90 S1000

When the "" symbols are not placed in the Word address the output is as shown below.
INC FILE VALUE

Note:

NC CODE OUTPUT

N1 G0 G91 S1000

23

N23 G0 G90 S1000

3237

N3237 G0 G90 S1000

The Output character can be used to get around many common formatting
problems.

Columnar style
The output character for columnar style programs works slightly differently when formatting
a columnar style program. The Spaces line designates a format as columnar. If no output
Copyright 2000 by Surfware, Inc. All Rights Reserved.

62

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

character is specified, a space will be output in place of the letter, instead of the letter itself.
In the examples with Columnar style formats, the T is repeated at the end of the T format line.
When the letter is not repeated at the end of the line, the letter is not output in the NC code.
Note:

The output letter must be placed on the line before any modifiers.

Limit
This format limits the acceptable value for the word address. When this limit is reached an
error message is output to the screen for you to make a correction. The first numeral
indicates the minimum value for the output and the second numeral indicates the maximum
value. The example below indicates that the value of the S word can be between 0 and 5000.
When the file is post processed, the Word address is error checked for the limit set in the
format.
S 4 Limit 0 5000
INC FILE VALUE

NC CODE OUTPUT

S1

6000

ERROR Message

3237

S3237

When the lower limit is above zero, the output uses this value when the INC file value is less
than the limit.
S 4 Limit 250 5000
INC FILE VALUE

NC CODE OUTPUT

ERROR Message

6000

ERROR Message

3237

S3237

Note:

Limit checking is not performed on Replace statements.

Note:

Limit values are absolute. When the output is incremental, the absolute value of
the letter is checked for the limit.

Mult
The value after this command is used as a multiplier for all the values that will output for this
word. The value entered can be either a number value or a Word Address Letter. The current
value of the Word Address letter is used for the Mult function. The following example will
output metric values.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

63

X ->3.>4 Mult 25.4


INC FILE VALUE

Note:

NC CODE OUTPUT

11

X279.4

2.5

X63.5

.2135

X5.4229

Division is accomplished by multiplying by the inverse.


Mult .03937 converts metric to inches.

Add
The value after this command will be added to all the output for this word. The value entered
can be either a number value or a Word Address Letter. The current value of the Word
Address letter is used for the Add function. The example below can be used to shift the output
location of any character. Add a negative number to subtract.
X ->3.>4 Add 10
INC FILE VALUE

NC CODE OUTPUT

11

X21.

-2.5

X7.5

.2135

X10.2135

Abs/Inc
All output for this word will be incremental. The default is absolute. It can be coded although
it is not necessary. The example below outputs the Y values incrementally. The examples
below indicate the Y incremental move values based on the starting point of Y0. The INC file
values are absolute locations output by SURFCAM from Y0.
Y ->3.>4 Inc
INC FILE VALUE

NC CODE OUTPUT

11

Y11.

-2.5

Y-13.5

.2135

Y2.7135

IncSign
Used as a qualifier for rotary axis positioning. When added to the Word address format, it
causes the sign of the output to designate the direction of rotation.
These example A axis motions are within the 118 degree to 350 degree marks of the rotary
table and begin at 260 degrees.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

64

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

A ->3.>3 Limit -359.999 0 Incsign


INC FILE VALUE

NC CODE OUTPUT

270

A+270.

118

A-118.

350

A+360.

A ->3.>3 Limit -359.999 0


INC FILE VALUE

NC CODE OUTPUT

270.

A+270.

118.

A+118.

350.

A+360.

IncFrom
This is used to define the Word address as incremental from the letter entered. This is
typically used for 4 axis Wire EDM programming. The example below outputs the U value
incrementally from the last absolute value of X. The INC file values are the successive
absolute X axis values.
U ->3.>4 IncFrom X
INC FILE VALUE
X VALUE

NC CODE OUTPUT

U VALUE

1.

2.

U1.

2.5

-3.2

U-5.7

.2135

.125

U.0995

Modal
The Modal modifier prevents the post from repeating the same values on later lines when the
value has not changed. The INC file values are successive lines.
F >2 Modal
The following sequence line is used for this example.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

65

X[h] Y[v] F[frate]


INC FILE VALUE
X

Note:

NC CODE OUTPUT
F

1.

X0 Y0 F1.

1.5

2.5

1.

X1.5 Y2.5

2.

3.

1.

X2. Y3.

1.3

2.

2.

X1.3 Y2. F2.

Modal Word address letters can also be specified with the ModalLetters command.

Force
This modifier requires the post to output the letter on each line. When the letter is required
on each line without the value, use the Modal modifier with the Force modifier.
F >2 Force
The following sequence line is used for this example.
X[h] Y[v] F[frate]F >2 Modal Force
INC FILE VALUE
X

NC CODE OUTPUT
F

1.

X0 Y0 F1.

1.5

2.5

1.

X1.5 Y2.5 F1.

2.

3.

1.

X2. Y3. F1.

1.3

2.

2.

X1.3 Y2. F2.

The following sequence line is used for this example.


X[h] Y[v] F[frate]
INC FILE VALUE
X

NC CODE OUTPUT
F

1.

X0 Y0 F1.

1.5

2.5

1.

X1.5 Y2.5 F

2.

3.

1.

X2. Y3. F

1.3

2.

2.

X1.3 Y2. F2.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

66

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

The order in which these modifiers are placed on the line is not important. The order in which they
are performed is not dependent upon the order in the line. The performance order is as follows:
1. The original value is multiplied with Mult.
2. Addition is accomplished after Mult.
3. The result of these two is checked for defined limits.
4. The result is then converted to incremental when Inc or IncFrom is used.

2.10

COMMANDS

Commands are used by the post processor to identify information necessary to format the
program correctly. These commands can be placed in any order. They should be placed before
the sequence section of the machine file. These commands are generally grouped by their
prospective function.
1. 2ndCircleCode (p. 67)

23. Each (p. 74)

42. Rapid (p. 79)

2. ArcPlane (p. 67)

24. EOB (p. 75)

43. RenumSubs? (p. 80)

3. ArcWithSame? (p. 67)

25. Feed (p. 75)

44. Replace (p. 80)

4. ArcWithLine? (p. 67)

26. FeedCode (p. 75)

45. RevSigns (p. 81)

5. Ask (p. 68)

27. FeedType (p. 75)

46. RevTurret2? (p. 81)

6. ByDiameter? (p. 69)

28. First#? (p. 76)

47. ReturnPlane (p. 80)

7. ByQuadrants? (p. 70)

29. HCode (p. 76)

48. Sequence#s (p. 81)

8. CCW (p. 70)

30. HCode2 (p. 76)

49. Spaces (p. 83)

9. CDC (p. 70)

31. Helical? (p. 76)

50. Spaces? (p. 84)

10. CircDir (p. 70)

32. Inc/Abs (p. 77)

51. SpeedCode (p. 84)

11. Comment (p. 71)

33. Inch/MM (p. 77)

52. SpeedType (p. 84)

12. Coolant (p. 71)

34. Incremental? (p. 77)

53. Spindle (p. 84)

13. CtrCode (p. 71)

35. Last#? (p. 77)

54. Subs1st? (p. 84)

14. CtrCode>180 (p. 72)

36. LComp (p. 77)

55. Tolerance (p. 85)

15. CtrCode360 (p. 72)

37. Leading0s? (p. 78)

56. Tools (p. 85)

16. CtrIncremental? (p. 72)

38. MaxRad (p. 78)

57. UpperCaseComments? (p. 85)

17. CW (p. 73)

39. MinRad (p. 78)

58. VCode (p. 85)

18. DCode (p. 73)

40. Mod (p. 78)

59. VCode2 (p. 86)

19. DCode2 (p. 74)

41. Modality
ModalGs (p. 78)

60. VRapid (p. 86)

20. DComp (p. 74)

61. Work (p. 86)

21. Drive (p. 74)

ModalLetters (p. 79)

62. WorkDefault (p. 86)

22. Dummy (p. 74)

Force (p. 79)

63. ZRestart? (p. 86)

Figure 17: Postprocessor Commands

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

67

Commands that are used in the POSTFORM files followed by a question mark (such as Spaces?)
are called switches. These switches refer to various conditions required by the NC machine that
can be turned on or off with a YES or NO indication. This is accomplished by placing a Y or N after
that word.
1. 2ndCircleCode Mill, Lathe, EDM
Some NC machines cannot process a circular move in just one block of program information. For
these machines a second line is used to indicate whatever information could not be given on the
first line. 2ndCircleCode is used to describe the NC word that initiates this second line of
information. Some machines require a code to identify the second line of the arc information. This
is sometimes an M99 code.

2ndCircleCode M99
Related Commands: CtrCode, ByDiameter?, ByQuadrants?, CtrIncremental?
2. ArcPlane Mill Only
This command sets the plane for Circular interpolation in XY, YZ, XZ planes. This command must
be placed before the CtrCode Command. Example: ArcPlane G 17 18 19 # Arc Plane Selection
To use this feature of MPOST, the CtrCode needs to have the K letter added after I J.
Example: CtrCode I J K
Refer to CtrCode Mill, Lathe, EDM on page 71.
3. ArcWithLine? EDM
This command is used for 4 axis EDM only. It is used to break G2 and G3 arc moves into G1 linear
moves. It is used in conjunction with the MaxRad command that defines the chordal breakdown
value of the G1 linear moves.
This command defines whether the machine tool can accept arcs and lines for 4 axis cuts. When
the command is entered with the Y, the EDM machine can accept an arc on one path with a line
on the other. When the N is entered the arcs are broken into line segments based on the MaxRad
values entered.
With the example below the output is with arcs and lines.

ArcWithLine? Y
With this example the arcs are broken into line segments based on the MaxRad command.

MaxRad 99 .001
ArcWithLine? N
Related Commands: ArcWithSame, MaxRad
4. ArcWithSame? EDM
This command is used for 4 axis EDM only. It is used to break G2 and G3 arc moves into G1 linear
moves. It is used in conjunction with the MaxRad command that defines the chordal breakdown
value of the G1 linear moves.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

68

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

This command defines whether the machine tool can accept arcs on both cut paths for 4 axis cuts.
When the command is entered with the Y the EDM machine can accept an arc on both cut paths.
When the N is entered the arcs are broken into line segments based on the MaxRad values
entered.
With the example below the output is with arcs.

ArcWithSame? Y
With this example the arcs are broken into line segments based on the MaxRad command.

MaxRad 99 .001
ArcWithSame? N
Related Commands: ArcWithLine, MaxRad
5. Ask Mill, Lathe, EDM
You can set the value of a variable by responding to a prompt. The prompt is configured by the
user to be displayed prior to the post generating the code or the number of times a sequence is
executed. You can enter a default value that can be accepted by pressing the Enter key. You can
define any question for the prompt desired. The response to the question, either the default or
entered value, assigns a numeric value to the any variable name. These variables can be placed
in the POSTFORM file for any letter.
When the Ask statement is placed outside a sequence, it is only displayed one time for each tool
motion file. The value of the variable defined is used for the entire file.
The example below indicates the format for the Ask statement. This example is used for a lathe
cutoff cycle. The first quoted string is the prompt question, and the second is the optional default
value.

Ask [z] "What is the Z value for cutoff?" "-3"


Ask [val2] "What is the X value (Radius) position for cutoff>" "2"
Ask [speed] "What is the cutoff spindle speed?" "200"
The prompts above are used to enter the values for the cutoff sequence. These values can be
accessed in the EndCode sequence as follows:
EndCode
G0 Z.2
G28 U0 W0 M9 T[lasttool]
/0 M0
G50 X0 Z0
T1200 M[cool]
G96 S[val3] M[direct]
G0 Z[val1] X[val2] T1212
G0 X[val2]
G28 U0 W0 T1200
M30
End

# Cutoff spindle speed


# Cutoff Z, X values
# Clear to diameter

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

69

The NC code below uses the default values for the Ask statements.
G0 Z.2
G28 U0 W0 M9 T1100
/ M0
G50 X0 Z0
T1200 M8
G96 S200 M3
G0 Z-3. X2. T1212
G0 X2.
G28 U0 W0 T1200
M30
When the Post Processor is activated, the Ask prompts are displayed as follows:

ENTER a single SPACE to abort, or


What is the Z value for cutoff? (-3)
You can abort the post operation by pressing the space bar, then pressing the Enter key. To
accept the default value in parentheses, press the Enter key. To enter a value, key in the new
value and press the Enter key.
The Ask statement can also be placed within a sequence. You can prompt for information each
time the sequence is used by the post processor. In the example below you are prompted for a
work offset at each tool change.
ToolChange
Ask [val1] "What is the work offset number? " "54"
M6 T[tool]
G0 G[val1] X[h] Y[v]
S[speed] M[direct]
G43 Z[d] H[lcomp]
End
The output code using the default value for the Ask statement:
M6 T1
G0 G54 X0 Y0
S2000 M3
G43 Z.1 H1
6. ByDiameter? Lathe
This switch specifies that all X values are multiplied by 2 for global diameter output. Some
machines require a diameter output for turning. Enter a Y to output diameters.

ByDiameter? Y
Related Commands: 2ndCircleCode, CtrCode, ByQuadrants?, CtrIncremental?

Copyright 2000 by Surfware, Inc. All Rights Reserved.

70

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

7. ByQuadrants? Mill, Lathe, EDM


Many NC machines do not allow program arcs of more than 90 degrees in a single block of code.
The program must code the circular moves by quadrants. This is accomplished by breaking arcs
at the quadrant boundaries. To create a full circular move, you must program one block for each
quarter of the arc, and even break it into 5 arcs if the starting point of the arc is not on a quadrant
boundary. If the machine has this limitation, enter a Y after the ByQuadrants? command. When
the machine allows full circle programming in one block, enter N.
The following example uses a circle of radius 2.5, and a center at X0 Y0 being cut counter
clockwise from X2.5 Y0. The following lines will be produced depending on the ByQuadrants
option.
ByQuadrants? N
ByQuadrants? Y

# Outputs G3 Y0 I-2.5 J0
# Outputs the following:
G3 X0 Y2.5 I-2.5 J0
X-2.5 Y0 I0 J-2.5
X0 Y-2.5 I2.5 J0
X2.5 Y0 I0 J2.5

Related Commands: 2ndCircleCode, CtrCode, ByDiameter?, CtrIncremental?


8. CCW Mill, Lathe, EDM
This is the letter and number for counterclockwise arcs.

CCW G3
Related Commands: CW, CircDir
9. CDC Mill
This command is used to identify the two letters (usually P and Q) to be included on all movement
lines for the Cincinnati style DComp vectors.

CDC P Q
Related Commands: DComp, LComp
10. CircDir Mill, Lathe, EDM
Machines that have one event code for an arc move must also specify the direction of rotation.
This command must be followed by a letter and two numbers, the first for clockwise and the
second for counterclockwise moves.

CircDir D01 # There are no spaces between the numbers.


This places D0 on circular moves in the clockwise direction and D1 on the counterclockwise
moves.
Related Commands: CCW, CW

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

71

11. Comment Mill, Lathe, EDM


Comment indicates the CNC style comment start and end characters that the machine uses to
allow comments in the NC code. On some machines, comments must be enclosed in
parentheses.
The post processor will automatically output several lines of end user comments after the
StartCode sequence, providing additional shop floor documentation. These automatic comments
list the NCC file, INC file, date, time, company name, and address. There are several methods to
control the output of comments in the POSTFORM file including:
There should be a single space before the beginning and ending comment characters. Some
machines do not need an end comment character; in this case, just indicate the comment start
character:
UpperCaseComments? Y
UpperCaseComments? N
Comment (
Comment !(
Comment ( )
Comment !( )
Comment ( )$

# Comments are output in upper case


# Comments are output in upper and lower case
# Comments are preceded by an open parenthesis
# Comments are preceded by an open parenthesis and no N
numbers
# Comments are surrounded by parentheses
# Comments are surrounded by parentheses and no N numbers
# Comments are surrounded by parentheses for Dynapath controls

Machines that use only a comment start character will ignore after the comment character.
Note:

When the machine tool does not support comments, do not enter the Comment
command in the POSTFORM file.

Notes:
EndNotes

# Beginning of Post notes


# End of Post notes

Lines between Notes: and EndNotes are treated as


comments and are not posted to the NCC file.

Related Commands: UpperCaseComment?


12. Coolant Mill, Lathe, EDM
Similar to the Spindle command, Coolant can be followed by up to 8 numerical values for the M
codes for flood coolant On, Off, and Mist and 5 additional user defined codes.
Coolant 8 9 7 61 62 63 64 # On, Off, Mist, flood lo, flood hi, thru lo, thru hi
Note:

The same value for flood On and Mist can be used.

Coolant 8 9 8 61 62 63 64 # On, Off, Mist, ...........


13. CtrCode Mill, Lathe, EDM
This command should be followed by one or two letters*, depending on which method of arc center
point designation you want in the NC code. The two letters are usually I and J for milling; the first
letter is the horizontal center designation and the second is the vertical. The one letter center
configuration is used for radius designation. When only one letter is entered after CtrCode, then
the radius value is coded.
* If ArcPlane is used, you will need the letter K after I J. Refer to ArcPlane Mill Only on page 67.
Copyright 2000 by Surfware, Inc. All Rights Reserved.

72

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

For the following examples, a 90 deg. arc of radius 2.5, center at X1. Y1., starting at X3.5 Y1. and
ending at X1. Y3.5 is cut in the counterclockwise direction.

MILL, LATHE
CtrCode I J
CtrCode R
EDM
CtrCode I J K L

# Outputs G3 X1. Y3.5 I-2.5 J0


# Outputs G3 X1. Y3.5 R2.5

# Outputs K and L for 4 Axis Wire Aux. plane


# Circle center codes.

Note:

The formats for the letters K, and L must be set in the letter format section of the
POSTFORM.E file.

Note:

The programming mode must be absolute for 4 Axis: "INCREMENTAL? Y" line is not
allowed in the POSTFORM.E file.

Arc center codes for UV, typically K and L, are assumed to be incremental from the start of the UV
plane arc. When the K and L values must be incremental from the I and J values of the XY plane
enter another Y after the CtrIncremental? parameter.
Related Commands: 2ndCircleCode, ByDiameter?, ByQuadrant?, CtrIncremental?
14. CtrCode>180 Mill, Lathe, EDM
With this command you can use the R letter designation to code arc moves greater than 180
degrees and less than a full circle. This can be accomplished by coding the following letter address
and command sequence. The letter format used is the same as the CtrCode command.

r ->3.>4 R Mult -1
This outputs a -R for the arc center to break arcs greater than 180 degrees.

CtrCode>180 R# Outputs G3 X1. Y3.5 R-3.5


Related Commands: CtrCode, CtrCode360
15. CtrCode360 Mill, Lathe, EDM
When the CtrCode>180 command is used, this command is used to code full circle arcs. This
command also requires the Word Address format as described above. The letter format used is
the same as the CtrCode command.
Related Commands: CrtCode, CtrCode>180
16. CtrIncremental? Mill, Lathe, EDM
The information after this command is only used if the two letter CtrCode is used to indicate the
center point of the arc. Enter a Y or N after the CtrIncremental? command to define whether the
machine measures the center of the arcs incrementally from the start point of the arc. The
numerical values of the two Center addresses will be taken as absolute from the program origin
when an N is entered.
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

73

This example uses a 90 deg. arc of radius 2.5, center at X1. Y1. starting at X3.5 Y1. and cutting
to X1.0 Y3.5 in a counterclockwise direction.

MILL, LATHE
CtrIncremental? Y
CtrIncremental? N

# Outputs G3 X1. Y3.5 I1. J1.

EDM
CtrIncremental? Y N

# Y Y causes K & L to be incremental from I & J.

# Outputs G3 X1. Y3.5 I-2.5 J0

# Y N causes K & L to be incremental from the


# arc start.
Note:

The formats for the letters K and L must be set in the letter format section of the
POSTFORM.E file.

Note:

The programming mode must be absolute; the "INCREMENTAL? Y" line is not allowed
in the POSTFORM.E file. When incremental output is desired, use the individual Word
address method instead. Refer to Section 2.18: Incremental Output on page 138.

Note:

UV plane axis positioning values for Wire EDM are absolute values unless otherwise
indicated in the letter format section of the POSTFORM.E file. When the U and V values
for Wire EDM are to be incremental from the X and Y values on the same line, format
the U and V letters as follows:
U ->3.>4 IncFrom X
V ->3.>4 IncFrom Y
Arc center codes for UV, typically K and L, are assumed to be incremental from the start
of the UV plane arc. When the K and L values must be incremental from the I and J
values of the XY plane, enter another Y after the CtrIncremental? parameter.

CtrIncremental? Y Y
Related Commands: 2ndCircleCode, CtrCode, ByDiameter?, ByQuadrants?
17. CW Mill, Lathe, EDM
This command identifies the letter and number for clockwise arcs.

CW G2
Related Commands: CCW, CircDir
18. DCode Mill, Lathe
These are followed by the character that corresponds to their function. The DCode command
corresponds to the depth moves of the INC file. This is typically the Z word.

DCode Z
Related Commands: DCode2, HCode, HCode2, VCode, VCode2, FeedCode

Copyright 2000 by Surfware, Inc. All Rights Reserved.

74

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

19. DCode2 Lathe


This word format specifies the letter address to use to move the second turret depth.

DCode2 W
Related Commands: DCode, HCode, HCode2, VCode, VCode2, FeedCode
20. DComp Mill, Lathe
The three values following the DComp command correspond to the machines three diameter
offset directions: Left, Right, and Cancel, respectively.

DComp 41 42 40 # Left, Right, Cancel


Related Commands: CDC, LComp
21. Drive Mill, Lathe, EDM
You can assign a path name (drive and directory name) that will determine where the finished NC
program will be created. Simply add a line like the one below to route the code to the desired
directory:

Drive \mill\
There must be a trailing back slash (\).
It is recommended that the Drive line be added after the Name line. Each different machine format
can have a different Drive line, which enables you to automatically route NC programs for each
machine into its own directory.
In addition to (or instead of) having a separate Drive line for each machine, you can place a Drive
line at the very top of the POSTFORM file. All NC programs can be routed to this directory unless
the machine chosen has its own Drive line, in which case the machines drive designation will be
used.
22. Dummy for Columnar Style Mill
The character input after Dummy is a character that will appear at the end of each line of a
columnar style program to indicate the end of the line. The Dummy line is not used when the
format is not columnar.
Note:

The items Spaces and Dummy are used only in columnar style programs.

Related Commands: EOB, Each, Spaces


23. Each Mill, Lathe, EDM
Some machines require a particular word, a letter followed by a number, on each line. The
machine may require a dollar sign ($) character at the end of each line, in addition to the standard
CR/LF end of block characters.
Therefore, enter this line in the POSTFORM file for that machine:

Each $0

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

75

In this example, to output just the dollar sign without the 0 following it, format the dollar sign to
output no digits by giving it the format:

$ 00
Note:

This needs to be entered in the Word Address Formats section and the POSTFORM it
gets output from is determined by the Word Address Format section.

Related Commands: Dummy, EOB


24. EOB Mill, Lathe, EDM
EOB stands for "End Of Block". Some NC machines require a character other than a standard line
feed / carriage return combination between each line of code. The EOB line can be used to change
the End Of Block code to any ASCII character. For instance, if a machine requires a number sign
character (#), then place the number 35 after EOB in the POSTFORM file. The number 35 is the
ASCII value of the number sign character:

EOB 35# ASCII Value


This will cause the post to use the number sign instead of the standard carriage return / line feed
combination at the end of each line of NC code.
You can enter as many as twenty numbers for EOB characters. These twenty characters are
output for each line.

EOB 13 10
This outputs a carriage return and line feed at the end of each block.
Related Commands: Dummy, Each
25. Feed Mill, Lathe, EDM
The following lines indicate the linear Feed Rate movement codes:

Feed G1
Here a G1 indicates that a move at the specified feed rate is going to be programmed in this block.
Related Commands: FeedCode, FeedType, Rapid, SpeedType, VRapid
26. FeedCode Mill, Lathe, EDM
This function specifies the character to use for Feedrate output.

FeedCode F
Note:

SURFCAM requires tool motion to be present before outputting a FeedCode.

Related Commands: Feed, FeedType, DCode, DCode2, HCode, HCode2, VCode, VCode2
27. FeedType Mill, Lathe, EDM
This command specifies the appropriate G codes for IPR and IPM output.

FeedType 95 94
This entry will output a G95 for IPR and G94 for IPM codes.
Related Commands: Feed, FeedCode, SpeedType, VRapid
Copyright 2000 by Surfware, Inc. All Rights Reserved.

76

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

28. First#? Mill, Lathe, EDM


This switch determines whether the Block number is output on the first line of the program or
omitted. Enter Y or N for the desired output. The example below will omit a number on the first line
of the NC program.

First#? N
Related Commands: Last#?, Sequence#s
29. HCode Mill, Lathe, EDM
These commands are followed by the character that corresponds to their function (the H, V, and
D in the first 3 stand for Horizontal, Vertical, and Depth, respectively). For standard milling, these
characters are almost always X, Y, Z.

MILL, LATHE
HCode X
EDM
HCode X U
The letter U indicates the auxiliary horizontal plane movement for Wire EDM.
Note:

The formats for the letter U must be set in the Letter Format section of the
POSTFORM.E file.

Note:

UV plane axis positioning values for Wire EDM are absolute values unless otherwise
indicated in the letter format section of the POSTFORM.E file. When the U and V values
are to be incremental from the X and Y values on the same line, format the U and V
letters as follows:
U ->3.>4 IncFrom X
V ->3.>4 IncFrom Y

Related Commands: DCode, DCode2, HCode2, VCode, VCode2, FeedCode


30. HCode2 Lathe
This word format specifies the letter address to use to move the second turret horizontally.

HCode2 U
Related Commands: DCode, DCode2, HCode, VCode, VCode2, FeedCode
31. Helical? Mill
This switch defines whether or not the machine tool allows helical move. When the machine tool
accepts helical moves this command should be entered as Y. The output code would then utilize
the designated axis for the helical moves.

Helical? Y# Outputs Z axis helical moves.


Helical? N# Outputs point to point linear moves.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

77

Linear moves are at a tolerance set by the MaxRad command.


Related Commands: CW, CCW, CtrCode, CtrIncremental?, MaxRad
32. Inc/Abs Mill, Lathe, EDM
The Inc/Abs line indicates the numerical values of the G code that set the incremental or absolute
programming mode on the NC machine. The post processor issues a warning message when a
mode change command is processed. For most machines it is G91 and G90:

Inc/Abs G 91 90
Note:

Refer to Section 2.18.4: Incremental? Mill, Lathe, EDM on page 139.

Related Commands: Incremental?


33. Inch/MM Mill, Lathe, EDM
The Inch/MM line indicates the numerical values of the G code that set inch or millimeter
programming mode on the NC machine. For most machines it is G70 and G71. When this
command is not used, the G70 or G71 code is the default. This command is not required when the
G70 / G71 codes are used by the machine tool. The example below is entered in the POSTFORM
file for a machine tool that uses G20 and G21 for inch and millimeter mode.

Inch/MM 20 21 # Inch Metric


34. Incremental? Mill, Lathe, EDM
This switch is used to set the machine output to the Incremental, or Absolute, mode.

Incremental? Y
This will cause the code to be output in Incremental. The machine may also require a G91. Ensure
that a G91 code is placed in your StartCode or 1stToolChange sequence.
Note:

The Y can easily be changed to an N to result in absolute programs. Remember to


remove the G91 in your StartCode or 1stToolChange sequence. When absolute and
incremental programs are both used regularly, create two appropriate posts within the
POSTFORM file.

Note:

Refer to Section 2.18.5: Inc/Abs Mill, Lathe, EDM on page 140.

Related Commands: Inc/Abs


35. Last#? Mill, Lathe, EDM
This switch determines whether a Block number is output on the last lines of the program or
omitted. Enter a Y or N for the desired output. The example below will output a block number on
the last line of the program.

Last#? Y
Related Commands: First#?, Sequence#s
36. LComp Mill, EDM
Similar to DComp, the two values following the LComp command indicate the values used for the
words that activate and deactivate the machines tool length compensation function, respectively.
LComp 43 49# On, Off
Related Commands: CDC, DComp
Copyright 2000 by Surfware, Inc. All Rights Reserved.

78

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

37. Leading0s? Mill, Lathe, EDM


By default, the post puts a "leading zero" on any number whose absolute value is less than one.
For instance: "X0.1" instead of "X.1" and "Z-0.5" instead of "Z-.5." If your machine does not require
the leading zeros, then use this switch with a "Y" to eliminate them (thereby producing somewhat
more compact code).
38. MaxRad Mill, Lathe, EDM
This command sets the limit size of the arcs the machine can perform. When an arc is larger than
the limit size, the post breaks the arc into linear moves. The second parameter is the amount of
chordal deviation from the original arc.
MaxRad 99 .001# Limit Tolerance
This command directs the post to process all arcs with a radius of 99 inches or less. Those arcs
larger than the 99 inch radius are broken into linear moves with a chordal deviation of .001 from
the original arc.
Related Commands: ArcWithLine, ArcWithSame, MinRad
39. MinRad Mill, Lathe, EDM
This command sets the minimum size of the arcs the machine can perform. When an arc is smaller
than this value it is output as lines. The default value is .001.
MinRad .001 # Tolerance
Related Commands: MaxRad
40. MOD
This command is a MODULO function in that it returns the remainder when one number is divided
by another. It is useful in working with rotary tables to insure that the code is never greater than
360 (or -360).
The format of the command is number1 MOD number2. Such an expression will always return
a value x in the range of -number2 < x < number2. Some examples are:
45 mod 360 = 45
390 mod 360 = 30
720 mod 360 = 0
-370.2 mod 360 = -10.2

30 is remainder when 390 is divided by 360


360 divides evenly into 720

41. Modality
ModalGs Mill, Lathe, EDM
This is simply a list of all the G values that are modal. This means that any G code in the list
will remain in effect, and not be repeated, until another G code from the list is called. This
prevents, for instance, a G1 from being output on every line when there are consecutive
linear moves. G values that should appear on this line are G codes for any movement
commands: linear, rapid, circular, and canned cycle G values.
ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85
Related Commands: ModalLetters

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

79

ModalLetters Mill, Lathe, EDM


This line contains a list of all the letters that typically indicate modal values. On most
machines this should be:
ModalLetters X Y Z F
If the ModalLetters line is not placed, then the above defaults are used. The letters used in
conjunction with the RotAngle and VClear variables are also assumed to be modal when the
ModalLetters line is not used.
ModalLetters
Related Commands: ModalGs
Force?
The "FORCE?" modifier can now be added to all sequences (except "Point to point" cycles
[DRILL, REAM, BORE, BACK, TAP, LTAP, PECK]). You can use this option to tell the post
to suppress unchanged values (by using "Force? N") within the sequence, or to force all
words to be output ("Force? Y"). For instance, if you want all arc letters to be output, use the
"Force" modifier on the CWCode and CCWCode lines like this:
CwCode Force? Y
...
CCwCode Force? Y
...
Although this modifier cannot be added to the drilling cycles, it CAN be added to the
CANCEL, INDEX, UPON and UPONREC sequences. If added to sequences that use other
parameters, it must be placed AFTER the other parameters as in these examples:
Index X Z Force? Y
Upon [tool] Force? Y
Notes:
1. The default state of these sequences is "Forced": StartCode, 1stToolChange,
ToolChange, SubStart, SubEnd, SubCall, Index, Cancel, EndCode.
2. All canned cycles (Drill, etc.) "Force Y" the 1st hole, but then are "modal" for the
subsequent holes (the equivalent of "Force? N").
3. All other sequences are modal (the equivalent of "Force? N")Rapid, Linear moves, In/
Outfeed, Arcs.
42. Rapid Mill, Lathe, EDM
The following lines indicate the Feed rate and Rapid movement codes:
Rapid G0
The G0 indicates that a rapid move is to be programmed in this block.
Related Commands: Feed, FeedType, SpeedType, VRapid
Copyright 2000 by Surfware, Inc. All Rights Reserved.

80

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

43. ReturnPlane Lathe, Mill


The ReturnPlane command sets the value for the [RetPlane] variable. This controls the Z level
Return Plane between holes when drilling. (Typically G98, G99)
ReturnPlane 98 99
Related Variables: RetPlane
44. RenumSubs? Mill
You can reset the line numbers at the beginning of each Subprogram and the main program.
When this command is not used, the line numbers are not reset at the beginning of each
Subprogram and the main program.

RenumSubs? Y
Note:

When this command is entered as Y, the Subline variable should not be used.

Related Commands: Subs1st?


Note:

Refer to Section 2.19: Subprogram Output on page 143 and Section 2.20: Block Number Output on
page 148.

45. Replace Mill, Lathe, EDM


Up to 50 Replace commands can be added to the POSTFORM file to search and replace certain
phrases with others. The following are example lines within the POSTFORM file.

Replace "G2 " with "DR- "


Replace "G3 " with "DR+ "
Replace "T" with "TOOL DEF "
Notice that both the phrase to be replaced and the new phrase are enclosed in quotes. This is
necessary in order to be able to search and replace phrases with embedded spaces, such as
TOOL DEF. Unlike all other areas of the POSTFORM file, phrases with quotes are always case
sensitive. Do not use "g3" when you really want to search for "G3". The commands Replace and
With can be upper or lower case.
Each line of outgoing NC code will be scanned for each Replace line in the machine format. Only
the first occurrence of the Replace phrase is replaced in each line. Using the example above, the
line "G2 T1 G2 X0" would end up as "DR- TOOL DEF 1 G2 X0". Notice that the second G2 is not
replaced because it was found earlier in the line.
Note:
Spaces within the search phrase can be used to prevent unwanted replacements. In the
first example, if we had used a "G2" and "DR-", without the trailing spaces, it would
cause all "G28" words to end up as "DR-8".
Also, if more than one Replace line are used in a format, they are performed in the order that you
specify. This means that there is a possibility that code can be inadvertently replaced twice. In the
following example, Replace lines are used in the following order:
Replace "T" with "TOOL DEF "
Replace "D" with "DIAM. "
The "D" in "TOOL DEF" will be replaced with "DIAM. " like this:
"T1" will be changed to: "TOOL DIAM. EF 1" instead of "TOOL DEF 1"

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

81

To prevent this from happening, just reverse the order of the Replace lines so the D is replaced
before the T.
Note:

Limits are not checked on phrases that are the result of a Replace command. In other
words, if code is inadvertently replaced with another phrase that is beyond a particular
limit, then no warning will appear. The size of the search phrase in a Replace line is
limited to 10 characters, and the replace phrase is limited to 40 characters.

46. RevSigns Mill, Lathe, EDM


This is a list of characters that need to have their signs reversed. Some machines require the Z+
direction to be toward the spindle. The example below reverses the sign of the letters Z and X.

RevSigns Z X
An indefinite number of letters can be placed on this line.
Related Commands: RevTurret2?
47. RevTurret2? Lathe
This word format globally reverses all X values when the second turret is active. You can enter a
Y for yes or N for no to reverse the X values for the second turret.

RevTurret2? Y
Related Commands: RevSigns
48. Sequence#s Mill, Lathe, EDM
This line defines the Block numbers output in the NC program. There are four parameters required
and placed in order on this line:

CHARACTER
The first character after the command is the 1st character of the block number. These examples
show the code and output for the commands using the letter N and the : symbol.
Note:

The letter or symbol used must be in the Word Address format.


SEQUENCE#S N 1 1 1

THE OUTPUT

1stToolChange
M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

N2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N4 H1 M7 Z.1

End

Copyright 2000 by Surfware, Inc. All Rights Reserved.

82

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

The following example uses the letter C with the Replace command to output the : symbol for each
block number.
: >2
SEQUENCE#S : 1 1 1

THE OUTPUT

1stToolChange
M6 T[Tool]

:1 M6 T1

G0 G90 S[Speed] M[Direct]

:2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

:3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

:4 H1 M7 Z.1

End

FREQUENCY
A number here indicates how often a block number is placed on a line. To output a number on every
line, enter a 1. To output a number on every other line enter a 2. Entering the number 10 will output a
block number every ten lines. The following examples show the code and output for the parameter.
SEQUENCE#S N 1 1 1

THE OUTPUT

1stToolChange
M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

N2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N4 H1 M7 Z.1

End
The following example indicates a Frequency of 2 to output block numbers on every other line.
SEQUENCE#S N 2 1 1

THE OUTPUT

1stToolChange
M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

G0 G90 S2000 M3

E[Work] X[H] Y[V]

N2 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

H1 M7 Z.1

End
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Note:

83

Use a frequency of 0 not to output the block numbers on each line. The post will only
put them where they are requested.

INCREMENT
This is the value by which the block number is incremented before the next output. Using the value
of 10 will create block numbers in the block address itself as 10 greater than the last block number.
SEQUENCE#S N 1 10 10

THE OUTPUT

1stToolChange
M6 T[Tool]

N10 M6 T1

G0 G90 S[Speed] M[Direct]

N20 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N30 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N40 H1 M7 Z.1

End

START VALUE
This is simply the value of the very first block number that appears in the code; numbers after the
first are determined by the start value plus a multiple of the Increment.
SEQUENCE#S N 1 2 100

THE OUTPUT

1stToolChange
M6 T[Tool]

N100 M6 T1

G0 G90 S[Speed] M[Direct]

N102 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N104 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N106 H1 M7 Z.1

End
Note:

Refer to Section 2.20: Block Number Output on page 148.

49. Spaces for Columnar Style Mill, Lathe, EDM


The number on the Spaces line is used only in columnar style programs and determines the length
of every line of the program. This line must appear in the POSTFORM file before the letter formats
for each format that uses this programming style, otherwise the words will not be placed correctly
in the NC program.
Note:

Do not confuse this setting with the Spaces? switch.

Related Commands: Dummy

Copyright 2000 by Surfware, Inc. All Rights Reserved.

84

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

50. Spaces? Mill, Lathe, EDM


This switch is used to suppress the insertion of space characters between each word of the NC
program. When using communication software that does not strip out spaces automatically, use
the following line to prevent the post from putting spaces between each word:
SPACES? N

THE OUTPUT

1stToolChange
M6 T[Tool]

M6T1

G0 G90 S[Speed] M[Direct]

G0G90S2000M3

E[Work] X[H] Y[V]

E1X0Y0

H[Lcomp] M[Cool] Z[D]

H1M7Z.1

End
Note:

Do not confuse this line with the Spaces setting mentioned above in the Letter Formats
section.

51. SpeedCode Mill, Lathe, EDM


This command specifies the character to use for Spindle Speed output.

SpeedCode M
Note:

SURFCAM requires tool motion to be present before outputting a FeedCode.

Related Commands: SpeedType


52. SpeedType Lathe
This command specifies the appropriate G code for RPM and CSS output.

SpeedType 97 96 # RPM and CSS


This entry will output a G97 for RPM and G96 for CSS codes.
Related Commands: Feed, FeedType, Rapid, VRapid
53. Spindle Mill, Lathe
The Spindle command is followed by 3 numbers that correspond to clockwise, counterclockwise
and spindle stop. Most machines use M3, M4, and M5 for these codes. The following line indicates
these functions.

Spindle 3 4 5# CW CCW Stop


54. Subs1st? Mill
This command defines the location of the Subprograms in relation to the main program. Enter a Y
for the Subprograms to be output before the main program. An N outputs the Subprograms after
the main program. This command is only entered in the POSTFORM file when Subprograms are

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

85

desired. When this command is not used, the Subprograms are automatically placed before the
main program.

Subs1st? Y
Related Commands: RenumSubs?
55. Tolerance Mill, Lathe, EDM
This command is used to set the value to round off the output.

Tolerance .0002
The example above causes only even numbers to be output in the 1/10,000ths column.
56. Tools Mill, Lathe
This line is used only with tool indexers that require incremental T numbers. In other words, the
value of the T number is the number of indexes required to reach the desired tool, not the tool
number.
Note:

Make sure there is no Tools line in any section of a POSTFORM that describes a
machine not having this incremental tool change. This could cause the machine to work
improperly.

57. UpperCaseComments? Mill, Lathe, EDM


You can output either all upper case letters or upper and lower case letters for comments. Enter
the command with the letter Y to convert all comment letters to upper case letters.

UpperCaseComments? Y
Related Commands: Comment
58. VCode Mill, Lathe, EDM
These commands are followed by the character that corresponds to their function. The h, v, and
d in the first 3 commands stand for Horizontal, Vertical, and Depth, respectively. For standard
milling, these characters are almost always X, Y, Z, and F.

MILL, LATHE
VCode Y

EDM
VCode Y V

The letter V indicates the auxiliary vertical plane movement.


Note:

The formats for the letter V must be set in the letter format section of the POSTFORM.E
file.

Note:

UV plane axis positioning values are absolute values unless otherwise indicated in the
letter format section of the POSTFORM.E file. When the U and V values are to be
incremental from the X and Y values on the same line, format the U and V letters as
follows:
U ->3.>4 IncFrom X
V ->3.>4 IncFrom Y

Related Commands: DCode, DCode2, HCode, HCode2, VCode2, FeedCode


Copyright 2000 by Surfware, Inc. All Rights Reserved.

86

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

59. VCode2 Lathe


This word format specifies the letter address to use to move the second turret vertically.

VCode2 V
Related Commands: DCode, DCode2, HCode, HCode2, VCode, FeedCode
60. VRapid Mill
This command is used to output additional code before the VRapid letter output. This can be used
for some Bandit controls.

VRapid /0
The example above outputs a slash before the letter for all rapid moves.
Related Commands: Feed, FeedType, Rapid, SpeedType
61. Work Mill, Lathe
This line is used to identify the letter designation of work offsets. Typically the letter G is used for
work offset designation. Machine tools may use different letters to identify the work offset. When
this is the case change the Work command to indicate the proper work offset letter. The example
below is for a FANUC style control.

Work G
This example can be used for a FADAL control.

Work E
Related Commands: WorkDefault
62. WorkDefault Mill, Lathe
This line is used to identify the number of the default work offset. The FANUC control begins with
number 54 while the FADAL control begins with the number 1. When this command is not entered
the default number used by the post processor is 54.

WorkDefault 1
Related Commands: Work
63. ZRestart? Mil
This switch allows for machine formats that do not require the canned cycles to be restarted for
each change in the depth or clearance plane values. If this parameter is not used in the
POSTFORM file, and the Z or R values change during a cycle, the cycles will be cancelled if
necessary, then restarted. To prevent this from occurring, enter the following line in the
POSTFORM file:

ZRestart? N# The N means No


Leaving this line out or using the line ZRestart? Y will cause the following type of output on a
sample where the holes are all the same incremental depth, but start at different levels.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

87

Notice both the R and Z values change:

G81 X-1.834 Y0.4503 Z0.4079 R1.0079 F4.0


G80
G81 X-1.1283 Y0.6773 Z0.1177 R0.7177 F4.0
G80
Placing ZRestart? N in the format will suppress the cancel and restart codes and result in this
output:

G81 X-1.834 Y0.4503 Z0.4079 R1.0079 F4.0


X-1.1283 Y0.6773 Z0.1177 R0.7177
X0.4427 Y0.9409 Z-0.1445 R0.4555
G80
Note:

2.11

Some machines can handle changing Z and R values when in incremental mode but
not in absolute.

SEQUENCES

Sequences are used to describe the actual NC code output. They are a series of program blocks
that appear in specific places in the NC program and for specific reasons.
Each sequence is described in the POSTFORM file by giving its name, on its own line, then the
line(s) for the formatted NC description. The word END on its own line, which marks the END of
the sequence, is then entered. Each line is limited to 15 words. The total of all sequence lines is
limited to 150 lines.
The output is defined by entering the Letter format desired with the variable required for the output
code. The NC code is output with the letter entered and the data from the variable used.
Note:

The sequence examples in this section were written for a standard Fanuc control. They
are incorporated in the post libraries displayed in this section.

The post processor contains three basic sequence types. These are the Canned cycles, Standard,
and Optional sequences.
The Standard sequences appear in all POSTFORM files. They perform the operations that are
required for every machine. In addition to the standard sequences, there are optional sequences
you can define. Optional sequences are denoted with an * in Figure 18: Standard and Optional
Sequences.
1. 1stToolChange (p. 89)

12. RapidCode * (p. 93)

2. BeginRow (p. 89)

13. StartCode (p. 93)

3. Between * (p. 89)

14. Stop (p. 94)

4. CcwCode * (p. 90)

15. SubCall * (p. 94)

5. CwCode * (p. 90)

16. SubEnd * (p. 94)

Figure 18: Standard and Optional Sequences


Copyright 2000 by Surfware, Inc. All Rights Reserved.

88

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

6. EndCode (p. 91)

17. SubStart * (p. 95)

7. EndRow (p. 91)

18. Thread G33 (p. 95)

8. Index * (p. 92)

19. ToolChange (p. 95)

9. InFeed (p. 92)

20. Unwind (p. 96)

10. LineCode * (p. 92)

21. UponVariable (p. 96)

11. OutFeed (p. 93)


Figure 18: Standard and Optional Sequences

These sequences are described in alphabetical order, followed by a description of the canned
cycles.
Note:

When coding sequences, you must place a single space character between each output
letter on the line. Subsequent letters are not output for the line when the single space is
not present. If you either leave out a space or insert an extra space, you will get incorrect
results. The following example shows the correct coding and the incorrect codingtwo
spaces are inserted.
CORRECT

THE OUTPUT CODE

1stToolChange
T[tool] M6

T1 M6

M[direct] S[speed]

M3 S2000

G0 G[work] X[h] Y[v]

G0 G54 X1. Y2.5

Z[d] H[Lcomp]

Z.1 G43

M[cool]

M7

End
INCORRECT

THE OUTPUT CODE

1stToolChange
T[tool] M6

T1

M[direct] S[speed]

M3

G0 G[work] X[h] Y[v]

G0

Z[d] H[Lcomp]

Z.1

M[cool]

M7

End

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.11.1

89

Standard and Optional Sequences

1. 1stToolChange Mill, Lathe


This sequence describes the format for the programs FIRST tool change. This differs from
the subsequent tool changes in that it is assumed that the machine is in the tool change
position.
MILL

LATHE

THE OUTPUT CODE

1stToolChange

1stToolChange

T[tool] M6

T[tool] M6

T1 M6

M[direct] S[speed]

M[direct] S[speed]

M3 S2000

G0 G[work] X[h] Y[v]

G0 G[work] X[h] Y[v]

G0 G54 X1. Y0

Z[d] H[Lcomp]

Z[d] H[Lcomp]

Z.1 H43

M[cool]

M[cool]

M7

End

End

Related Sequences: ToolChange


2. BeginRow Mill
This sequence describes the format for the beginning of each pass of a pocket cut or the
beginning of each pass on a bi-directional surface cut.
This can be used for water jet or laser machine tools. It can also be used for the high speed
machining function of a machine tool.

BeginRow
G91.1
F[Frate]
End
Related sequences: EndRow
3. Between Mill
This sequence defines any special code desired between the Subprogram and the main
program. This could be used to enter the code for the end of all subroutines on the FADAL.

Between
M17
M30
End

Copyright 2000 by Surfware, Inc. All Rights Reserved.

90

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

The output code for this example:


X0 Y0
G91 G28 Z0
M17
M30
O1234
Note:

Subprogram end

Main program beginning

Refer to Section 2.19: Subprogram Output on page 143.

Related sequences: SubCall, SubStart, SubEnd


4. CcwCode Mill, Lathe, EDM
This code is used to format counterclockwise arcs that can not be processed by the CtrCode
and CtrIncremental? commands. The ByQuadrants command is still applicable to this
sequence.

CcwCode
G3 X[h] Y[v] I[ival] J[jval] F[frate]
G299
End
The output code:

G3 X1. Y1. I-1. J0 F5.


G299
Related sequences: CwCode
5. CwCode Mill, Lathe, EDM
This code is used to format clockwise arcs that can not be processed by the CtrCode and
CtrIncremental? commands. The ByQuadrants command is still applicable to this sequence.

CwCode
G2 X[h] Y[v] I[ival] J[jval] F[frate]
G199
End
The output code:

G3 X1. Y1. I-1. J0 F5.


G199
Related sequences: CcwCode

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

91

6. EndCode Mill, Lathe


The EndCode sequence is used to format the end of the program. It can be used to code the
tool clearance move and a tool change to the programs first tool. It will also contain the
program end code, either an M2 or M30.
MILL

THE OUTPUT CODE

EndCode
G0 G90 G49

G0 G90 G49

M6 T[tool1]

M6 T1

X0 Y0

X0 Y0

M30

M30

%0
End
LATHE

THE OUTPUT CODE

EndCode
M6 T[tool1]

M6 T1

G0 G90 G49

G0 G90 G49

E0 X0 Y0

E0 X0 Y0

M30

M30

7. EndRow Mill
This sequence describes the format for the end of each pass of a pocket cut or the end of
each pass on a bi-directional surface cut.
This can be used for water jet or laser machine tools. It can also be used for the high speed
machining function of a machine tool.

EndRow
G91.2
F[plunge]
End
Related sequences: BeginRow

Copyright 2000 by Surfware, Inc. All Rights Reserved.

92

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

8. Index Mill
The Index sequence replaces rapid moves whenever the CView changes for the cut. Since
this sequence replaces rapid motion, the example below indicates the three functions that
should be placed in the sequence.
INDEX

THE OUTPUT CODE

G0 G28 G49 Z0

G0 G28 G49 Z0

G[work] X[h] Y[v] A[rotangle]

G54 X1. Y1. A90.

G43 H[lcomp] Z[d]

G43 H1 Z.1

End
Related sequences: UnWind
9. InFeed Mill, Lathe, EDM
The InFeed sequence is used to define the format for tool motion into the part. This is usually
used to define the moves to initiate cutter compensation.
InFeed
G[side] X[h] Y[v] H[dcomp] F[frate]
End

InFeed
G[side] X[h] Y[v] H[dcomp] F[frate]
End

The output code for these examples:

G41 X1. Y1. H1 F5.


Note:

The InFeed sequences can only be 1 block long for 4 axis Wire EDM.

Related sequences: OutFeed


10. LineCode Mill, Lathe
This sequence can be used to create non-standard linear moves.
LINECODE

THE OUTPUT CODE

G1 X[h] Y[v] Z[d]

G1 X1. Y1. Z.1

G499

G499

End

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

93

11. OutFeed Mill, Lathe, EDM


This sequence is used to define the tool motion away from the part. This usually consists of
the moves to deactivate cutter compensation.
MILL

OutFeed
G1 G40 X[h] Y[v]
End

LATHE

OutFeed
G1 G40 X[h] Y[v]

The output code for these examples:

G1 G40 X0 Y0
Note:

The OutFeed sequences can only be 1 block long for 4 axis Wire EDM.

Related sequences: InFeed


12. RapidCode Mill, Lathe, EDM
This sequence is used to define a non-standard rapid code.

RapidCode
G0 X[h] Y[v] Z[d]
G399
End
The output code:

G0 X1. Y1. Z.1


G399
13. StartCode Mill, Lathe, EDM
This sequence is used to define the beginning lines of the program. They usually contain a
percent sign followed by the program number. The initializing modal G codes can also be
added.
MILL

StartCode
%0
O[program#]
G90 G80 G40 G17
End

# Output %
# Output an O and program #
# Output initializing G codes

The output code:


%
O1234
G90 G80 G40 G17

Copyright 2000 by Surfware, Inc. All Rights Reserved.

94

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

LATHE

StartCode
%0
O[Program#]
G90 G80 G40 G17
End

# Output %
# Output an O and program #
# Output initializing G codes

The output code:


%
O1234
G90 G80 G40 G17
14. Stop EDM
This sequence is used to post the Stop variable, M00 or M01.

Stop
M[Stop]
End
15. SubCall Mill
This sequence defines the details of the Subprogram call in the main program.

SubCall
E[work] X[h] Y[v]
M98 P[sub] L[times]
End
The output code for this example follows. The P word is the Subprogram number called. The
L word is the number of repetitions for the Subprogram.
G1 X1. Y1.
M98 P1 L5
Note:

Refer to Section 2.19: Subprogram Output on page 143.

Related sequences: Between, SubEnd, SubStart


16. SubEnd Mill
This sequence defines the end of the Subprogram.

SubEnd
M99
End
The output code for this example follows. This code is placed at the end of the Subprogram
code by the post processor.
M99
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Note:

95

Refer to Section 2.19: Subprogram Output on page 143.

Related sequences: Between, SubCall, SubStart


17. SubStart Mill
This sequence defines the beginning of the Subprogram.

SubStart
O[sub]
End
The output code for this example follows. This code is placed at the beginning of the
Subprogram by the post processor.
O1
Note:

Refer to Section 2.19: Subprogram Output on page 143.

Related sequences: Between, SubCall, SubEnd


18. Thread G33 Lathe
For lathes that do NOT support AutoThread (G76 style) automatic threading cycles, LPost
calculates individual threading passes and output them (typically with G33 codes).
If the post contains "THREAD G33" line AND an AutoThread sequence, AutoThread will take
precedence (LPost will output the AutoThread cycle and ignore the G33).
G33 X-1.44 Z-1.75 I0 F0.0625
X-1.4151
X-1.3961
X-1.38
X-1.3658
X-1.353
X-1.3413
19. ToolChange Mill, Lathe
This sequence describes the format for all subsequent tool changes after the first tool
change. It usually contains the same format as the first tool change with the addition of the
move to the tool change position.
Mill
TOOLCHANGE

THE OUTPUT CODE

G49 G0 Z0 M9

G49 G0 Z0 M9

T[tool] M6

T1 M6

M[direct] S[speed] G0 X[h] Y[v]

M3 S2000 G0 X1. Y1.

G43 Z[d] H[lcomp]

G43 Z.1 H1

M[cool]

M7

End
Copyright 2000 by Surfware, Inc. All Rights Reserved.

96

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Lathe
TOOLCHANGE

THE OUTPUT CODE

N[block] T[tool] M6

N100 T1 M6

M[direct] S[speed] G0 X[h] Y[v]

M3 S2000 G0 X1. Y1.

G43 Z[d] H[lcomp]

G43 Z.1 H1

M[cool]

M7

End

Related sequences: 1stToolChange


20. UnWind Mill
When the rotary axis is limited in travel, it may become necessary to unwind the axis before
continuing machining. This is accomplished with the Unwind sequence. It is used to lift the
tool, unwind the axis, plunge into the part, and continue movement. The sequence can be
described as follows:
THE OUTPUT CODE

UNWIND

G0 G28 G49 Z0

G0 G28 G49 Z0

G0 G90 A0

G0 G90 A0

G43 H[lcomp] Z[d]

G43 H1 Z.1

G0 X[lasth] Y[lastv] A[lastrotangle]

G0 X0 Y0 A90.

G1 Z[lastd]

G1 Z.1

End
Related sequences: Index
21. Upon Variable Mill
This sequence can be used to output specific code whenever a variable changes. Each time the
variable changes, the Upon sequence is called. It can also be used to output a specific set of
codes every time the variable is encountered. The example below indicates the sequence to use
when the Work variable is changed.
UPON [WORK]

THE OUTPUT CODE

G91 G28 Z0

G91 G28 Z0

G[work]

G55

X[h] Y[v] Z[d]

X1. Y1. Z.1

G90

G90

End
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Note:

97

When the variable does not change and the next line or sequence uses the
variable, this sequence is not output.

The example below is used every time the Tool variable is encountered by the post
processor.

Upon Every [tool]


G91 G28 Z0
G90
End
The output code:

G91 G28 Z0
G90
2.11.2

Canned Cycles

You can create a series of blocks that will be repeated to do the same operation at each point
of the cycle. The definable canned cycles are listed below. These cycles can be used as a
Machine cycle, an Emulated cycle, or an Advanced cycle.
1. AutoThread (p. 99)

7. Custom3 (p. 102)

2. Back (p. 100)

8. Drill (p. 104)

3. Bore (p. 101)

9. LTap (p. 105)

4. Cancel (p. 102)

10. Peck (p. 106)

5. Custom1 (p. 102)

11. Ream (p. 108)

6. Custom2 (p. 102)

12. Tap (p. 109)


Figure 19: Canned Cycles

The three Custom cycles can be used to modify an existing machine tool cycle to enhance
the machine capabilities. These cycles are user defined and can be single or multiple line
sequences.

MACHINE CYCLES
Canned cycles can be used to access the machines built-in canned cycles or to create user
defined cycles. When a machine canned cycle is accessed, the Cancel code should be used
to stop execution of the machine cycle.
Note:

This is accomplished by entering Cancel at the end of the End line in the canned
cycle sequence. Refer to Section 4.: Cancel Mill, Lathe on page 102.

This example uses the Drill sequence to access a machine drill cycle.

Drill
G81 X[h] Y[v] Z[d] R[vclear] F[frate]
End Cancel

Copyright 2000 by Surfware, Inc. All Rights Reserved.

98

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

The output code:

G81 X1. Y1. Z-.5 R.1 F5.


X2. Y3.
X3. Y4.
G80
EMULATED CYCLES
When built-in machine code is not used, the cycles can include any desired code that is to
be repeated at each location. Since these cycles are not built-in canned cycles, the machine
tool does not require a Cancel code. Define a straight drilling cycle by describing the Drill
sequence as follows:
Drill
G0 X[h] Y[v] Z[rplane]
Z[vclear]
G1 Z[d] F[plunge]
G0 Z[rplane]
End

# Rapid to position RPlane.


# Rapid down to clearance.
# Feed down to bottom.
# Rapid out to Rplane level.

The output code:

G0 X1. Y1. Z.2


Z.1
G1 Z-.5 F5.
G0 Z.2
G0 X2. Y3. Z.2
Z.1
G1 Z-.5 F5.
G0 Z.2
G0 X3. Y4. Z.2
Z.1
G1 Z-.5 F5.
G0 Z.2
ADVANCED CYCLES
You can control the number of lines to output for the first location and subsequent locations.
You can output setup moves for the cycles and repeat only the moves necessary at each
location. This is accomplished by placing a number after the cycle sequence name.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

This example uses the Advanced cycle method to define a specific output for the first drill
location while outputting less code for the subsequent locations.
Back 3
F[frate]
G306 Z0
G308 Z[d]
G323 P.5
G85 X[h] Y[v]
End Cancel

# Initial Cycle.

# Secondary cycles.

The output code:

F5.
G306 Z0
G308 Z-.5
G323 P.5
G85 X1. Y1.
G323 P.5
G85 X2. Y3.
G323 P.5
G85 X3. Y4.
G80
1. AutoThread Lathe
This cycle is used for the Lathe automatic threading cycles.

AutoThread
G76 A[tparams] Q[vbite] R0
G76 X[v] Z[h] P[peck1] Q[vleave] R0 F[frate]
End
The sequence below is for the Fanuc OT control.

p[v] Z[h] R[startang] P[depth] q[peck1] F[frate]


End
These cycles require the use of additional letter formats. Listed below are samples of the
letter formats required for these cycles.
I->3.>4
A010360
P ->34
Q ->3.>4
F >3.>6

# Arc centers and <taper> value.


# Used for <tparams> in G76 cycle.
# Depth of first threading pass.
# Used for minimum depth of threading pass.
# Check number of places of trailing
# decimal for accurate threading.
Copyright 2000 by Surfware, Inc. All Rights Reserved.

99

100

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2. Back bore Mill


This cycle is used to feed the boring tool in and out of the hole.

MACHINE CYCLE
BACK

THE OUTPUT CODE

G87 X[h] Y[v] Z[d] R[vclear] F[frate]

G87 X1. Y1. Z-.5 R.1 F5.

End Cancel

X2. Y3.
X3. Y4.
G80

EMULATED CYCLE
BACK

G0 X[h] Y[v]
Z[rplane]
G1 Z[d]F[plunge]
G0 Z[rplane]
End Cancel

THE OUTPUT CODE

G0 X1. Y1.
Z.1
G1 Z-.5 F5.
G0 Z.1
G0 X2. Y3.
Z.1
G1 Z-.5 F5.
G0 Z.1
G0 X3. Y4.
Z.1
G1 Z-.5 F5.
G0 Z.1

ADVANCED CYCLE
BACK 4

# INITIAL CYCLE.

THE OUTPUT CODE

F[frate]

F5.

G306 Z0

G306 Z0

G308 Z[d]

G308 Z-.5

G323 P.5

# Secondary cycles.

G323 P.5

G85 X[h] Y[v]

G85 X1. Y1.

End Cancel

G85 X2. Y3.


G85 X3. Y4.
G80

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

101

3. Bore Mill, Lathe


This cycle is used for a standard boring cycle. The tool is feed to the hole depth, then rapids
to the clearance plane.

MACHINE CYCLE
BORE

THE OUTPUT CODE

G86 X[h] Y[v] Z[d] R[vclear] F[frate]

G86 X1. Y1. Z-.5 R.1 F5.

End Cancel

X2. Y3.
X3. Y4.
G80

EMULATED CYCLE
BORE

THE OUTPUT CODE

G0 X[h] Y[v]

G0 X1. Y1.

Z[rplane]

Z.1

G1 Z[d]F[plunge]

G1 Z-.5 F5.

Z[rplane]

Z.1

End Cancel

G0 X2. Y3.
Z.1
G1 Z-.5 F5.
Z.1
G0 X3. Y4.
Z.1
G1 Z-.5 F5.
Z.1

ADVANCED CYCLE
BACK 4

F[frate]
G306 Z0
G308 Z[d]
G323 P.5
G85 X[h] Y[v]
End Cancel

# INITIAL CYCLE.

# Secondary Cycles.

THE OUTPUT CODE

F5.
G306 Z0
G308 Z-.5
G323 P.5
G85 X1. Y1.
G85 X2. Y3.
G85 X3. Y4.
G80

Copyright 2000 by Surfware, Inc. All Rights Reserved.

102

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

4. Cancel Mill, Lathe


This command is used to describe how a canned cycle is canceled. Usually a single line with
a G80 is used.

Cancel
G80
End
Drill
G81 G99 R[vclear] Z[d] X[h] Y[v] F[frate]
End Cancel
The output code for this example follows when a machine cycle is used. The Cancel code is
entered on the End line of the canned cycle sequence.
G81 G99 R.1 Z-.5 X1. Y1. F5.
X2. Y3.
X3. Y4.
G80
When the Cancel code is not entered on the End line of the single line sequence, the line is
repeated for each location.
This example shows the same code without the Cancel sequence used.

Drill
G81 G99 R[vclear] Z[d] X[h] Y[v] F[frate]
End
The output code:

G81 G99 R.1 Z-.5 X1. Y1. F5.


G81 G99 R.1 Z-.5 X2. Y3. F5.
G81 G99 R.1 Z-.5 X3. Y4. F5.
5. Custom1, Custom2, Custom3 Mill, Lathe
This command is used to describe a machines canned cycle that is not defined by the other
available canned cycles. The example used, is a standard Peck cycle for the FADAL
machine tool while the G83 cycle is a deep hole cycle.
When the Custom cycles are coded, you can enter a comment on the sequence name line
to identify the cycle type. This comment must be a minimum of three spaces after the
sequence name.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

MACHINE CYCLE
CUSTOM1

THE OUTPUT CODE

G73 X[h] Y[v] Z[d] Q[vbite] R[vclear] F[frate] G73 X1. Y1. Z-.5 Q.2 R.1 F5.
End Cancel

X2. Y3.
X3. Y4.
G80

EMULATED CYCLE
CUSTOM1

THE OUTPUT CODE

G0 X[h] Y[v] Z[rplane]

G0 X1. Y1. Z.2

Z[vclear]

Z.1

G1 Z[d] F[plunge]

G1 Z-.5 F5.

G0 Z[rplane]

G0 Z.2

End

G0 X2. Y3. Z.2


Z.1
G1 Z-.5 F5.
G0 Z.2
G0 X3. Y4. Z.2
Z.1
G1 Z-.5 F5.
G0 Z.2

ADVANCED CYCLE
CUSTOM1 1

# INITIAL CYCLE.

G83 G99 R[vclear] Z[d] X[h] Y[v]


F[frate]
Z[d] R[vclear] X[h] Y[v].
End Cancel

THE OUTPUT CODE

G83 G99 R.1 Z-.5 X1. Y1.


F5.
# Secondary Cycles.

Z-.5 R.1 X2. Y3.


Z-.5 R.1 X3. Y4.
G80

Copyright 2000 by Surfware, Inc. All Rights Reserved.

103

104

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

6. Drill Mill, Lathe


The Drill sequence describes the straight drilling cycle the machine tool uses. This code is
usually coded as a G81 cycle.

MACHINE CYCLE
DRILL

THE OUTPUT CODE

G81 X[h] Y[v] Z[d] R[vclear] F[frate]

G81 X1. Y1. Z-.5 R.1 F5.

End Cancel

X2. Y3.
X3. Y4.
G80

EMULATED CYCLE
DRILL

THE OUTPUT CODE

G0 X[h] Y[v] Z[rplane]

G0 X1. Y1. Z.2

Z[vclear]

Z.1

G1 Z[d] F[plunge]

G1 Z-.5 F5.

G0 Z[rplane]

G0 Z.2

End

G0 X2. Y3. Z.2


Z.1
G1 Z-.5 F5.
G0 Z.2
G0 X3. Y4. Z.2
Z.1
G1 Z-.5 F5.
G0 Z.2

ADVANCED CYCLE
DRILL 1

# INITIAL CYCLE.

G81 X[h] Y[v] Z[d] R[vclear] F[frate]


Z[d] R[vclear] X[h] Y[v]

THE OUTPUT CODE

G81 X1. Y1. Z-.5 R.1 F5.


# Secondary Cycles.

End Cancel

Z-.5 R.1 X2. Y3.


Z-.5 R.1 X3. Y4.
G80

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

7. LTap Mill
This cycle is used for left hand threading.

MACHINE CYCLE
LTAP

THE OUTPUT CODE

G74 X[h] Y[v] Z[d] R[vclear] F[speed] Q[vbite]

G74 X1. Y1. Z-.5 R.1 F5. Q.2

End Cancel

X2. Y3.
X3. Y4.
G80

EMULATED CYCLE
LTAP

THE OUTPUT CODE

G0 X[h] Y[v] Z[rplane]

G0 X1. Y1. Z.4

G1 Z[d] F[frate]

G1 Z-.5 F5.

Z[rplane]

Z.4

End

G0 X2. Y3. Z.4


G1 Z-.5 F5.
Z.4
G0 X3. Y4. Z.4
G1 Z-.5 F5.
Z.4

ADVANCED CYCLE
LTAP 6

# INITIAL CYCLE.

THE OUTPUT CODE

F[frate]

F5.

G300 P[rplane]

G300 P.1

G306 Z0

G306 Z0

G308 Z[d]

G308 Z-.5

G323 P.5

G323 P.5

G84

G84

Copyright 2000 by Surfware, Inc. All Rights Reserved.

105

106

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

LTAP 6

# INITIAL CYCLE.

THE OUTPUT CODE

X[h] Y[v]

X1. Y1.

End Cancel

X2. Y3.
X3. Y4.
G80

8. Peck Mill, Lathe


This cycle is used to break the drill chips. It is often referred to as a deep hole drilling cycle.
It can be either a G73 or G83 code. Check the machine tool specification for the proper cycle
codes.

MACHINE CYCLE
PECK

THE OUTPUT CODE

G83 X[h] Y[v] Z[d] Q[vbite] R[vclear] F[frate] G83 X1. Y1. Z-.5 Q.2 R.1 F5.
End Cancel

X2. Y3.
X3. Y4.
G80

EMULATED CYCLE
When the machine tool does not have a Peck drilling cycle, the following example can be
used to create this cycle. The post processor will automatically output the Feed and Rapid
moves to synthesize a Peck drilling cycle. The moves output by this cycle are defined by the
FeedCode, Feed, and Rapid commands in the POSTFORM file. Typically the FeedCode
command identifies the feedrate moves with the letter F. The Feed command identifies the
feed move as being a G1 and the Rapid identifies the rapid moves as being G0. These can
be changed by you as the machine tool requires. During the cycle the tool is moved at rapid
motion to .05 of the last drill depth. Then the feed motion begins.

Peck
None
End
The output below shows this cycle output for two holes .375 deep with a .125 Peck increment.

%
O1
M6 T1 ( Tool Diam: 0.0625
G0 G90 S2000 M3 E1 X3.4875 Y5.3
H1 M7 Z1.
G0 Z0.1
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

G1 Z-0.025 F20.
G0 Z0.1
Z0.025
G1 Z-0.15
G0 Z0.1
Z-0.1
G1 Z-0.275
G0 Z0.1
Z-0.225
G1 Z-0.375
G0 Z1.
X4.8875 Y5.1875
Z0.1
G1 Z-0.025 F20.
G0 Z0.1
Z0.025
G1 Z-0.15
G0 Z0.1
Z-0.1
G1 Z-0.275
G0 Z0.1
Z-0.225
G1 Z-0.375
G0 Z1.
X4.9 Y4.425
Z0.1
G1 Z-0.025 F20.
G0 Z0.1
Z0.025
G1 Z-0.15
G0 Z0.1
Z-0.1
G1 Z-0.275
G0 Z0.1
Z-0.225
G1 Z-0.375
G0 Z1.
M5 M9
G0 G49 G90 Z0
E0 X0 Y0
M6 T1
M2
%
Copyright 2000 by Surfware, Inc. All Rights Reserved.

107

108

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

ADVANCED CYCLE
PECK 6

# INITIAL CYCLE.

THE OUTPUT CODE

F[frate]

F5.

G300 P[rplane]

G300 P.1

G306 Z0

G306 Z0

G307 U[vbite]

G307 U.125

G308 Z[d]

G308 Z-.5

G83

G83

X[h] Y[v]

# Secondary cycles.

X1. Y1.

End Cancel

X2. Y3.
X3. Y4.
G80

9. Ream Mill, Lathe


This cycle is used for a standard reaming cycle. The tool feeds in and out of the hole.

MACHINE CYCLE
REAM

THE OUTPUT CODE

G85 X[h] Y[v] Z[d] R[vclear] F[frate]

G85 X1. Y1. Z-.5 R.1 F5.

End Cancel

X2. Y3.
X3. Y4.
G80

EMULATED CYCLE
REAM

THE OUTPUT CODE

G0 X[h] Y[v] Z[rplane]

G0 X1. Y1. Z.1

G1 Z[d] F[frate]

G1 Z-.5 F5.

Z[rplane]

Z.1

End

G0 X2. Y3. Z.1


G1 Z-.5 F5.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

REAM

109

THE OUTPUT CODE

Z.1
G0 X3. Y4. Z.1
G1 Z-.5 F5.
Z.1

ADVANCED CYCLE
REAM 4

# INITIAL CYCLE.

THE OUTPUT CODE

F[frate]

F5.

G306 Z0

G306 Z0

G308 Z[d]

G308 Z-.5

G323 P.5

G323 P.5

G85 X[h] Y[v]

# Secondary cycles

End Cancel

G85 X1. Y1.


G85 X2. Y3.
G85 X3. Y4.
G80

10. Tap Mill, Lathe


This cycle is used for the tapping sequence. It can be used for a self-reversing or tension
compression tap holder.

MACHINE CYCLE
TAP

THE OUTPUT CODE

G84 X[h] Y[v] Z[d] R[vclear] F[speed]


Q[vbite]

G84 X1. Y1. Z-.5 R.1 F5. Q.2

End Cancel

X2. Y3.
G80

Copyright 2000 by Surfware, Inc. All Rights Reserved.

110

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

ADVANCED CYCLE
TAP 6

# INITIAL CYCLE.

THE OUTPUT CODE

F[frate]

F5.

G300 P[rplane]

G300 P.1

G306 Z0

G306 Z0

G308 Z[d]

G308 Z-.5

G323 P.5

G323 P.5

G84

G84

X[h] Y[v]

# Secondary cycles

End Cancel

X1. Y1.
X2. Y3.
G80

2.12

VARIABLES

In many of the sample sequences, variables must be used to indicate numerical values for the post
to insert into the NC program. These variables can be used in the same way the Feed, Rapid, Cw,
and Ccw lines are described above.
A variable is a word or letter that takes the place of a number. These variables indicate information
that is pertinent to machine motion. An X value on a mill generally indicates a horizontal position
so we simply abbreviate it as the letter h. The letter h is the variable that indicates horizontal
position. The code X[h] indicates that you want the X to appear followed by the value of the current
horizontal position.
The following is a list of the variable names, and the values to which they refer, that can be used
instead of numbers when describing the sequences. Remember to enclose any values or
variables between square bracket symbols, for example R[arcrad]. These symbols act as
delimiters and are not output in the NC code.
1. arcrad (p. 111)

24. homev (p. 116)

47. peck1 (p. 122)

70. taper (p. 126)

2. block (p. 112)

25. hvector (p. 116)

48. pecks (p. 122)

71. thickness (p. 126)

3. chams (p. 112)

26. incmode (p. 117)

49. pitch (p. 122)

72. times (p. 126)

4. comp (p. 112)

27. inidep (p. 117)

50. plunge (p. 122)

73. tipang (p. 127)

5. cool (p. 112)

28. initpower (p. 117)

51. pointd (p. 122)

74. tool (p. 127)

6. coolantoff (p. 112)

29. invtime (p. 117)

52. power (p. 123)

75. tool1 (p. 127)

7. d (p. 113)

30. ival (p. 118)

53. retplane (p. 123)

76. tparams (p. 127)

Figure 20: Global Variables

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

8. dcomp (p. 113)

31. ivect (p. 118)

54. rigid (p. 123)

77. turret (p. 128)

111

9. ddist (p. 113)

32. jval (p. 118)

55. rotangle (p. 123)

78. unitmode (p. 128)

10. depth (p. 113)

33. jvect (p. 118)

56. rotaxdir (p. 124)

79. upperdist (p. 128)

11. direct (p. 113)

34. kvect (p. 119)

57. rplane (p. 124)

80. v (p. 128)

12. dwell (p. 114)

35. lastd (p. 119)

58. sbite (p. 124)

81. v2 (p. 128)

13. endang (p. 114)

36. lasth (p. 119)

59. sclear (p. 124)

82. val1 - 10 (p. 128)

14. feedtype (p. 114)

37. lasthole (p. 119)

60. side (p. 124)

83. vbite (p. 129)

15. flood (p. 114)

38. lastrotang (p. 120)

61. sleave (p. 124)

84. vcdc (p. 129)

16. frate (p. 115)

39. lasttool (p. 120)

62. sparkgap (p. 124)

85. vclear (p. 129)

17. gauge (p. 115)

40. lastv (p. 121)

63. speed (p. 125)

86. vctr (p. 129)

18. h (p. 115)

41. lcomp (p. 121)

64. speedtype (p. 125)

87. vdist (p. 129)

19. h2 (p. 115)

42. lowerdist (p. 121)

65. startang (p. 125)

88. vgauge (p. 129)

20. hcdc (p. 115)

43. movelength (p. 121) 66. stop (p. 125)

89. vleave (p. 130)

21. hctr (p. 115)

44. movetime (p. 121)

67. sub (p. 125)

90. vvector (p. 130)

22. hdist (p. 116)

45. nexttool (p. 121)

68. subline (p. 126)

91. wirefeed (p. 130)

23. homeh (p. 116)

46. passes (p. 122)

69. sweep (p. 126)

Figure 20: Global Variables

1. endh (p. 131)

4. program# (p. 131)

7. toolv (p. 132)

10. workh (p. 133)

2. endv (p. 131)

5. toold (p. 132)

8. work (p. 132)

11. workv (p. 133)

3. maxrpm (p. 131)

6. toolh (p. 132)

9. workd (p. 133)

Figure 21: Prompted Variables

1. corner (p. 133)

2. tooldiam (p. 134)

3. toolrad (p. 134)

Figure 22: Tool Comment Variables

2.13

GLOBAL VARIABLES

1. arcrad Mill, Lathe, EDM


This variable outputs the radius of the arc.

CwCode
G11 I[ival] J[jval] R[arcrad] C[startang]
G12 C[endang]
End
Related Variables: endang, startang

Copyright 2000 by Surfware, Inc. All Rights Reserved.

112

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2. block Mill, Lathe, EDM


A Block number is output for this variable. It is incremented according to the Sequence#s line.
Refer to Section 2.20: Block Number Output on page 148.

N[block] T[tool] M6
G0 G90 S[speed] M[direct]
X[h] Y[v]
3. chams Lathe
This variable identifies the number of thread to cut for the taper out move.
Related Variables: passes, tipang, tparams
4. comp Lathe
This variable outputs a Lathe compensated T number.

1stToolChange
O[comp] G90 S[speed] M42
G[feedtype] M31
G92 S[maxrpm]
G0 X.4 Z.4
M[direct]
V77 T[tool] M6
G0 X[v] Z[h] M32
G[speedtype] R[v] S[speed]
End
5. cool Mill, Lathe, EDM
The Coolant value, defined by the Coolant command for on, off, or mist is output for this variable.

ToolChange
M5 M9
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: coolantoff
6. coolantoff Mill, Lathe, EDM
This variable outputs a coolant off command as defined by the Coolant command.

ToolChange
M5 M[coolantoff]
G0 G49 G90 Z0
E0 X0 Y0
M6 T[tool1]
M2
Related Variables: cool
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

113

7. d Mill, Lathe, EDM


This variable outputs the current depth value.

1stToolChange
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: h, v, endh, endv, homeh, homev, lastd, lasth, lastv
8. dcomp Mill, Lathe
This outputs the Diameter compensation offset number. It is used when cutter compensation is
desired in the NC program.

Infeed
H[lcomp] D[dcomp] Z[d]
G1 G[side] X[h] Y[v] F[frate]
End
Related Variables: hcdc, vcdc, lcomp
9. ddist Mill
This variable outputs the distance the depth axis moves during the current move. This variable is
not specifically coded in the POSTFORM file.
Related Variables: hdist, vdist.
10. depth Mill, Lathe, EDM
This variable outputs the depth of the upcoming cycle for milling machines and the total depth of
thread for lathes.

AutoThread
G76 A[tparams] Q[vbite] R0
G76 X[v] Z[h] R[startang] P[depth] q[peck1] F[frate]
End
11. direct Mill, Lathe, EDM
The M code value of the Spindle direction is output with this variable. The value is defined by the
CW and CCW commands.

1stToolChange
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Copyright 2000 by Surfware, Inc. All Rights Reserved.

114

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

12. dwell Mill, Lathe, EDM


This variable outputs the Dwell value.

Drill 3
S0
Z[d]
X[h] Y[v] G81
L2 M61
G4 P[dwell]
L2 M62
G4 P[dwell]
End
13. endang Mill, Lathe, EDM
The ending angle of an arc is output for this variable.

CwCode
G11 I[ival] J[jval] R[arcrad] C[startang]
G12 C[endang]
End
Related Variables: arcrad, lastrotang, rotangle, startang
14. feedtype Mill, Lathe, EDM
The G code for IPR and IPM output that is set with the FeedType command is output for this
variable.

1stToolChange
O[comp] G90 S[speed] M42
G[feedtype] M31
G92 S[maxrpm]
G0 X.4 Z.4
M[direct]
V77 T[tool] M6
G0 X[v] Z[h] M32
G[speedtype] R[v] S[speed]
End
Related Variables: frate, plunge.
15. flood EDM
This variable is similar to the cool variable. The options are low, off, medium, and high.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

115

16. frate Mill, Lathe, EDM


This variable outputs the Feed Rate value.

Drill
G81 G99 R[vclear] Z[d] F[frate] X[h] Y[v]
End Cancel
Related Variables: feedtype, plunge
17. gauge Mill, Lathe
This variable outputs the Z axis gauge length for both mills and lathes.
18. h Mill, Lathe, EDM
This variable outputs the current horizontal value.

1stToolChange
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: d, v, endh, ednv, homeh, homev, lastd, lasth, lastv
19. h2 EDM
This variable outputs the current horizontal value for the auxiliary second plane.
Related Variables: v2
20. hcdc Mill
This variable outputs the horizontal component of the cutter diameter compensation vector for
older machine tools.

Linecode
G79 X[h] Y[v] E0 H0 P[hcdc] Q[vcdc] F[frate]
End
Related Variables: dcomp, lcomp, vcdc
21. hctr Mill, Lathe, EDM
This variable outputs the absolute horizontal center value of an arc.

CwCode
c0 I[hctr] J[vctr] K[d]
I0.0 J0.0 K1.0
x[h] y[v] z[d]
End
Related Variables: vctr.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

116

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

22. hdist Mill


This variable outputs the horizontal distance the axis moves during the current move. This variable
is not specifically coded in the POSTFORM file.
Related Variables: ddist, vdist
23. homeh Mill, Lathe
The horizontal home position for Lathes is output for this variable.

EndCode
G0 X[homeh] Z[homev] T[tool] t0 M5
M30
%0
End
Related Variables: d, h, v, endh, endv, homev, lastd, lasth, lastv
24. homev Mill, Lathe
The vertical home position for Lathes is output for this variable.

EndCode
G0 X[homeh] Z[homev] T[tool] t0 M5
M30
%0
End
Related Variables: d, h, v, endh, endv, homeh, lastd, lasth, lastv
25. hvector Mill, Lathe, EDM
This variable outputs the horizontal vector direction of the first completely compensated cutting
move. It is used on machines that do not have "look ahead" ability to indicate which way the tool
is going to go on the move after the infeed.
Infeed
G1 X[h] Y[v] F[frate]
G91
G1 A[hvector] B[vvector]
G[side] I[hvector] J[vvector] D[dcomp]
G90
G86 R-.1 Z[d] F[plunge] D[lcomp]
F[frate]
End
The following example shows the use of this variable for the AGIE EDM machine tool.

Infeed
G1 x[hvector] y[vvector] G44

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

117

G1 X[h] Y[v] G40


End
Related Variables: vvector
26. incmode Mill, Lathe, EDM
The incremental code defined by the Inc/Abs command is output for this variable.

ToolChange
M5 M9
G0 G49 G[incmode] Z0
M6 T[tool]
G0 G[incmode] S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
27. inidep Mill, Lathe, EDM
This variable is the initial depth where cutting begins.

ToolChange
M5 M9
G0 G49 G90 Z0
M6 T[tool]
G0 G90 S[speed] M[direct] X[h] Y[v]
H[lcomp] M[cool] Z[d]
G83 R[vclear] z[inidep] F[frate] Q[vbite] X[h] Y[v]
G80
End
Related Variables: plunge, rplane
28. initpower EDM
This is the value entered in the Initl Power field.
29. invtime Lathe
This variable outputs the inverse time for 4 axis motion. Check the machine manual to determine
the correct letter format to use for the InvTime variable. Not all machine tools use the letter F.
Some machine tools may also require the use of the G93 code.

LineCode
G1 X[h] Y[v] Z[d] F[InvTime]
End
Related Variables: movelength, movetime

Copyright 2000 by Surfware, Inc. All Rights Reserved.

118

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

30. ival Mill, Lathe, EDM


This variable outputs the X axis coordinates of the center of an arc. The incremental or absolute
output is determined by the CtrIncremental? command.

CcwCode
F[frate]
X[h] Y[v] I[ival] J[jval]
End
Related Variables: ivect, jval, jvect, kvect
31. ivect Mill, Lathe, EDM
This variable is used to describe the normal X axis vectors for 3D cutter compensation used by
some machines. They can be added to a LineCode sequence as follows:

LineCode
G1 X[h] Y[v] Z[d] I[ivect] J[jvect] K[kvect] F[frate]
End
Related Variables: ival, jval, jvect, kvect
Note:

Requires SURFCAM 5 axis.

32. jval Mill, Lathe, EDM


This variable outputs the Y axis coordinates of the center of an arc. The incremental or absolute
output is determined by the CtrIncremental? command.

CcwCode
F[frate]
X[h] Y[v] I[ival] J[jval]
End
Related Variables: ival, ivect, jvect, kvect
33. jvect Mill, Lathe, EDM
This variable is used to describe the normal Y axis vectors for 3D cutter compensation used by
some machines. They can be added to a LineCode sequence as follows:

LineCode
G1 X[h] Y[v] Z[d] I[ivect] J[jvect] K[kvect] F[frate]
End
Related Variables: ival, ivect, jval, kvect
Note:

Requires SURFCAM 5 axis.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

119

34. kvect Mill, Lathe, EDM


This variable is used to describe the normal Z axis vectors for 3D cutter compensation used by
some machines. They can be added to a LineCode sequence as follows:

LineCode
G1 X[h] Y[v] I[ivect] J[jvect] K[kvect] F[frate]
End
Related Variables: ival, ivect, jval, jvect.
Note:

Requires SURFCAM 5 axis

35. lastd Mill, Lathe, EDM


The position of the last depth move is output for this variable.

UnWind
G0 G49 G90 Z0
A0
E[work]
H[lcomp] M[cool] Z[d]
G0 X[lasth] Y[lastv] A[lastrotang]
G1 Z[lastd]
End
Related Variables: d, h, v, endh, endv, homeh, homev, lasth, lastv
36. lasth Mill, Lathe, EDM
The position of the last horizontal move is output for this variable.

UnWind
G0 G49 G90 Z0
A0
E[work]
H[lcomp] M[cool] Z[d]
G0 X[lasth] Y[lastv] A[lastrotang]
G1 Z[lastd]
End
Related Variables: d, h, v, endh, endv, homeh, homev, lastd, lastv
37. lasthole Mill, Lathe
Some controls require a M99 at the end of a drilling cycle rather then a G80.
Heidenhain 2500B is similar to a Fanuc G80 but the M99 must be on the same line as the last X,
Y, or it drills the hole twice. The [LastHole] variable that gets set to 1 if the hole currently being
processed is the last one in the cycle. (Otherwise, its set to 0.)
This variable can be used inside any canned cycle to differentiate between the last hole and all
others.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

120

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Following is an example of the changes needed in the postform file:


Drill 2
if [LastHole] = 1
G<81> X<H> Y<V> Z<D> R<Vclear> F<FRate> M99
else
G<81> X<H> Y<V> Z<D> R<Vclear> F<FRate>
endif

# Drilling canned/manual cycle

if [LastHole] = 1
X<H> Y<V> Z<D> R<Vclear> F<FRate> M99
else
X<H> Y<V> Z<D> R<Vclear> F<FRate>
Endif
38. lastrotang Mill
This variable outputs the previous rotary axis position.

UnWind
G0 G49 G90 Z0
A0
E[work]
H[lcomp] M[cool] Z[d]
G0 X[lasth] Y[lastv] A[lastrotang]
G1 Z[lastd]
End
Related Variables: arcrad, endang, rotangle, startang, sweep
39. lasttool Mill, Lathe
This variable outputs the tool number of the previous tool.

UnWind
G0 G49 G90 Z0
A0
E[work]
H[lcomp] M[cool] Z[d]
G0 X[lasth] Y[lastv] A[lastrotang]
G1 Z[lastd]
M6 T[lasttool]
End
Related Variables: nexttool, tool, tool1.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

121

40. lastv Mill, Lathe, EDM


The position of the last vertical move is output for this variable

UnWind
G0 G49 G90 Z0
A0
E[work]
H[lcomp] M[cool] Z[d]
G0 X[lasth] Y[lastv] A[lastrotang]
G1 Z[lastd]
End
Related Variables: d, h, v, endh, endv, homeh, homev, lastd, lasth
41. lcomp Mill
This variable outputs the length compensation offset number. It is output for milling machines only.

1stToolChange
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: dcomp, hcdc, vcdc
42. lowerdist EDM
This is the distance from the bottom of the part to the lower guide.
43. movelength Lathe
This variable outputs the total chordal length of the current move. It does not consider the 4 axis
motion, it is the difference in location from the start location to the end location of the axis position.
This code is not specifically coded in the POSTFORM file.
Related Variables: movetime, InvTime
44. movetime Lathe
This variable determines the amount of time the machine should require to execute the current
movement. It is equal to the movelength value divided by the frate value. This code is not
specifically coded in the POSTFORM file.
Related Variables: movelength, InvTime
45. nexttool Mill, Lathe
This variable outputs the tool number of the next tool to be used. This can be used to index the
tool changer before the next tool change.
1stToolChange
M6
G0 G90 S[speed] M[direct]
X[h] Y[v]
G43 H[lcomp] Z[d] T[nexttool]
Copyright 2000 by Surfware, Inc. All Rights Reserved.

122

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

M[cool]
End
Related Variables: lasttool, tool, tool1
46. passes Lathe
This variable identifies the number of spring passes for thread cutting.
Related Variables: chams, tipang, tparams
47. peck1 Lathe
This is the depth of the first thread pass for the G76 cycle. It is used for Lathes only.
AutoThread
G76 A[tparams] Q[vbite] R0
G76 X[v] Z[h] R[startang] P[depth] q[peck1] F[frate]
End

Related Variables: pecks


48. pecks Mill
This variable outputs the number of pecks to use.
Drill
G81 Y[h] T[v] Z[d] z[pecks]
End Cancel

Related Variables: peck1


49. pitch Mill, Lathe
This is the number of threads per unit.
50. plunge Mill, Lathe
This variable outputs the plunge feed rate value.

1stToolChange
G90 M[direct] S[speed]
G80 T[tool] M06
G00 X[h] Y[v] F[frate]
G86 R-0001 Z[d] F[plunge] D[lcomp]
End
Related Variables: inidep, rplane

51. pointd Mill


This variable is used when the machine tool requires the hole depth to be described from the surface
of the part.

Drill
G81 X[h] Y[v] Z[pointd] R[vclear] F[frate]
End Cancel
Related Variables: d

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

123

52. power EDM


This is the value entered in the Power Setting field.

53. retplane Lathe, Mill


Return Plane Variable sets the value defined by the RetractPlane command for output in the NCC
code (Drilling Cycles).

Drill
G81 G[RetPlane] X[H] Y[V] ...
end
- G98 when the tool should rapid at the (higher) "initial plane" (the posts [RPlane] level), or
- a G99 when the tool should rapid at the (lower) "rapid level" (the posts [VClear] level).
54. rigid Mill, Lathe
SURFCAM posts sets to the value of 1 during a rigid tapping cycle. During any other cycle, [Rigid] is set
to 0. Use an IF line to detect rigid tapping and output the appropriate code(s) in the TAP and CANCEL
sequences.

NOTE:

Tap
If [Rigid] > 0
G93
G93 to lock Z to spindle rotation.
G84 X[H] Y[V] Z[D] K[VBite] J0 R[VClear] F[FRate]
else
G84 X[H] Y[V] Z[D] R[VClear] F[FRate] Normal (non-rigid) tap.
endif
end cancel
The [Rigid] variable is not reset until the start of the next cycle, it can be used in the
CANCEL sequence as well as the TAP sequence.
cancel
G80
if [Rigid] > 0
G94
Unlock Z if w/ rigid tap.
endif
end

55. rotangle Mill


The rotary angle position in degrees is output for this variable.

Index X
G0 G49 G90 Z0
X[h] Y [v] E[val1] A[rotangle]
H[comp] M[cool] Z[d]
End
Related Variables: arcrad, endang, lastrotang, startang, sweep
Copyright 2000 by Surfware, Inc. All Rights Reserved.

124

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

56. rotaxdir Mill


This variable reports the direction of 4 axis moves, CCW motion reports 30 & CW motion reports 31.

57. rplane Mill


This variable outputs the Z dimension of the Rapid Plane for milling machines only.

Drill 3
H[lcomp] M[cool] Z[rplane]
G81 Z[d] R[vclear] F[frate]
X[h] Y[v]
End
Related Variables: inidep, rplane
58. sbite Mill, Lathe
This is the Side cut amount output.
Peck
G74 R[depth]
G74 Z[h] Q[sbite] F[frate]
End
Related Variables: sclear, sleave, vbite, vclear, vleave
59. sclear Mill, Lathe
This variable outputs the Side Clearance amount.
Back
G76 G99 R[vclear] z[d] F[frate] Q[sclear] X[h] Y[v]
End Cancel
Related Variables: sbite, sleave, vbite, vclear, vleave
60. side Mill, Lathe, EDM
The Cutter compensation side value is output for this variable. It is determined by the DComp
command entered in the POSTFORM file.
Infeed
G1 G[side] X[h] Y[v] F[frate]
End
61. sleave Mill, Lathe
This variable outputs the Side Leave amount.
Outfeed
G1 G40 X[sleave] Y[sleave] F[frate]
End
Related Variables: sbite, sclear, vbite, vclear, vleave
62. sparkgap EDM
This is the value entered in the Spark gap field.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

125

63. speed Mill, Lathe, EDM


The Spindle speed value is output for this variable.

1stToolChange
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: speedtype
64. speedtype Lathe
This is the Speed code defined by the SpeedType command. This variable is for Lathe machines
only.

1stToolChange
O[comp] G90 S[speed] M42
G[feedtype] M31
G92 S[maxrpm]
G0 X.4 Z.4 M[direct]
V77 T[tool] M6
G0 X[v] Z[h] M32
G[speedtype] R[v] S[speed]
End
Related Variables: speed, maxrpm
65. startang Mill, Lathe
This outputs the Starting Angle of an arc.
AutoThread
G76 A[tparams] Q[vbite] R0
G76 X[v] Z[h] R[startang] P[depth] q[peck1] F[frate]
End
Related Variables: arcrad, endang, lastrotang, rotangle, sweep
66. stop EDM
Stop codes, M0 or M1, are placed at the end of the first cutting pass and at the end of the tab
cutting pass.
67. sub Mill, Lathe
This variable outputs the Subprogram number.

SubCall
E[work] X[h] Y[v]
M[98] P[sub] L[times]
End
Related Variables: subline, times

Copyright 2000 by Surfware, Inc. All Rights Reserved.

126

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

68. subline Mill, Lathe


This variable outputs the N number for the Subprogram.

SubCall
E[work] X[h] Y[v]
M98 P[subline] L[times]
End
Related Variables: sub, times
69. sweep Mill, Lathe, EDM
This is used to output the span of an arc. It is measured in degrees. This is typically used with the
CcwCode and CwCode sequences. The value output for clockwise arcs is negative; use the MULT
modifier or RevSign to reverse the output when required.

CwCode
I[hctr] J[vctr]
C2 A[sweep]
End
Related Variables: arcrad, endang, lastrotang, rotangle, startang
70. taper Lathe, EDM
This is the value entered in the Taper field.
It is the difference in height at the start and end of the thread. It is usually an I value.
Lathe example:

AutoThread
G76 A[tparams] Q[vbite] I[taper] R0
G76 X[v] Z[h] R[startang] P[depth] q[peck1] F[frate]
End
EDM example:

LineCode
G1 X[H] Y[V] A[taper]
End
71. thickness EDM
This is the thickness of the material being cut.
72. times Mill, Lathe
This variable outputs the number of repetitions for the Subprogram.

SubCall
E[work] X[h] Y[v]
M98 P[subline] L[times]
End
Related Variables: sub, subline

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

127

73. tipang Lathe


This variable identifies the angle on the cutting tool.
Related Variables: passes, chams, tparams
74. tool Mill, Lathe
This variable outputs the current Tool number.

1stToolChange
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: lasttool, nexttool, tool1
75. tool1 Mill, Lathe
This is the tool number of the first tool in the program. It is usually referenced in the EndCode
section to return the turret to tool position number one at the end of the program.
EndCode
M5 M9
G0 G49 G90 Z0
E0 X0 Y0
M6 T[tool1]
M2
%0
End
Related Variables: lasttool, nexttool, tool
76. tparams Lathe
This is a six digit code containing three parameters that consist of two digits each. These digits
are defined in the following example:
A010360
A
01
03
60

Identifies the axis letter designation.


Identifies the number of spring passes.
Identifies the number of threads to cut for the taper out move.
Identifies the angle on the cutting tool. This is a 60 degree tool.
AutoThread
G76 A[tparams] Q[vbite] R0
G76 X[v] Z[h] R[startang] P[depth] q[peck1] F[frate]
End

Related Variables: chams, passes, tipang

Copyright 2000 by Surfware, Inc. All Rights Reserved.

128

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

77. turret Lathe


The number of the currently active turret. This variable is for Lathe only.
ToolChange
G0 T[lasttool] t0 Z[h] M5
D[turret]
T[tool] t0
G[feedtype] G[speedtype] S[speed] M[direct]
G0 X[v] Z[h] T[tool] t[lcomp] M[cool]
End
78. unitmode Mill, Lathe, EDM
This variable outputs the value for the G code defined by the Inch/MM command.
1stToolChange
M6 T[tool]([0] d[toolrad] e[tooldiam] f[corner]
G0 G[unitmode] G90 S[speed] M[direct]
E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
79. upperdist EDM
This is the distance from the top of the part to the upper guide.
80. v Mill, Lathe, EDM
The current Vertical value is output.
1stToolChange
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: d, h, endh, endv, homeh, homev, lastd, lasth, lastv
81. v2 EDM
This variable outputs the current vertical value for the auxiliary second plane.
Related Variables: h2
82. val1 - 10 Mill, Lathe, EDM
These values are defined by the Ask command.
Index X
Ask [val1] "Enter the fixture offset number?" "1"
G0 G49 G90 Z0
X[h] Y[v] E[val1] A[rotangle]
H[lcomp] M[cool] Z[d]
End

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

129

83. vbite Mill, Lathe


This is the Vertical cut amount for vmilling machines. This variable also describes the minimum
depth of the G76 threading cycle for Lathe.
LTap
G74 G99 R[vclear] Z[d] F[frate] Q[vbite] X[h] Y[v]
End Cancel
Related Variables: sbite, sclear, sleave, vclear, vleave
84. vcdc Mill, Lathe
This variable outputs the vertical component of the cutter diameter compensation vectorv in older
Cincinnati formats.
Linecode
G79 X[h] Y[v] H0 P[hcdc] Q[vcdc] F[frate]
End
Related Variables: dcomp, hcdc, lcomp
85. vclear Mill
This variable outputs the Vertical Clearance amount for milling machines only.

LTap
G74 G99 R[vclear] Z[d] F[frate] Q[vbite]
X[h] Y[v]
End
Related Variables: sbite, sclear, sleave, vbite, vleave
86. vctr Mill, Lathe, EDM
This variable outputs the absolute Vertical Center value of an arc.

CwCode
c0 I[hctr] J[vctr] K[d]
I0.0 J0.0 K1.0
x[h] y[v] z[d]
End
Related Variables: hctr
87. vdist Mill
This variable outputs the vertical distance the axis moves during the current move. This variable
is not specifically coded in the POSTFORM file.
Related Variables: ddist, hdist
88. vgauge Mill, Lathe
This variable outputs the X axis gauge length for lathes, 0 for mills.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

130

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

89. vleave Mill, Lathe


The Vertical Leave amount is output for this variable.

AutoThread
G76 A[tparams] Q[vbite] R0
G76 X[v] Z[h] P[peck1] Q[vleave] R0 F[frate]
End
Related Variables: sbite, sclear, sleave, vbite, vclear
90. vvector Mill, Lathe, EDM
This variable outputs the vertical vector direction of the first completely compensated cutting
move. It is used on machines that do not have "look ahead" ability to indicate which way the tool
is going to go on the move after the infeed.
Infeed
G1 X[h] Y[v] F[frate]
G91
G1 A[hvector] B[vvector]
G[side] I[hvector] J[vvector] D[dcomp]
G90
G[86] R-.1 Z[d] F[plunge] D[lcomp]
F[frate]
End
The example below shows the use of this variable for the AGIE EDM machine tool:
Infeed
G1 x[hvector] y[vvector] G44
G1 X[h] Y[v] G40
End
Related Variables: hvector
91. wirefeed EDM
This is the value entered in the Wirefeed field.

2.14

PROMPTED VARIABLES

The following variables are called prompted variables because they refer to values that are
entered by you. They are not based on values that are within the incoming tool motion. When
these variables are used in the format, the post prompts you for the value when the post starts
reading the format.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

131

1. endh Mill, Lathe


This variable prompts you for the horizontal position for the tool at the end of the program.

EndCode
G0 X[endv] Z[endh]
M30
End
Related Variables: d, h, v, endv, homeh, homev, lasth, lastv
2. endv Mill, Lathe
This variable prompts you for the vertical position for the tool at the end of the program.

EndCode
G0 X[endv] Z[endh]
M30
End
Related Variables: d, h, v, endh, homeh, homev, lasth, lastv
3. maxrpm Mill, Lathe
This variable prompts you for the maximum spindle speed.

1stToolChange
O[comp] G90 S[speed] M42
G[feedtype] M31
G92 S[maxrpm]
G0 X.4 Z.4
M[direct]
V77 T[tool] M6
G0 X[v] Z[h] M32
G[speedtype] R[v] S[speed]
End
Related Variables: speed
4. program# Mill, Lathe, EDM
You are prompted for the program number to use at the beginning of the program. The Post
Processor does not display a prompt for this variable when the program number is specified in the
SURFCAM Program Information dialog box.

StartCode
%0
O[program#]
End

Copyright 2000 by Surfware, Inc. All Rights Reserved.

132

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

5. toold Mill, Lathe


You are prompted for the Tool change position Depth.

ToolChange
G0 Z[toold] T[tool] t0 M9
M1
T[tool]
G[feedtype] G[speedtype] S[speed] M[direct]
G0 X[v] Z[d] T[tool] t[lcomp] M[cool]
End
Related Variables: toolh, toolv
6. toolh Mill, Lathe
This variable prompts you for the Horizontal Tool change position.

ToolChange
G0 Z[toolh] T[tool] t0 M9
M1
T[tool]
G[feedtype] G[speedtype] S[speed] M[direct]
G0 X[v] Z[h] T[tool] t[lcomp] M[cool]
End
Related Variables: toold, toolv
7. toolv Mill, Lathe
This variable prompts you for the Vertical Tool change position.
ToolChange

T0
X[toolv] Z[toolh] A0.1
S9 T[tool]
X[v] Z[h]
End
Related Variables: toold, toolh
8. work Mill, Lathe
You are prompted for the Work offset number. The Post Processor does not display a prompt for this
variable when the program number is specified in the SURFCAM Program Information dialog box.

1stToolChange
M6 T[tool]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: workd, workh, workv
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

9. workd Mill, Lathe


You are prompted for the Work origin offset coordinate of the Spindle Axis.

StartCode
G90 G94 G0 G17
G92 X[workh] Y[workv] Z[workd]
End
Related Variables: work, workh, workv
10. workh Mill, Lathe
You are prompted for the Work origin offset coordinate of the Horizontal Axis.

StartCode
G90 G94 G0 G17
G92 X[workh] Y[workv] Z[workd]
End
Related Variables: work, workd, workv
11. workv Mill, Lathe
You are prompted for the Work origin offset coordinate of the Vertical Axis.

StartCode
G90 G94 G0 G17
G92 X[workh] Y[workv] Z[workd]
End
Related Variables: work, workd, workh

2.15

TOOL COMMENT VARIABLES

These variables can be used to automatically comment tool changes.


1. corner Mill, Lathe
The tool corner radius is output for this variable. It is typically used for comments.

1stToolChange
M6 T[tool] ([0] d[toolrad] e[tooldiam] f[corner]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: style, tooldiam, toolrad

Copyright 2000 by Surfware, Inc. All Rights Reserved.

133

134

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2. tooldiam Mill
This is the diameter of the current tool. It is typically used for tool comments.

1stToolChange
M6 T[tool] ([0] d[toolrad] e[tooldiam] f[corner]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: corner, style, toolrad
3. toolrad Mill, Lathe
This variable outputs the radius of the current tool.

1stToolChange
M6 T[tool] ([0] d[toolrad] e[tooldiam] f[corner]
G0 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Related Variables: corner, style, tooldiam.

2.16

4 AXIS WIRE EDM CUTTING

EPOSTWIN.EXE requires two incoming INC files, the first for the Program (XY) plane, and the
second for the Auxiliary (UV) plane. The two INC files are created with NC 2 Axis Contour under
the following guidelines.
Geometry
Create geometry for both the Program plane and the Auxiliary plane. The contours should be
oriented parallel to the XY plane. The Z position of each contour is not important, since the
post processor ignores any Z information.
Surface
Create a Synchronized cross section surface to verify the synchronization of the XY and UV
contours. If SURFCAM does not prompt for Synchronize before creating a surface, you
should break, trim, or increment the geometry until the XY and UV contours have the same
number of elements.
Cut
NC 2 Axis Contour the XY and UV contours with the infeed type set to With C-Comp and the
tool number greater than zero, even though tool numbers are not required in the actual NC
code. The INC filename for the UV contour must be the same as the XY INC file with an X
appended to the filename.

EDM.INC for the XY contour


EDMX.INC for the UV contour

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

135

Note:

Both INC files must be the same size and the tool motion must be in the same order.
This may preclude the use of splines within the contours because the number of linear
moves required to cut a spline may not be the same.

Note:

The post processor will automatically merge the XY and UV INC files without having to
specify the UV filename.

Note:

When offsetting for the wire thickness and cutting outside corners, additional moves
may be created and cause synchronization to fail.

Note:

SURFCAM defaults to optimizing contours which may cause synchronization to fail. Set
the curve tolerance to zero and SURFCAM will not optimize the contours.

2.17

ENGLISH / METRIC OUTPUT

SURFCAM can be configured to output NC code in either English (inch) or Metric (millimeter)
units. The output is affected by the system settings and the Post Processor word address,
commands and variables.
To produce the NC code SURFCAM uses the INC file created when the geometry is cut. This INC
file can be in either English or Metric units. This output is effected by the system settings when the
geometry is created. The INC file values are defined by the input values when the geometry is
created. When the system setting is in Inch mode for the geometry creation, the INC file output
values are the same as those entered by the user. SURFCAM does not convert the geometry
values to metric when the system setting is switched to MM units.
Note:

The INC file output unit is not the determining factor for the NC code output units.

The Post Processor uses INC file, Word Address, Inch/MM command, and unitmode variable to
determine the NC code output units.

2.17.1

INC File

The INC file output units are determined by the Inches / MM command on the Options menu.
The system default is for Inch output. When this option is selected the system uses millimeter
input for all dialog boxes and the INC file is output in metric units.

2.17.2

Word Address

The Word Address can be used to convert an Inch INC file to millimeters by using the Mult
modifier. This modifier only affects the Word Address for which it is coded. It must be used
for each Word Address that requires the conversion.
Mult
The value after this command is used as a multiplier for all the values that will output for
this word. The following example will output metric values:

Copyright 2000 by Surfware, Inc. All Rights Reserved.

136

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

X ->3.>4 Mult 25.4


INC FILE VALUE

NC CODE OUTPUT

11.

X279.4

2.5

X63.5

.2135

X5.4229

Note:

Division is accomplished by multiplying by the inverse. Mult .03937 converts metric


to inches.

2.17.3

Inch/MM

The Inch/MM line indicates the numerical values of the G code that set the inch or millimeter
programming mode on the NC machine. The code selected by the Post Processor is
determined by the INC file output units. When the system is set to Inch, the Inch code is used.
When the system is set to MM, the Metric code is used. For most machines, it is G70 and
G71. The example below is entered in the POSTFORM file for a machine tool that uses G20
and G21 for inch and millimeter mode.

Inch/MM 20 21
The default for this command is 70 71 for mills and 20 21 for lathes.

2.17.4

Unitmode

This variable outputs the value for the G code defined by the Inch/MM command.

1stToolChange
M6 T[tool] ([0] d[toolrad] e[tooldiam] f[corner]
G0 G[unitmode] G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
Note:

When the Mult modifier is used to convert the Word Address, this variable must
not be used. The machine code for the units must be hard coded.

2.17.5

POSTFORM Formatting

The examples below show a variety of methods to output English or Metric unit NC code.
This example uses the system default of Inch units to create the geometry and the INC file.
The NC code output units is Inches.

Inch/MM 70 71
1stToolChange
M6 T[tool]
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

137

G0 G[unitmode] G90 S[speed] M[direct] E[work] X[h] Y[v]


H[lcomp] M[cool] Z[d]
End
The output code:

M6 T1
G0 G70 G90 S2000 M3 E1 X1. Y1.
H1 M7 Z.1
This example uses the system MM units to create the geometry and the INC file. The NC
code output units is Millimeters.
Inch/MM 70 71
1stToolChange
M6 T[tool]
G0 G[unitmode] G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
The output code:

M6 T1
G0 G71 G90 S2000 M3 E1 X25.4 Y25.4
H1 M7 Z2.54
This example uses the system default Inch units to create the geometry and the INC file. The
NC code output units is Millimeters for the X and Y axis. The Mult modifier is used in the Word
Address. The machine G code for the metric mode must be hard coded into the sequences.
X ->3.>4 Mult 25.4
Y ->3.>4 Mult 25.4
Inch/MM 70 71
1stToolChange
M6 T[tool]
G0 G71 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
The output code:

M6 T1
0 G71 G90 S2000 M3 E1 X25.4 Y25.4
H1 M7 Z.1

Copyright 2000 by Surfware, Inc. All Rights Reserved.

138

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

This example uses the system default MM units to create the geometry and the INC file. The
NC code output units is Inches for the X and Y axis. The Mult modifier is used in the Word
Address. The machine G code for the metric mode must be hard coded into the sequences.

X ->3.>4 Mult .03937


Y ->3.>4 Mult .03937
Inch/MM 70 71
1stToolChange
M6 T[tool]
G0 G70 G90 S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
The output code:

M6 T1
G0 G70 G90 S2000 M3 E1 X1. Y1.
H1 M7 Z2.54

2.18

INCREMENTAL OUTPUT

Incremental output is determined by the use of word address modifiers, commands and variables.
WORD ADDRESS MODIFIERS:

COMMANDS:
VARIABLES:

2.18.1

Inc
Mult
Sub
Incremental?
Inc/Abs
incmode

Abs/Inc

All output for this word will be incremental. The default is absolute. It can be coded although
it is not necessary. The examples below output the Y values incrementally. The examples
below also indicate the Y incremental move values based on the starting point of Y0.
Y ->3.>4 Inc
INC FILE VALUE

NC CODE OUTPUT

11.

Y11.

-2.5

Y-13.5

.2135

Y2.7135

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.18.2

139

Mult

The value after this command is used as a multiplier for all the values that will output for this
word. The following example will output metric values.
X ->3.>4 Mult 25.4
INC FILE VALUE

NC CODE OUTPUT

11.

X279.4

2.5

X63.5

.2135

X5.4229

Note:

Division is accomplished by multiplying by the inverse. Mult .03937 converts metric


to inches.

2.18.3

Sub

Subtraction modifier added to the functionality of the post.


Example:
Z ->4.>3 sub 1
Will subtract 1 from every value that uses the Z address.

2.18.4

Incremental? Mill, Lathe, EDM

This switch is used to set the machine output to the Incremental or Absolute mode.

Incremental? Y
This will cause the code to be output in Incremental. The machine can also require a G91.
Ensure that a G91 code is placed in your StartCode or 1stToolChange sequence.
Note:

The Y can easily be changed to an N to result in absolute programs. Remember


to remove the G91 in your StartCode or 1stToolChange sequence. When absolute
and incremental programs are both used regularly, create two appropriate posts
within the POSTFORM file.

When incremental output is desired, the Incremental? command should be entered as Y.


This allows the post processor to output incremental code for the program.
Note:

When incremental output is desired, the POSTFORM file must recognize the
motion letters as modal. This can be accomplished with the ModalLetters
command.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

140

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.18.5

Inc/Abs Mill, Lathe, EDM

The Inc/Abs line indicates the numerical values of the G code that set the incremental or
absolute programming mode on the NC machine. The post processor issues a warning when
a mode change command is processed. The default is shown below.

Inc/Abs G 91 90
The letter defines the NC code letter for these modes. The first number indicates the
incremental code and the second indicates the absolute code. This NC code information is
used by the incmode variable.
When these codes are hard coded into the POSTFORM file, the output code remains in the
coded mode until changed. The example below shows a Subprogram that is incremental with
an absolute main program.

SubStart
O[sub]
G91
End
SubEnd
G90
M99
End
The SubStart sequence hard codes the incremental mode for the subprogram. The
subprogram remains in the incremental mode until the SubEnd sequence is used. This
returns the program to the absolute mode for the main program.
When an absolute G code is hard coded, the Incremental? command has no effect on the
output code. The incremental G code must be hard coded to ensure proper NC code output.

2.18.6

Incmode Mill, Lathe, EDM

The incremental code defined by the Inc/Abs command is output for this variable.

ToolChange
M5 M9
G0 G49 G[incmode] Z0
M6 T[tool]
G0 G[incmode] S[speed] M[direct] E[work] X[h] Y[v]
H[lcomp] M[cool] Z[d]
End
The incmode variable can be used to output the appropriate NC code defined by the Inc/Abs
command. This variable will output a G90 when the Incremental? command is entered as N
and the Inc/Abs command is entered as shown above. When Y is entered for the
Incremental? command, the output is G91.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

Note:

141

When the POSTFORM file encounters a hard coded mode, either G90 or G91, the
Post uses that code for the remainder of the file. Use the incmode variable instead
of hard coded variables to ensure the proper incmode variable output.

The examples below show the NC code output determined by the word address modifiers,
commands and variables coded in the POSTFORM file.
This example used the Incremental? command as Y, yet hard codes the G90 for absolute
mode.
INCREMENTAL? Y

THE OUTPUT CODE

Inc/Abs G 91 90
ToolChange
M6 T[tool]

M6 T1

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

X[h] Y[v]

X1. Y1.

H[lcomp] Z[d] M[cool]

H1 Z.1 M7

End
This example sets the Incremental? command at N, yet hard codes a G91 for the incremental
mode.
INCREMENTAL? N

THE OUTPUT CODE

Inc/Abs G 91 90
ToolChange
M6 T[tool]

M6 T1

G0 G91 S[speed] M[direct]

G0 G91 S2000 M3

X[h] Y[v]

X0 Y0

H[lcomp] Z[d] M[cool]

H1 Z.1 M7

End

Copyright 2000 by Surfware, Inc. All Rights Reserved.

142

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

This example uses the incmode variable to output the incremental set in the Inc/Abs command.
INCREMENTAL? Y
Inc/Abs G 91 90

THE OUTPUT CODE


The G91 code is determined by the Inc/Abs
command line above.

ToolChange
M6 T[tool]

M6 T1

G0 G[incmode] S[speed] M[direct]

G0 G91 S2000 M3

X[h] Y[v]

X0 Y0

H[lcomp] Z[d] M[cool]

H1 Z.1 M7

End

This example shows the absolute output using the incmode variable.
INCREMENTAL? N

THE OUTPUT CODE

Inc/Abs G 91 90
ToolChange
M6 T[tool]

M6 T1

G0 G[incmode] S[speed] M[direct]

G0 G90 S2000 M3

X[h] Y[v]

X1. Y1.

H[lcomp] Z[d] M[cool]

H1 Z.1 M7

End

This example shows a sequence that toggles between absolute and incremental output.
INCREMENTAL? N

THE OUTPUT CODE

Inc/Abs G 91 90

ToolChange
G0 G91 G28 Z0

G0 G91 G28 Z0

M6 T[tool]

M6 T1

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

X[h] Y[v]

X1. Y1.

H[lcomp] Z[d] M[cool]

H1 Z.1 M7

End
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.19

143

SUBPROGRAM OUTPUT

Subprograms are individual programs that define the tool motion for each tool in the INC file. The
Subprograms can be used for multiple part fixturing. These programs differ from Subroutines in
that they can be run separately in the machine control. A Subroutine requires a main program for
them to be executed in the machine control.
SURFCAMs post processor will output a separate Subprogram for each tool identified in the INC
file. The post then creates a Main Program that calls the appropriate number of Subprograms.
The following Commands, Sequences, and Variables are used to define and call the
Subprograms.
COMMANDS

RenumSubs?
Subs1st?

2.19.1

SEQUENCES

SubStart
SubEnd
SubCall
Between

VARIABLES

sub
subline
times

RenumSubs? Mill

You can reset the line numbers at the beginning of each Subprogram and the main program.
When it is not used, the line numbers are not reset at the beginning of each Subprogram and
main program.

RenumSubs? Y
Note:

When this command is entered as Y, the Subline variable should not be used.

2.19.2

Subs1st? Mill

This command defines the location of the Subprograms in relation to the main program. Enter
a Y for the Subprograms to be output before the main program. An N outputs the
Subprograms after the main program. This command is only entered in the POSTFORM file
when Subprograms are desired. When this command is not used, the Subprograms are
automatically placed before the main program.

Subs1st? Y

Copyright 2000 by Surfware, Inc. All Rights Reserved.

144

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.19.3

SubStart Mill

This sequence defines the beginning of the Subprogram.

SubStart
O[sub]
End
The output code for this example follows. This code is placed at the beginning of the
Subprogram by the post processor.

O1
2.19.4

SubEnd Mill

This sequence defines the End of the Subprogram.

SubEnd
M99
End
The output code for this example follows. This code is placed at the end of the Subprogram
code by the post processor.

M99
2.19.5

SubCall Mill

This sequence defines the details of the Subprogram call in the main program.

SubCall
E[work] X[h] Y[v]
M98 P[sub] L[times]
End
The output code for this example follows. The P word is the Subprogram number called. The
T word is the number of repetitions for the Subprogram.

E1 X1. Y1.
M98 P1 L5

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.19.6

145

Between Mill

This sequence defines any special code desired between the Subprogram and the main
program. This could be used to enter the code for the end of all subroutines on the FADAL.

Between
M17
M30
End
The output code:
X0 Y0
G91 G28 Z0
M17
M30
O1234

2.19.7

# Subprogram end
# Main program beginning

Sub Mill

This variable identifies the Subprogram number and is usually entered in the SubStart and
SubCall sequences. In the example below the variable sub identifies the Subprogram
number and is used to call the Subprogram in the main program.

SubStart
O[sub]
End
SubEnd
M99
End
SubCall
E[work] X[h] Y[v]
M98 P[sub] L[times]
End
The output code for this example follows. The Subs1st? command is entered as Y. When the
INC file is post processed, you are prompted for the Times variable. For this example, your
input was a value of 5.

O621
X1. Y1.
X2.
Z.1 G0
M99
O1234
Copyright 2000 by Surfware, Inc. All Rights Reserved.

146

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

G0 G90 S2000 M3 E1 X0 Y0
H1 M7 Z.1
E1 X1. Y1.
M98 P621 L5
2.19.8

Subline Mill

This variable is used to call the Subprogram using the block numbers. When the INC file is
post processed, the block number of the first line of the Subprogram is output for this variable.
When the variable is used, the RenumSubs? command must not be used.
The following example uses this variable instead of the subline variable. The block numbers
for this example begin at 1 and are incremented by 1.

SubStart
O[sub]
End
SubEnd
M99
End
SubCall
E[work] X[h] Y[v]
M98 P[subline] L[times]
End
When the INC file is post processed, you are prompted for the Times variable. For this
example, your input was a value of 5.

N1 O1
N2 X1. Y2.
N3 X2.
N4 Z1. G0
N5 M99
N6 G0 G90 S2000 M3 E1 X0 Y0
N7 H1 M7 Z.1
N8 E1 X1. Y1.
N9 M98 P1 L5
2.19.9

Times Mill

This variable is used to identify the number of repetitions for the Subprogram. When the INC
file is post processed, you are prompted for the times variable value. The default for this

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

prompt is 0. The following examples show the SubCall sequence and NC code with and
without the Times variable.

SubCall
E[work] X[h] Y[v]
M98 P[sub] L[times]
End
The output code for this example follows. When the INC file is post processed, you are
prompted for the Times variable. For this example, your input was a value of 5.

G0 G90 S2000 M3 E1 X0 Y0
H1 M7 Z.1
E1 X0 Y0
M98 P621 L5
SubCall
E[work] X[h] Y[v]
M98 P[sub] L[times]
End
The output code for this example follows. When the INC file is post processed, you are
prompted for the Times variable. For this example, the default value was used.

G0 G90 S2000 M3 E1 X0 Y0
H1 M7 Z.1
E1 X0 Y0
M98 P621 L0
In this example, the Times variable is not used.

SubCall
E[work] X[h] Y[v]
M98 P[sub]
End
The output code:

G0 G90 S2000 M3 E1 X0 Y0
H1 M7 Z.1
E1 X0 Y0
M98 P621

Copyright 2000 by Surfware, Inc. All Rights Reserved.

147

148

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.20

BLOCK NUMBER OUTPUT

NC code can be output with a number at the beginning of each line of code. This can be referred
to as a Block number, Sequence number or Line number. Block numbers must be defined within
the POSTFORM file with the use of word addresses, commands, and variables.

2.20.1

Word Address

Block numbers are typically output with the letter N. This letter must be entered in the Word
Address section of the POSTFORM file. The number of digits output for the character should
be determined by the machine tool control. Most machine tools use four digits maximum for
the block numbers. The example below shows the Word address format for block numbers
using the letter N.

N >4
The example uses the following command and sequence line.

Sequence#s N 1 1 1
G0 G90 S[speed]
INC FILE VALUE

NC CODE OUTPUT

N1 G0 G91 S1000

23

N23 G0 G90 S1000

3237

N3237 G0 G90 S1000

When a block number is only desired at the first line of a tool change, use the following code
in the POST file.

N >4
SEQUENCE#S N 0 1 100

THE OUTPUT CODE

1stToolChange
N[block] T[tool] M6

N100 T1 M6

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

G[work] X[h] Y[v]

G54 X0 Y0

M[cool] G[lcomp] Z[d]


End

ToolChange
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

SEQUENCE#S N 0 1 100

149

THE OUTPUT CODE

N[block] T[tool] M6

N200 T2 M6

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

G[work] X[h] Y[v]

G54 X1. Y1.

M[cool] G[lcomp] Z[d]


End

2.20.2

Commands Mill, Lathe, EDM

The following commands are used to define block numbers:

First#
Last#
RenumSubs?
Sequence#s
1. First#? Mill, Lathe, EDM
This switch determines whether a Block number is output on the first line of the program or
omitted. Enter Y or N for the desired output. The example below will omit a number on the
first line of the NC program.

First#? N
This is typically coded when the first line that is output for the NC code is a percent symbol.
2. Last#? Mill, Lathe, EDM
This switch determines whether a Block number is output on the last line of the program or
omitted. Enter a Y or N for the desired output. The example below will output a block number
on the last line of the program.

Last#? Y
This is typically coded when the last line that is output for the NC code is a percent symbol.
3. RenumSubs? Mill
You can reset the line numbers at the beginning of each Subprogram and the main program.
When this command is not used, the line numbers are not reset at the beginning of each
Subprogram and main program.

RenumSubs? Y
Note:

When this command is entered as Y, the Subline variable should not be used.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

150

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

The output code:

N1 O1
N2 G91
N3 X1.
N4 M99
N1 O2
N2 G91
N3 Y1.
N4 M99
N1 O1234
N2 G0 G90 S2000 M3 E1 X0 Y0
N3 H1 M7 Z.1
4. Sequence#s Mill, Lathe, EDM
This line defines the Block numbers output in the NC program. There are four parameters
required and placed in order on this line:

CHARACTER
The first character after the command is the 1st character of the block number. These
examples show the code and output for the commands using the letter N and the : symbol.
Note:

The letter or symbol used must be formatted in the Word Address format.
SEQUENCE#S N 1 1 1

THE OUTPUT CODE

1stToolChange
M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

N2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N4 H1 M7 Z.1

End
This example uses the letter C with the Replace command to output the : symbol for each
block number.
: >2
SEQUENCE#S : 1 1 1

THE OUTPUT CODE

1stToolChange
M6 T[Tool]

:1 M6 T1

G0 G90 S[Speed] M[Direct]

:2 G0 G90 S2000 M3

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

SEQUENCE#S : 1 1 1

151

THE OUTPUT CODE

E[Work] X[H] Y[V]

:3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

:4 H1 M7 Z.1

End

FREQUENCY
A number here indicates how often a block number is placed on a line. To output a number
on every line, enter a 1. To output a number on every other line, enter a 2. Entering the
number 10 will output a block number every ten lines. The following examples show the code
and output for the parameter.
SEQUENCE#S N 1 1 1

THE OUTPUT CODE

1stToolChange
M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

N2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N4 H1 M7 Z.1

End
This example indicates a Frequency of 2 to output block numbers on every other line.
SEQUENCE#S N 2 1 1

THE OUTPUT CODE

1stToolChange
M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

G0 G90 S2000 M3

E[Work] X[H] Y[V]

N2 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

H1 M7 Z.1

End
Note:

Use a frequency of 0 to not output the block numbers on each line. The post will
only put them where they are requested.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

152

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

INCREMENT
This is the value by which the block number is incremented before the next output. Using the
value of 10 will create block numbers in the block address itself to be 10 greater than the last
block number.
SEQUENCE#S N 1 10 10

THE OUTPUT CODE

1stToolChange
M6 T[Tool]

N10 M6 T1

G0 G90 S[Speed] M[Direct]

N20 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N30 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N40 H1 M7 Z.1

End

START VALUE
This is simply the value of the very first block number that appears in the code; numbers after
the first are determined by the start value plus a multiple of the Increment.
SEQUENCE#S N 1 2 100

THE OUTPUT CODE

1stToolChange
M6 T[Tool]

N100 M6 T1

G0 G90 S[Speed] M[Direct]

N102 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N104 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N106 H1 M7 Z.1

End
Note:

Refer to Section 2.20: Block Number Output on page 148.

2.20.3

Variables

The block variable is the only variable available for Block numbers. When it is coded in a
POSTFORM sequence, the output number is determined by the Sequence#s command.
This variable is typically used when block numbers are only desired for the tool change lines.
The following example shows the post file entries for the output of block numbers at tool
changes only.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

153

N >4
SEQUENCE#S N 0 1 100

THE OUTPUT CODE

1stToolChange
N[block] T[tool] M6

N100 T1 M6

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

G[work] X[h] Y[v]

G54 X0 Y0

M[cool] G[lcomp] Z[d]

M8 G43 Z.1

End

ToolChange
N[block] T[tool] M6

N200 T2 M6

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

G[work] X[h] Y[v]

G54 X1. Y1.

M[cool] G[lcomp] Z[d]

M8 G43 Z.1

End
When Block numbers are required for each program block, the block variable is not used.
This is accomplished by changing the Sequence#s command to indicate the frequency of 1
as the following example indicates:

Sequence#s N 1 1 1
2.20.4

Suppressing Block Numbers

Block numbers can be suppressed for the entire NC program or for specific lines of the
program. You can also output blank lines within the NC code if desired. Suppression of block
numbers is accomplished with the use of Word Address formatting or Commands.
When block numbers must be suppressed on only the first or last line of the NC program, use
the First# and Last# commands described above.
When no block number output is desired, the Sequence#s command is used with a
frequency of zero. This is shown in the following example. This example outputs no block
numbers for the entire program.

Sequence#s N 0 1 1
This command, with the use of the block variable, can be used to output block numbers at
specific NC code lines only.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

154

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

The exclamation symbol "!" can be used to suppress a line number at any NC code line. It
can also be used to output a blank line in the NC code.
This symbol must be entered in the Word Address format section of the post file. It should be
entered as indicated by the following example.

! 00
When used in a POSTFORM sequence, the symbol is followed by a variable of 0. The
following example shows the ! symbol being used to suppress the line number for the
program number line.
SEQUENCE#S N 1 1 1

THE OUTPUT CODE

Start
!0 O[program#]
End

1stToolChange

O1234

M6 T[tool]

N1 M6 T1

G0 G90 S[speed] M[direct] E[work] X[h] Y[v]

N2 G0 G90 S2000 M3 E1 X0 Y0

H[lcomp] M[cool] Z[d]

N3 H1 M7 Z.1

End
The following example indicates the use of the ! symbol to insert a blank line in the NC code.

Sequence#s N 1 1 1
RenumSubs? Y
First# N
Last# Y
Start
%0
O[program#]
End
SubStart
O[sub]
End
SubEnd
M99
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

!0
End
EndCode
M5 M9
G0 G49 G90 Z0
E0 X0 Y0
M6 T[Tool1]
M2
%0
End
The output code

%
N1 O1
N2 G91
N3 X1.
N4 M99
N1 O2
N2 G91
N3 Y1.
N4 M99
N1 O1234
N2 G0 G90 S2000 M3 E1 X0 Y0
N3 H1 M7 Z.1
N4 M98 P1 L1
N5 M98 P2 L1
N6 M5 M9
N7 G0 G49 G90 Z0
N8 E0 X0 Y0
N9 M6 T1
N10 M2
N11 %

Copyright 2000 by Surfware, Inc. All Rights Reserved.

155

156

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.21

CONFIGURING THE POST

2.21.1

Configuration Files

The post processor filesMPOSTWIN.EXE, LPOSTWIN.EXE and EPOSTWIN.EXEhave


a configuration file associated with them: Post.ini. This file identifies the path and name of the
POSTFORM file. The following lines are the contents of the Post.ini file:
POST.INI - GROUND SUPPORT POST-PROCESSOR CONFIGURATION FILE.
COPYRIGHT 1989 - 1999 GROUND SUPPORT
NOTE: COMMENTS MAY BE PLACED IN THIS FILE BY SIMPLY PLACING
THEM AFTER 2 OR MORE SPACE (NOT TAB!) CHARACTERS

[MPOST]
Format C:\SURFCAM\POSTLIB\PostForm.m
[LPOST]
Format C:\SURFCAM\POSTLIB\PostForm.l
[EPOST]
Format C:\SURFCAM\POSTLIB\PostForm.e
Figure 23: Post.ini File

2.21.2

Foreign Language Support

The post processor provides foreign language support through the POST.DEF file. This file
is an ASCII text file that lists all messages and prompts used by the post processor. The
numbers at the beginning of each line must not be changed. These are internal addresses
for the post processor. Wording after these numbers can be translated into virtually any
language.
Note:

Some words may be sequence names and should not be translated for clarity
between the messages and the POSTFORM file.

2.21.3

Machine Specific Output Directories

You can output a post processed file to any directory. This can be accomplished using two
methods. You can specify the output directory in the SURFCAM.PST file or in the
POSTFORM files.

2.21.3.1

PST File

In the example belowfrom the SURFCAM.PST filethe Copyfile command is used to


place the output file in the sub-directory C:\MyProjects. Use the sub-directory name in
the Task command, also, and another Delete command after the Copyfile command.

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

PostItem Fanuc
Status
ChDir
Delete
Command
Copyfile
Delete
Task

2.21.3.2

157

Fanuc 15M-B
c:\SURFCAM\SURF2000\MPOST
%p%N.NCC
c:\SURFCAM\SURF2000\MPOST\MPOSTWIN %p%N 1
%p%N.NCC c:\MyProjects\%N.NNC
%p%N.NCC
c:\SURFCAM\Surf2000\sedit\sedit c:\MyProjects\%N.NCC

POSTFORM File

To save an .ncc file in the sub-directory C:\MyProjects, add a Drive command like the
one below to a POSTFORM filelike Postform.m.
Drive \C:\MyProjects\
Note:

There must be a trailing back slash (\).

It is recommended that you place a separate Drive command after each Name
command so that all the NCC programs run on a specific machine will be saved in their
own directory.
You can, however, place a Drive command at the very top of the POSTFORM file. All
NCC programs will then be routed to this directory unless the machine chosen has its
own Drive command, in which case that one will be used.

2.22

ACCESSING THE POST PROCESSOR

SURFCAMs post processors are accessed using the NC Operations Manager


dialog box. To open this dialog box, either click its icon on the SURFCAM toolbar or
press Ctrl+N.

Figure 24: NC Operations Manager dialog box


Copyright 2000 by Surfware, Inc. All Rights Reserved.

158

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

You must first select the operations to be post processed from the NC Operations Tree. You can
process all the operations in a single Setup Section, by clicking its icon, or a single operation, by
clicking its icon.
You will then select a post processor from the NC Post list boxto the right of the Operations Tree.
You can display another list by changing the entry in NC Mode box for example, to 2 Axis. The
posts displayed in the NC Post list box are those listed in that section of the SURFCAM.PST file
set aside for the mode shown in the NC Mode list box. Changing the entry in the NC Mode box will
display the posts listed in another section of the PST file. The PST file contains commands to run
both MPOST (consisting of MPOSTWIN, LPOSTWIN and EPOSTWIN) and SPOST post
processors. SPOST is the other post processor package shipped with SURFCAM. To begin post
processing click a post name in the NC Post box and click the Post button.
You can also display all of the currently available MPOST post processorsfor all NC modes
by double-clicking the List all entry in the NC Post list box. When you do this, SURFCAM will
search the SURFCAM.PST file for a PostItem corresponding to List all, such as the following.
PostItem List all
Status Display all posts in postform.m
ChDir C:\SURFCAM\SURF2000\MPOST
Delete %p%N.NCC
Command "C:\SURFCAM\SURF2000\MPOST\MPOSTWIN" "%p%n"
Task "C:\SURFCAM\SURF2000\sedit\sedit" "%p%N.ncc"
The Command line in this example will run the MPOSTWIN post processor in such a way as to
first bring up a menu of available post processors stored in the current POSTFORM file
POSTFORM.M, POSTFORM.l OR POSTFORM.E.
A POSTFORM file contains the actual code for each of the current MPOST post processors.
SURFCAM accesses this file to run a post processor. You can run a post from the displayed menu
by double-clicking it.

2.22.1

Adding Posts

All of the post processors shipped with SURFCAM are stored in the SURFCAM\PostLib\
MPOST or SPOST sub-directories. You can add any of these post processors to your current
version of SURFCAM by using the PST Wizard utility.
To run the PST Wizard click Start > Programs > SURFCAM 2000.1> SURFCAM Tools > PST
Wizard. The Post Menu Wizard dialog box will be displayed. Follow the prompts to add or
remove a post processor.
If you select an SPOST post processor it will be copied from the PostLib\SPOST subdirectory to the SURFCAM.PST file.
If you select an MPOST post processor it will be copied from the PostLib\MPOST subdirectory to the SURFCAM.PST file and to the end of the applicable POSTFORM file.
Refer to Section 2.2.2: The MPOST Post Processor Package on page 36 and to Section 2.4.1: PST Wizard
on page 42.
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.22.2

159

SURFCAM.PST File

Refer to Section 2.3: The SURFCAM.PST File on page 38.

2.23

POST SAMPLE LIBRARIES

The POST sample libraries below are included as samples of the POSTFORM file. These files are
included in the SURFCAM\POSTLIB\MPOST directory. The list below indicates the post
processors and filenames that can be appended in the POSTFORM.M, POSTFORM.L, or
POSTFORM.E files. The filename extension indicates the type of post processor.
M2
M3
M4
M5
L2
E2
E4

2 Axis Mill
3 Axis Mill
4 Axis Mill
5 Axis Mill
Lathe
2 Axis Wire EDM
4 Axis Wire EDM

Refer to Figure 25: Post Processors and File Names.


MILLING POSTS

FILENAME

MILLING POSTS

FILENAME

Aciera

aciera.m3

Bridgeport w/BOSS 8

bos8.m3

ACL

acl.m3

Bridgeport w/BOSS 9

boss.m3

Acroloc GN-6M

acr6.m3

Bridgeport w/BOSS 10

boss.m3

Acroloc GN-6M w/rotary table

acr6.m4

Bridgeport Heidenhain TNC 151

bri151.m3

Allen Bradley 4500

ab4500.m3

Bostomatic

bostomat.m3

Allen Bradley 8400

ab8400.m3

Centurion 4

cnt4.m3

Anilam Crusader Series M EIA

anilam-e.m3

Centurion 5

cnt5.m3

Anilam Crusader Series M Event

anilam-c.m3

Cincinnati Milacron 850M

cin850.m3

APTCL 2 and 3 Axis

aptcl.m3

Cincinnati Milacron 950M

cin950.m3

APTCL 5 Axis

aptcl.m5

Cincinnati Milacron Tab Seq

cin-tab.m3

Bandit 1

ban1.m3

Cintimatic AC-8

cnt8.m3

Bandit 2

ban2.m3

Compact II 2 and 3 Axis support

compact2.m3

Figure 25: Post Processors and File Names


Copyright 2000 by Surfware, Inc. All Rights Reserved.

160

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

MILLING POSTS

FILENAME

MILLING POSTS

FILENAME

Bandit 3

ban3.m3

Deckel

deckel.m3

Bandit 4

ban4.m3

Deckel Dialog 4 G17

dlg4g17.m3

Bridgeport w/BOSS 4

bos4.m3

Deckel Dialog 4 G18

dlg4g18.m3

Bridgeport w/BOSS 5

bos5.m3

Devlieg

devlieg.m3

Dyna Myte 2400

dmt2400.m3

Fanuc 16M

fan16.m3

Dyna Myte 2400 w/rotary table

dmt2400.m4

Fanuc 16M w/preselect

fan16p.m3

Dyna Myte Conversational

dmt2400c.m3

GE Mark Century w/Monarch

monarch.m3

Dyna Myte 4400

dmt4400.m3

General Electric 550

ge550.m3

Dyna Myte 4400 w/rotary table

dmt4400.m4

General Electric 1050

ge1050.m3

Dynapath 20 EIA format

dyn20e.m3

General Electric 2000

ge2000.m3

Dynapath 20 Conv. Style

dyn20c.m3

Haas

haas.m3

Dynapath 30 Conv. Style

dyn30c.m3

Haas w/rotary table

haas.m4

Fadal Format 1

fadal.m3

Heidenhain TNC 151 ISO

hei151.m3

Fadal Format 1 w/rotary table

fadal.m4

Heidenhain TNC 151 Conv.

Hei151c.m3

Fadal Format 1 w/sub programs

fadals.m3

Heidenhain TNC 151 w/sub

hei151s.m3

Fagor

fagor.m3

Heidenhain TNC 155 ISO

hei155.m3

Fanuc 3000

fan3000.m3

Heidenhain TNC 155 Conv.

Hei155c.m3

Fanuc 0M

fan0.m3

Heidenhain TNC 155 w/sub

hei155s.m3

Fanuc 6M

fan6.m3

Heidenhain TNC 355 Conv.

Hei355c.m3

Fanuc 10M

fan10.m3

Heidenhain TNC 355 w/sub

hei355s.m3

Fanuc 10M w/Incr. Output

fan10i.m3

Heidenhain TNC 415 Conv.

Hei355c.m3

Fanuc 10M w/rotary table

fan10.m4

Heidenhain TNC 415 w/sub

hei355s.m3

Fanuc 10M w/preselect

fan10p.m3

Hurco

hurco.m3

Hurco BX

maxbx.m3

Fanuc 10M w/sub programs G54 fan10s54.m3

Figure 25: Post Processors and File Names (Continued)

Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

MILLING POSTS

FILENAME

MILLING POSTS

161

FILENAME

Fanuc 10M w/sub programs G92 fan10s92.m3

Hurco Ultimax 1

ult1.m3

Fanuc 11M

fan11.m3

Hurco Ultimax 2

ult2.m3

Fanuc 11M w/preselect

fan11p.m3

Hurco Ultimax 2 ver 8

ult2v8.m3

Fanuc 15M

fan15.m3

Hurco Ultimax 3

ult3.m3

Fanuc 15M w/preselect

fan15p.m3

Hurco Ultimax 3 ver 8

ult3v8.m3

K & T 600MM

k&t600.m3

OKK w/Fanuc

okkfan.m3

K & T 600MM w/rotary table

k&t600.m4

OKK w/Fanuc rotary

okkfan.m4

Kitamura MC-86

kit86.m3

Okuma w/Bandit 2

okuban2.m3

Kitamura MC-86 w/rotary table

kit86.m4

Okuma OSP5000

osp5000.m3

LeBlond Makino w/Fanuc

leblond.m3

Okuma OSP5020

osp5020.m3

Maho G17 mode

mah-g17.m3

Pratt & Whitney Tapematic

p&wtap.m3

Maho G17 mode w/rotary

mah-g17.m4

ProtoTrak

prototrk.m3

Maho G18 mode

mah-g18.m3

Roland CAMM-3

roland.m3

Maho G18 mode w/rotary

mah-g18.m4

Servo

ser2.m3

Makino w/Fanuc 15M

makfan15.m3

Sharnoa Tiger 4

tig4.m3

Mazak M2

mzk2.m3

Sharnoa Tiger 5

tig5.m3

Mazak M2 w/tool preselect

mzk2p.m3

Shizuoka 13-5V

shi13.m3

Mazak M2 w/rotary table

mzk2.m4

Siemens 6M

sie6.m3

Mazak M2 horiz. w/tombstone

mzk2h.m3

Siemens 810M

sie810.m3

Mazak M32 ISO

mzk32.m3

SURFCAM Digitize Format

digitiz.m3

Mazak M32 w/vertical bridge

mzk32v.m3

Thermwood Model 70

thr70.m3

Mitsubishi M0

mit0.m3

Tree w/Dynapath 20

tredy20.m3

Monarch 45B w/Dynapath 20

mondy20.m3

Yasnac MX-3

yas3.m3

Mycenter

mycentr.m3

Yasnac 2000G

yas2000.m3

Figure 25: Post Processors and File Names (Continued)

Copyright 2000 by Surfware, Inc. All Rights Reserved.

162

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

MILLING POSTS

FILENAME

MILLING POSTS

FILENAME

Mycenter w/rotary table

mycentr.m4

Cincinnati

cincinat.12

Charmilles 2 Axis wire EDM

charmill.e2

Citizen F10 Screw Machine

citizen.12

Charmilles 4 Axis wire EDM

charmill.e4

Fanuc OT

fan0.12

Elox 4 Axis wire EDM

elox.e4

Fanuc 5T

fan5.12

Japax 2 Axis wire EDM

japax.e2

Fanuc 6T

fan6.12

Japax 4 Axis wire EDM

japax.e4

Fanuc 10T

fan10.12

Mitsubishi 2 Axis wire EDM

mitsub.e2

General Electric 550 Absolute

ge550.12

Sodick 2 Axis wire EDM

sodick.e2

General Electric 550 Incremental ge550i.12


Generic 2 axis

generic.12

Ikegai 5T

ike5.12

Mitsubishi L0

mit0.12

Mori-Seiki

moriseik.12

Yasnac 2000B

yas2000.12
Figure 25: Post Processors and File Names (Continued)

The sample POSTFORM files in Figure 26: Generic 3 Axis Mill Postform file, Figure 27: Generic Lathe
Postform file on page 170, and Figure 28: Generic EDM Postform file on page 176 are the Generic
POSTFORM files that are included.

2.23.1

Generic.M3
NAME

GENERIC 3 AXIS MILL

% 00
! 00
O4
N >4
G2
Figure 26: Generic 3 Axis Mill Postform file
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC 3 AXIS MILL

g2G
X ->3.>4
Y ->3.>4
Z ->3.>4
I ->3.>4
J ->3.>4
R ->3.>4
Q ->3.>4
F >3.1
H2
D2
T2
M2
S >4

ModalLetters X Y Z F R

# List of letters that are modal

ModalGs 0 1 2 3 73 74 76 80 81 82 83 84 85

# List of g codes that are modal

Sequence#s N 1 1 1

# Char, freq, incr & start

First#? N

# Y or N Output 1st sequence no.

Last#? N

# Y or N Output last sequence no.

HCode X

# X or X U Horizontal char.

VCode Y

# Y or Y V Vertical char.

Dcode Z

# Depth char.

FeedCode F

# Feed rate char.


Figure 26: Generic 3 Axis Mill Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

163

164

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC 3 AXIS MILL

Comment ( )

# Begin End comment char.

Spindle 3 4 5

# Cw, ccw & stop m codes

Coolant 8 9 7

# On, Off & Mist m codes

DComp 41 42 40

# Left, Right & Cancel m codes

LComp 43 49

# On & Off codes

Feed G1

# Linear move

Rapid G0

# Rapid positioning word

Cw G2

# Circular move clockwise

Ccw G3

# Circular move counter clockwise

Inc/Abs G 91 90

# Inc & Abs char. & values

Inch/MM 70 71

# Inch & Metric g codes

CtrCode I J

# I J or R or I J K L

CtrIncremental? Y

# Y or N Inc or abs I & J

ByQuadrants? N

# Y or N Break arcs at quadrants

Spaces? Y

# Y or N Spaces between words

Incremental? N

# Y or N Inc or abs output

Work G

# Work offset register

UppercaseComments? Y

# Y or N Require uppercase

Figure 26: Generic 3 Axis Mill Postform file (Continued)


Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC 3 AXIS MILL

StartCode

# Start of the program

%0
!0 O[Program#]
End

1stToolChange

# First tool change

G0 G90 G80 G40 G17


T[Tool] M6
M[Direct] S[Speed]
G0 G[Work] X[H] Y[V]
G43 Z[D] H[Lcomp]
M[Cool]
End

Infeed

# Enable cutter comp

G[Side] X[H] Y[V] D[DComp] F[FRate]


end

Outfeed

# Disable cutter comp

G1 G40 X[H] Y[V]


end

ToolChange

# Secondary tool changes

M[CoolantOff]
T[Tool] M6
M[Direct] S[Speed]
G0 X[H] Y[V]
Figure 26: Generic 3 Axis Mill Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

165

166

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC 3 AXIS MILL

G43 Z[D] H[Lcomp]


M[Cool]
End

EndCode

# End of the program

G0 G91 G28 Z0
M30
%0
End

#LineCode
#G1 X[H] Y[V] Z[D] F[FRate]
#End

#RapidCode
#G0 X[H] Y[V] Z[D]
#End

#CwCode
#G2 X[H] Y[V] I[IVal] J[JVal] F[FRate]
#End

#CcwCode
#G3 X[H] Y[V] I[IVal] J[JVal] F[FRate]
#End

Drill

# Drilling canned/manual cycle


Figure 26: Generic 3 Axis Mill Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

167

GENERIC 3 AXIS MILL

G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]


end cancel

Peck

# Pecking canned/manual cycle

G83 X[H] Y[V] Z[D] Q[VBite] R[Vclear] F[FRate]


end cancel

Tap

# Tapping canned/manual cycle

G84 X[H] Y[V] Z[D] R[Vclear] F[FRate]


end cancel

LTap

# Left handed tapping cycle

G74 X[H] Y[V] Z[D] R[Vclear] F[FRate]


end cancel

Ream

# Reaming canned/manual cycle

G85 X[H] Y[V] Z[D] R[Vclear] F[FRate]


end cancel

Bore

# Boring canned/manual cycle

G86 X[H] Y[V] Z[D] R[Vclear] F[FRate]


end cancel

Back

# Back boring canned/manual cycle

G87 X[H] Y[V] Z[D] R[Vclear] F[FRate]


end cancel

Figure 26: Generic 3 Axis Mill Postform file (Continued)


Copyright 2000 by Surfware, Inc. All Rights Reserved.

168

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC 3 AXIS MILL

#Custom1
#G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
#end cancel

#Custom2
#G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
#end cancel

#Custom3
#G81 X[H] Y[V] Z[D] R[Vclear] F[FRate]
#end cancel

Cancel

# Cancel a canned/manual cycle

G80
end

#SubStart
#O[Sub]
#End

#SubEnd
#M99
#End

#SubCall
#G[Work] P[Sub] M98
#End
Figure 26: Generic 3 Axis Mill Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC 3 AXIS MILL

#Between
#M9
#G91 G80 G30 Y0 Z0
#G0 G40 G80 G90
#M30
#End

#Index X
#G0 G28 G91 Z0
#G90 G[Work] X[H] Y[V] A[RotAngle]
#G43 H[Lcomp] Z[D]
#End

#UnWind
#G0 G28 G91 Z0
#A0
#G43 Z[D] H[Lcomp] M[Cool]
#X[LastH] Y[LastV] A[LastRotAng]
#G1 Z[LastD]
#End

#Upon RPlane
#Ask "Val1" " Enter 98 or 99 for canned cycles" "98"
#End
Figure 26: Generic 3 Axis Mill Postform file (Continued)

Copyright 2000 by Surfware, Inc. All Rights Reserved.

169

170

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

2.23.2

Generic.L
NAME

GENERIC LATHE

% 00
! 00
O4
N3
G2
X ->3.>4
x ->3.>4 X
Z ->3.>4
D2
I ->3.>4
K ->3.>4
U ->3.>4
W ->3.>4
P ->3.>4
A 60 P
Q ->3.>4
q ->3.>4 Q
R ->3.>4
F >3.>3
T2
t2
S >4
M2

ModalLetters X Z F

# List of letters that are modal


Figure 27: Generic Lathe Postform file
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC LATHE

ModalGs 0 1 2 3 73 76 80 81 82 83 84 85 # List of g

Sequence#s N 0 1 1

# Char, freq, incr & start

First#? N

# Y or N Output 1st sequence no.

Last#? N

# Y or N Output last sequence no.

Comment ( )

# Begin End comment char.

HCode Z

# X or X U Horizontal char.

VCode X

# Y or Y V Vertical char.

FeedCode F

# Feed rate char.

Spindle 3 4 5

# Cw, ccw & stop m codes

Coolant 8 9 7

# On, Off & Mist m codes

DComp 41 42 40

# Left, Right & Cancel m codes

LComp 43 49

# On & Off codes

SpeedType 97 96

# CSS and RPM g codes

FeedType 95 94

# IPR & IPM g codes

ByDiameter? Y

# Y or N Output X val. by diameter

CtrIncremental? Y

# Y or N Inc or abs I & J

ByQuadrants? N

# Y or N Break arcs at quadrants

CtrCode R

# I J or R or I J K L

Inc/Abs G 91 90

# Inc & Abs char. & values


Figure 27: Generic Lathe Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

171

172

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC LATHE

Inch/MM 20 21

# Inch & Metric g codes

Spaces? Y

# Y or N Spaces between words

Incremental? N

# Y or N Inc or abs output

Feed G1

# Linear move

Rapid G0

# Rapid positioning word

Cw G2

# Circular move clockwise

Ccw G3

# Circular move counter clockwise

RevSigns X x

# List of letters to reverse signs

UppercaseComments? Y # Y or N Require uppercase

StartCode

# Start of the program

%0
!0 O[Program#]
end

1stToolChange

# First tool change

G50 x[ToolH] Z[ToolV]


G0 T[Tool] t[Tool] M42
G[SpeedType] S[Speed] M[Direct]
X[V] Z[H] M[Cool]
End

Infeed

# Enable cutter comp


Figure 27: Generic Lathe Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC LATHE

G1 G[Side] X[V] Z[H] D[Dcomp] F[FRate]


end

Outfeed

# Disable cutter comp

G1 G40 X[V] Z[H] F[FRate]


end

ToolChange

# Secondary tool changes

M[CoolantOff]
T[LastTool] t0
G50 x[ToolH] Z[ToolV]
G0 T[Tool] t[Tool] M42
G[SpeedType] S[Speed] M[Direct]
X[V] Z[H] M[Cool]
End

EndCode

# End of the program

G0 x[ToolV] Z[ToolH] M[CoolantOff]


T[Tool] t0 M5
M2
End

#LineCode
#G1 X[V] Z[H] F[Frate]
#End

#RapidCode
Figure 27: Generic Lathe Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

173

174

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC LATHE

#G0 X[V] Z[H]


#End

#CcwCode
#G3 X[V] Z[H] R[ArcRad]
#End

#CwCode
#G2 X[V] Z[H] R[ArcRad]
#End

Drill

# Drilling canned/manual cycle

G74 Z[Depth] F[Frate]


end

Peck

# Pecking canned/manual cycle

G74 Z[Depth] K[VBite] F[Frate]


end

#Tap
#G78 Z[H] F[FRate]
#end cancel

#LTap
#G78 Z[H] F[FRate]
#end cancel

Figure 27: Generic Lathe Postform file (Continued)


Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

175

GENERIC LATHE

AutoThread

# Automatic thread canned cycle

G76 A[TParams] Q[VBite] R0


G76 X[V] Z[H] R[StartAng] P[Depth] q[Peck1] F[Frate]
end

Ream

# Reaming canned/manual cycle

G1 Z[H] F[FRate]
G1 Z[VClear]
end

Bore

# Boring canned/manual cycle

G1 Z[H] F[FRate]
G1 Z[VClear]
end

Back

# Back boring canned/manual cycle

G1 Z[H] F[FRate]
G1 Z[VClear]
end

#Custom1
#End

#Custom2
#End

#Custom3
Figure 27: Generic Lathe Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

176

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC LATHE

#End

Cancel

# Cancel a canned/manual cycle

G80
end

#Upon Turret
#M13
#End

Replace " t" with ""


Figure 27: Generic Lathe Postform file (Continued)

2.23.3

Generic.E
NAME

GENERIC EDM

% 00
! 00
O4
N >4
G2
X ->3.>4
Y ->3.>4
I ->3.>4
J ->3.>4
F >3.2
D2
M2
Figure 28: Generic EDM Postform file
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC EDM

ModalLetters X Y Z F R # List of letters that are modal

ModalGs 0 1 2 3

# List of g codes that are modal

Sequence#s N 0 1 1

# Char, freq, incr & start

First#? N

# Y or N Output 1st sequence no.

Last#? N

# Y or N Output last sequence no.

HCode X

# X or X U Horizontal char.

VCode Y

# Y or Y V Vertical char.

FeedCode F

# Feed rate char.

Comment ( )

# Begin End comment char.

DComp 41 42 40

# Left, Right & Cancel m codes

LComp 43 49

# On & Off codes

Feed G1

# Linear move

Rapid G0

# Rapid positioning word

Cw G2

# Circular move clockwise

Ccw G3

# Circular move counter clockwise

Inc/Abs G 91 90

# Inc & Abs char. & values

Inch/MM 70 71

# Inch & Metric g codes

Figure 28: Generic EDM Postform file (Continued)


Copyright 2000 by Surfware, Inc. All Rights Reserved.

177

178

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC EDM

CtrCode I J

# I J or R or I J K L

CtrIncremental? Y

# Y or N Inc or abs I & J

ByQuadrants? N

# Y or N Break arcs at quadrants

Spaces? N

# Y or N Spaces between words

Incremental? N

# Y or N Inc or abs output

#Work G

UppercaseComments? Y # Y or N Require uppercase

StartCode

# Start of the program

%0
!0 O[Program#]
End

1stToolChange

# First tool change

G0 G92 X0 Y0
X[H] Y[V]
End

Infeed

# Enable cutter comp

G[Side] X[H] Y[V] D[Dcomp]


end

Outfeed

# Disable cutter comp

G1 G40 X[H] Y[V]


Figure 28: Generic EDM Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC EDM

end

ToolChange

# Secondary tool changes

M1
G0 X[H] Y[V]
End

EndCode

# End of the program

M30
%0
End

#LineCode
#G1 X[H] Y[V] F[Frate]
#End

#RapidCode
#G0 X[H] Y[V]
#End

#CcwCode
#G3 X[H] Y[V] I[Ival] J[Jval] F[Frate]
#End

#CwCode
#G2 X[H] Y[V] I[Ival] J[Jval] F[Frate]
#End
Figure 28: Generic EDM Postform file (Continued)
Copyright 2000 by Surfware, Inc. All Rights Reserved.

179

180

SURFCAM Support Utilities Manual, Chapter 2 Post Processing Introduction and MPost

NAME

GENERIC EDM

#Upon
#End
Figure 28: Generic EDM Postform file (Continued)

Copyright 2000 by Surfware, Inc. All Rights Reserved.