Sei sulla pagina 1di 202

Xbuild

Reference Manual
Post Processing for Milling, Turning & Wire EDM

By Delcam plc

Release Issue 1

Disclaimer
Delcam plc has no control over the use made of the software described in
this manual and cannot accept responsibility for any loss or damage
howsoever caused as a result of using the software. Users are advised that
all the results from the software should be checked by a competent
person, in accordance with good quality control procedures.
Information contained in this manual is subject to change without notice
and does not represent a commitment by Delcam plc. The software
described in this manual is furnished under licence agreement and may be
used or copied in accordance with the terms of such licence. No part of
this manual may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopying and recording,
for any purpose without the express permission of Delcam plc.
Copyright 1995-2008 Delcam plc. All rights reserved
Acknowledgements
This documentation references a number of registered trademarks and
these are the property of their respective owners. For example, Microsoft
and Windows are either registered trademarks or trademarks of
Microsoft Corporation in the United States and/or other countries.
Restricted Rights Legend
The Program and Program Materials are provided with Restricted
RIGHTS. Use, duplication, or disclosure by the United States
Government is subject to restrictions as set forth in subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer Software Clause
at DFARS 252.227-7013, Manufacturer is the Licensor: Delcam plc.
Permission to Copy for Licensed Users
Delcam plc grants permission for licensed users to print copies of this
manual or portions of this manual for personal use only. Schools that are
licensed to use FeatureCAM may make copies of this manual or portions
of this manual for students currently registered for classes where
FeatureCAM is used.
Xbuild Version: 8.0 Date: 07/10/2008 17:37

Contents
Xbuild overview

Post processing in FeatureCAM ....................................................................1


Template concept...................................................................................1
Posting file types....................................................................................2
Types of post processors........................................................................3
File menu .......................................................................................................4
Compare CNC .......................................................................................5
Edit in Text Editor .................................................................................6
Sim-Info menu ...............................................................................................7
Reserved words..............................................................................................7
Numeric .................................................................................................7
String......................................................................................................8
Reserved words in conditional statements ............................................8
Configuring reserved words ..................................................................9
Formats menu...............................................................................................11
Formats editor ..............................................................................................12
File menu .............................................................................................12
Edit menu.............................................................................................15
Using expressions in formats.......................................................................15
Printing square brackets.......................................................................17
Numeric operators ...............................................................................18
Logical operators .................................................................................20
String operators....................................................................................22
Assignment ..........................................................................................23
Formatting expressions........................................................................23
Suppressing printing of an expression.................................................24
Modality delimiters......................................................................................25
Control characters in formats.......................................................................26
Changing post units .....................................................................................26

Mill posts

28

CNC-Info menu ...........................................................................................28


CNC-Info - General .............................................................................29
CNC-Info - NC Codes .........................................................................33

Xbuild Reference Manual

Contents i

CNC-Info - Feeds and Speeds .............................................................36


CNC-Info - Fixture ID .........................................................................36
CNC-Info menu - Five-Axis................................................................37
Formats menu...............................................................................................49
Defining milling formats .............................................................................50
Rules ....................................................................................................50
Program formats ..................................................................................51
Move formats.......................................................................................53
Cycle formats.......................................................................................55
Macro formats......................................................................................56
Milling numeric reserved words ..................................................................57
Milling logical reserved words ....................................................................63
Milling string reserved words ......................................................................66
Hole canned cycles in Xbuild ......................................................................68
Relationship between FeatureCAM and Xbuild..........................................70
Input dimension ...................................................................................70
Cycle types...........................................................................................70
Z data ...................................................................................................71
Handling cutter compensation .............................................................72
Handling multiple fixture documents ..................................................73
Handling pecking.................................................................................75
Handling 3D arcs .................................................................................76
Handling retract planes in canned cycles ............................................77
Fanuc line numbering ..........................................................................78
Handling milling macros .............................................................................78
Expected G-code for different post settings ........................................79
Configuring post for local coordinate systems ....................................83
Configuring post for incremental macros............................................86
Fourth and fifth axis support........................................................................88
Rotation styles .....................................................................................88
4th axis indexing in the post ................................................................90
4th axis wrapping in the post ...............................................................91
5th axis indexing in the post ................................................................93

Turn posts

95

CNC-Info menu ...........................................................................................95


CNC-Info menu - General ...................................................................96
CNC-Info menu - NC Codes ...............................................................98
CNC-Info menu - Turrets ................................................................. 100
CNC-Info menu - Spindles ............................................................... 102
CNC-Info menu - Feeds and Speeds ................................................ 103
CNC-Info menu - Cycles .................................................................. 104

ii Contents

Xbuild Reference Manual

CNC-Info menu - Fixture ID ............................................................ 105


Formats menu............................................................................................ 105
Defining turning formats .......................................................................... 106
Rules ................................................................................................. 106
Program formats ............................................................................... 107
Move formats.................................................................................... 108
Cycle formats.................................................................................... 111
Turning numeric reserved words .............................................................. 114
Numeric general words..................................................................... 114
Numeric turning canned cycle block words ..................................... 119
Numeric circular block words .......................................................... 120
Numeric drilling and threading type cycle words ............................ 120
Turning logical reserved words ................................................................ 123
Turning string reserved words .................................................................. 127
Relationship between FeatureTURN and Xbuild ..................................... 130
Roughing and profiling cycles.......................................................... 130
Start/end points ................................................................................. 130
Other reserved words ........................................................................ 131
Computed tapping cycles.......................................................................... 131

Turn/mill posts

132

CNC-Info menu ........................................................................................ 132


CNC-Info menu - General ................................................................ 133
CNC-Info - NC Codes ...................................................................... 137
CNC-Info menu - Turrets ................................................................. 140
CNC-Info menu - Spindles ............................................................... 142
CNC-Info menu - Feeds and Speeds ................................................ 143
CNC-Info menu - Cycles .................................................................. 144
CNC-Info menu - Fixture ID ............................................................ 145
CNC-Info menu - Five-Axis............................................................. 146
Defining turn/mill formats ........................................................................ 147
General structure............................................................................... 147
Program start format and tool change format................................... 147
Rapid move ....................................................................................... 148
Linear move ...................................................................................... 148
Turn/mill reserved words.......................................................................... 149
Turn/mill numeric reserved words ................................................... 150
Turn/mill logical reserved words...................................................... 150
Turn/mill string reserved words ....................................................... 152
Turn/mill clamping reserved words.................................................. 153

Xbuild Reference Manual

Contents iii

Multi-turret turning posts

156

Multi-turret reserved words ...................................................................... 156


Defining multi-turret posts........................................................................ 157
Synchronizing spindle speed changes on Okuma lathes .................. 157
Pinch and follow turning .................................................................. 158
Making a multi-turret post ................................................................ 158

Wire EDM posts

161

CNC-Info menu ........................................................................................ 161


CNC-Info menu - General ................................................................ 162
CNC-Info menu - NC Codes ............................................................ 165
CNC-Info menu - Machine Constants .............................................. 166
Defining wire EDM formats ..................................................................... 167
Program formats ............................................................................... 167
Move formats.................................................................................... 168
Macro formats................................................................................... 170
Wire EDM reserved words ....................................................................... 172
Relationship between FeatureWIRE and Xbuild...................................... 177
Input dimension ................................................................................ 177
Path definition................................................................................... 178
Other reserved words ........................................................................ 178
Handling macros ............................................................................... 178
Handling wire compensation ............................................................ 179
Handling tapers ................................................................................. 180
Handling XY UV .............................................................................. 180
Cycle type ......................................................................................... 181
Outputting 4-axis wire EDM arc moves........................................... 181

Tutorials

183

Understanding milling formats ................................................................. 183


Understanding drilling formats................................................................. 185
Creating program formats ......................................................................... 187
Converting a post to 5-axis simultaneous................................................. 189

Index

iv Contents

191

Xbuild Reference Manual

Xbuild overview
This section describes how to use the Xbuild post processor.

Post processing in FeatureCAM


Various machine tool manufacturers have implemented CNC
(Computerized Numerical Control) program standards that differ in detail
from each other (and from the EIA RS-274C standard). Because of this
wide range of standards, Xbuild was designed to allow for the creation of
CNC information files for virtually any CNC. The process of creating a
CNC information file is also referred to as building a post processor.
Throughout this section, the Post module is referred to as though it
were separate from the FeatureCAM program. It is, in fact, part of
the FeatureCAM program, but for the sake of simplicity it's referred
to as a separate entity from FeatureCAM. This concept is important
to understanding many of the references to the Post module.

Template concept
The CNC data file created in Xbuild is used by Post as a 'template' to
format the part program data file created in FeatureCAM.
The template consists of program formats (for example, Linear Move,
Rapid Move) that determine the structure of a part program for a
specific CNC. Each format uses address characters (for example X, Y...)
and reserved words (for example <X-COORD>, <Z-COORD> ...) to
indicate the sequence of data in program blocks.
Program formats are sequentially filled. This means that reserved words
are substituted by their corresponding values, G and M codes (machine
tool codes) when the part program data file is post processed.

Xbuild Reference Manual

Xbuild overview 1

A typical CNC program Linear Move format block that is output by


Post might look like this:
N305G1Z3.4X2.753F5.<CR>

Post extracts the coordinate data from the FeatureCAM part program data
file, as well as the line format from the Xbuild CNC information file.
Then, the appropriate values are substituted to generate the line of code.
Letter addresses N, Z, X and F are typed as literals, and appear in the
output CNC file as they appear in the format block. The reserved words,
such as <SEQ>, <MOTION> and so on, identify placement of
corresponding values (or strings) in the block.
Codes (or control characters) can be embedded in a program format.
To enter them, type the decimal value equivalent of the ASCII code,
delimited by angular brackets < >.

Posting file types

FeatureCAM - the source of the toolpaths.


POST - the portion of FeatureCAM turns machine independent toolpaths
into machine specific G-code.

2 Xbuild overview

Xbuild Reference Manual

.FM Part - the machine independent part file.


The part is actually loaded into FeatureCAM to be posted.
Xbuild - the general post processing program for milling, turning,
turn/milling and Wire EDM. It's a separate program that creates files
containing templates for creating machine specific G-code.
.CNC Data File - the machine-specific template.
Machine Specific Code - G-code text files for particular machines.

Types of post processors


Xbuild allows you to create post processors for different types of
machines. These types are specified as the Machine Type in the
General Information dialog.

To open the dialog, select CNC-Info - General from the Menu bar.

Xbuild Reference Manual

Xbuild overview 3

File menu
The Xbuild File menu is the same for all post processor types:
Open CNC - loads an Xbuild post file. The Open dialog is displayed
allowing user to browse computer directory for a post processor. Post
processors have a .cnc file extension, and are kept in the folders MLBRY, T-LBRY and E-LBRY within the FeatureCAM folder. Mill post
files are in M-LBRY, Turn posts are in T-LBRY, and Wire EDM posts
are in E-LBRY.
Save CNC - saves new or updated CNC file.
The use of post processors in FeatureCAM is restricted by the
particular version of Xbuild / FeatureCAM it was created or
modified in. A post created or modified in a newer version of Xbuild
will not be backward compatible with an older version. Post
processors are forward compatible with newer versions of
FeatureCAM. A warning message will be displayed when saving a
post that was modified in a newer version than the one it was
created in. This is not a problem unless the post needs to be used in
an older version of FeatureCAM.
Save As CNC - saves file with user-defined name and location.
Document CNC - CNC files are binary files and cannot be directly
printed. Use this option to create a text file from the current CNC data
file.This file has a .cnx extension, and can be edited and printed with any
text editor.
Compare CNC (see page 5) - lets you compare CNC posts.
Edit in Text Editor (see page 6) - lets you edit formats in a text editor.
Export Formats - lets you export all formats to a text file on the disk.
When you click Export Formats in the menu, a Save As dialog opens
where you specify the name and path for the file. After the file is saved,
you can open it and edit it in a text editor.
Import Formats - lets you import all the formats from a text file on the
disk. When you click Import Formats in the menu, you are given the
option to import the last exported file, if a file was exported during the
current XBUILD session. If you click Yes, the file is imported silently. If
you click No, an Open dialog displays where you specify the path and
name of the file. After you select the file, the CNC formats written in the
file are read and imported.

4 Xbuild overview

Xbuild Reference Manual

If you import a file that was exported from a newer version of


XBUILD into an older version, any formats that do not exist in the
older version are not imported. Also, the keywords added to the
newer version that are not present in the older version are
incompatible and you may need to modify the post after the formats
are imported.
Save and Test CNC - saves changes to Post and enables user to view
changes to NC code without exiting Xbuild.
Exit - closes Xbuild.

Compare CNC
You can compare CNC posts using File > Compare CNC:

Compare CNC allows a CNC author to compare the currently open post
to another post on the disk. If the second CNC is from a newer version, an
error is displayed. You must install DiffMerge (or other merge program
capable of command prompt input) on your computer and add the path of
the executable to the 'XBUILDDIFF' environment variable.
To add an environment variable in Windows XP:
1. Go to Start > Control Panel > System.
The System Properties dialog opens.
2. On the Advanced tab, click the Environment Variables
button.
The Environment Variables dialog opens.
3. In the User variables... section, click the New button.
The New User Variable dialog opens,
4. For the Variable name, enter XBUILDDIFF.

Xbuild Reference Manual

Xbuild overview 5

For the Variable value, enter the path to the executable, for example
C:\Program Files\SourceGear\DiffMerge\DiffMerge.exe.

Edit in Text Editor


You can edit formats in a text editor using File > Edit in Text Editor:

When you click Edit In Text Editor in the menu, a text editor opens
with a text file containing all the formats, which you can modify. After
saving the file and closing the text editor, XBUILD resumes control. The
default editor is Windows Notepad, however you can use a different
editor by adding the path of the executable to the XBUILDEXTEDIT
environment variable.
To add an environment variable in Windows XP:
1. Go to Start > Control Panel > System.
The System Properties dialog opens.
2. On the Advanced tab, click the Environment Variables
button.
The Environment Variables dialog opens.
3. In the User variables... section, click the New button.
The New User Variable dialog opens,
4. For the Variable name, enter XBUILDEXTEDIT.
For the Variable value, enter the path to the executable. For example,
the path to Notepad++ executable can be C:\Program
Files\Notepad++\notepad++.exe.

6 Xbuild overview

Xbuild Reference Manual

Sim-Info menu
Set .md - opens the Simulation Information dialog.

Use it to associate a Machine Design (.md) file for a particular type of


machine with the post processor.
When the machine simulation option is used in FeatureCAM, the machine
will be included in the simulation.

Reserved words
Reserved words are specific words that are used in writing the post in
Xbuild. These words are 'reserved' because they have a special meaning
in FeatureCAM, and cannot be used for anything else. They are place
holders that will later be replaced with values provided by FeatureCAM
when it generates the NC code.
Reserved words are referenced in formats (see page 11) by enclosing
each word with angular brackets < >. Additional ASCII characters (for
example X, Z and F) are used to specify the letter for each word address.
In Xbuild, the reserved words can be viewed from:
the CNC-Info - Words-N menu.
the File - WordList menu in the Formats editor.
In Xbuild, there are four types of reserved words:
Numeric (see page 7).
String (see page 8).
Logical and System (see page 8).

Numeric
Numeric reserved words are replaced by their numeric values when Post
is executed. For example, the numeric reserved word <X-COORD> is
replaced by the current X axis coordinate position. The output format of
numeric reserved words is configured via the Words Info dialog (CNCInfo - Words option).

Xbuild Reference Manual

Xbuild overview 7

Numeric reserved words can be preceded by the symbols $, or @


(<$name>, or <@name>). The $ prefix signals Post to output the
previous value of a reserved word. The @ prefix signals Post to
output an incremental value (the difference between the current
value and the previous value).

String
String reserved words provide a set of characters that were previously
defined in the NC Codes dialog (to open it, select CNC-Info - NC
codes from the Menu bar).
For example, G01, G02, or M03 could be strings that were previously
defined as <MOTION> and <SPINDLE>.

Reserved words in conditional statements


System and logical reserved words are used together to set up conditional
statements that are evaluated by Post. Depending on whether a
conditional statement is true or false, Post either includes or omits
certain data from the program format.
The format for conditional statements is as follows:
<IF><Logical Reserved Word><THEN>
{N<SEQ>} . . .
<ENDIF>
or
<IFNOT><Logical Reserved Word><THEN>
{N<SEQ>} . . .
<ENDIF>
In the conditional statement below, for example, the data between the
words <THEN> and <ENDIF> is only output if CSS is ON.
<IF><CSS-ON><THEN>
{N<SEQ>}G96S<CSS-SPEED><EOB>
<ENDIF>
System Reserved Words
<IF> - first element in a conditional statement, always followed by a
logical reserved word to verify that a condition is true.

8 Xbuild overview

Xbuild Reference Manual

<IFNOT> - first element in a conditional statement, always followed by a


logical reserved word to verify that a condition is false.
<THEN> - second element in a conditional statement, placed after a
logical reserved word.
<ELSE> - third element in a conditional statement following an
<IF><logical reserved word><THEN> to output an alternative decision.
<ELSEIF> - third and higher element in a conditional statement to verify
that a condition is true. Used to evaluate multiple alternative decisions
within an <IF> <ENDIF> block.
<ELSEIFNOT> - third and higher element in a conditional statement to
verify that a condition is false. Used to evaluate multiple alternative
decisions within a single <IF> <ENDIF> block.
<ENDIF> - last element in a conditional statement.
It must be on a line by itself.
<INCLUDE:Custom Format Name> - operates like a subroutine by
calling a custom format from within another format. The custom format is
used to eliminate duplicating large blocks of code in more than one
format.

Configuring reserved words


When any of the Words commands are selected from the CNC-Info
menu (for example, Words1), the Words Info dialog is displayed
showing a table of numeric reserved words.

Xbuild Reference Manual

Xbuild overview 9

The three buttons at the bottom of the dialog, labelled OK, Cancel and
Next, can be used to preserve the changes made, exit the table without
saving any changes, and advance to the next Words Info dialog
respectively.
The words tables contain the format (symbolic name, numeric parameters
and factors) for each numeric reserved word.
The LD_ZR, TRL_ZR, DEC_PT, UNS_V, and +SIGN fields for each
reserved word all toggle On/Off. To change an item in the table, click the
mouse on the check box in the appropriate column for that item.
To select the Format or Factor field for any of the reserved words,
move the cursor to the appropriate box and double-click the mouse there;
the selection is highlighted. To change the format or factor, type the new
value, then press Enter.
The first column (far left side) in the tables identifies the symbolic name
(sometimes abbreviated) of each numeric reserved word.
All of the words in the table that apply to the NC machine must be
configured.
LD_ZR - Leading Zeros are output if this option is toggled On. Zeros
are output in all leading positions of the value, excluding significant digit
locations (for example, 1" with a 3.4 format would output two leading
zeros: 001).
TRL_ZR - Trailing Zeros are output when this option is set to On.
Zeros are output in all trailing positions of each value output for the
designated reserved word, excluding significant digit locations (for
example, 10" with a 3.4 format would be output with four trailing zeros
as 100000).
DEC_PT - is used to turn the Decimal Point Character On/Off (for
example, when DEC_PT is toggled ON, 100" is output as 100.0).
The decimal character (either a , representing the European
decimal, or a . representing the U.S. decimal) is specified in the
General Info dialog. To open it, select CNC-Info - General from
the Menu bar.
UNS_V - when the Unsigned Value option is on, the number is output
without its sign. This is often useful for distances.
+SIGN - when the Plus Sign is toggled ON, the plus sign (+) is output
for positive integers.

10 Xbuild overview

Xbuild Reference Manual

Format - specifies the number of digits in the numeric value, represented


by each numeric reserved word. Numbers are specified as N.n, where N
represents the maximum number of digits to the left of the decimal point,
and n is the maximum number of digits to the right of the decimal point.
For example, entering 3.4 specifies a maximum +, or - departure of
999.9999, or a minimum departure of 0.0001.
Use the Words Info dialog to specify a numeric representation for
each reserved word that requires it.
Factor - is used to modify numeric values during post processing. Each
value that is output by Post is multiplied by its factor. For example, some
controls require arcs to be calculated from center to start point. This
requires a -1 factor for <ARC-Z> and <ARC-X>.

Formats menu
The Xbuild Formats menu enters specific program formats for the
various blocks which can appear in a part program. Each format is made
up of combinations of reserved words, literals, comments, and userdefined variables.
The Formats menu lists a number of general groups of formats:
Program - formats that are used in almost every part program,
and include commonly used formats (for example Program
Start, Tool Change , Segment Start, Program End).
Move - formats include the rapid and feed moves which make up
the largest portion of any part program (for example Rapid,
Linear, Circular). These program formats must be carefully
defined.
Macro - formats include Open Macro, Close Macro, Macro
Call, In-Macro Linear, and In-Macro Circular.
The Macro formats are not available for turn posts.
Cycle - formats include most of the canned cycles which are
found in many controls (for example Deep Hole, Tap).
Custom - a custom format is used as a place holder for a block of
code that may be used in several different formats. The system
reserved word <INCLUDE:> is placed into the appropriate section
of a format that uses the block of code from the custom format. The
name of custom format should be inserted after colon:
<INCLUDE: Custom Format Name>.

Xbuild Reference Manual

Xbuild overview 11

Each of these groups contains specific formats which, when selected, are
displayed in the Formats editor (see page 12).
The formats use specific reserved words, which are discussed
separately for each post type. For example, milling reserved words
can be found under the Mill Post section, turning reserved words
can be found under the Turn Post section and so on.

Formats editor
When a format is selected from the Formats menu, the Xbuild program
opens the Formats editor with the selected format on the screen.

The Formats editor has two menus (File and Edit), which are used in
editing the selected format; however, these menus do not change from
one format to another. All formats are edited in the same manner.

File menu
The File menu contains commands related to reserved words and
formats:
WordList - displays a list of the reserved words (see page 13).
Save Format - saves changes made to current format.
Previous Format - moves to format preceding the current format. The
Ctrl + P keys may be used as a shortcut to move backwards through the
various formats.

12 Xbuild overview

Xbuild Reference Manual

Next Format - moves to format following the current format. The Ctrl
+ N keys may be used as a shortcut to advance through the various
formats.
Save & Test CNC - saves changes made to post and updates NC code
without having to exit Xbuild.
Quit - exits the Formats editor and saves the modified format in
memory. If any changes have been made to the selected format when the
Quit command is selected, the user is prompted to save (Yes or No) the
changes that were made, or to cancel the Quit command. If Cancel is
selected, the Formats editor remains active.
Reserved Words dialog
When WordList command is selected from the File menu in the
Formats editor, the Reserved Words dialog is displayed with a list of
reserved words specific to the type of post you are writing.
For turn/mill posts, Xbuild uses color-coding. The words specific to
milling are blue, and the words specific to turning are green.
The list can be scrolled up and down by means of the scroll bar at the
right side of the window. Moving the bar to the arrow at the top of the
scroll bar and clicking the mouse there causes the list to scroll up, while
the arrow at the bottom of the scroll bar causes the list to scroll
downwards. The reserved words are grouped into four categories
described earlier: numeric (see page 7), string (see page 8), logical and
system (see page 8).

Xbuild Reference Manual

Xbuild overview 13

To place a reserved word into the format (displayed in the main part of
the screen), scroll the list to the desired word, and then click on it. The
word is placed in the program format at the point where the test insertion
bar was last placed.

The test insertion bar is a blinking vertical bar which shows where
text will be entered. If it is not visible, move the mouse to the format
window and click the mouse.
To place reserved words inside modality brackets, select the Modal
Delimiters check box:

14 Xbuild overview

Xbuild Reference Manual

Reserved words can be removed from the program format by using the
backspace key on the keyboard. The text editing functions in the
Formats editor are similar to those of any Windows word processor.
The Reserved Words dialog can be closed by clicking the close
icon, or by selecting the WordList command a second time in the File
menu.

Edit menu
This menu contains five commands found in most Windows programs.
These are briefly described here.
Undo - can be used to undo the last action. For example, if a
reserved word was placed incorrectly, the Undo command
removes it.
Cut - removes the selected text, and places it on the clipboard
where it can be recalled with the Paste command.
Copy - places the selected text on the clipboard in the same way
as the Cut command does, except that the selected text is not
removed from its selected location.
Paste - places the contents of the clipboard at the text insertion
point.
Delete - removes the selected text without copying it to the
clipboard.
For more details, refer to the "Using the Clipboard" section in the
Windows User's Manual.

Using expressions in formats


Expressions are surrounded by square brackets [ ]. They are evaluated
prior to being output.
This example multiplies the current X coordinate by five:
[<X-COORD>*5].
This example offsets a rapid move by (5,5):
N<SEQ>G00 X[<X-COORD>+5] Y[<Y-COORD>+5] Z<ZCOORD>.
Additional examples of expressions

Xbuild Reference Manual

Xbuild overview 15

[# Set x = 3, y = 5, z = 0.0001]
X[<X-COORD>=3]Y[<Y-COORD>=5]Z[<Z-COORD>=0.0001]<EOB>
[# Calc (x + 3)*2]
[(<X-COORD>+3)*2]<EOB>
[# Calc sqrt(pow(x, 2) + pow(y, 2))]
[sqrt(pow(<X-COORD>,2)+pow(<Y-COORD>,2))]<EOB>
[# Calc atan2d(y, x)]
[atan2d(<Y-COORD>,<X-COORD>)]<EOB>
[# Is z = 0 within +-0.001? If so, print Yes]
<IF>[apxeq(<Z-COORD>,0,0.001)]<THEN>
Yes<EOB>
<ENDIF>
[# Print special charcters]
<91><93><EOB>
[# Format x using tool's format]
[<TOOL>:<X-COORD>]<EOB>
[# Format -x as LTDUP|2.2|2]
[LTDUP|2.2|2:-<X-COORD>]<EOB>
[# Set x = 1 without printing anything]
[:<X-COORD>=1]<EOB>
[# Is x != 0 and y != 0?]
<IF>[and(not(apxeq(<X-COORD>,0)),
not(apxeq(<Y-COORD>,0)))]<THEN>
Yes<EOB>
<ENDIF>

16 Xbuild overview

Xbuild Reference Manual

[# Set variable a = x]
[a=<X-COORD>]<EOB>
[# Calc a + 5]
[a+5]<EOB>

Printing square brackets


Since '[' and ']' are special characters, for them to be output in the NC
code, you must enter them as <91> and <93> respectively.
Backward compatibility: when you open an existing CNC file that
was created prior to the brackets being made special characters in
Xbuild, those brackets will be automatically converted to <91> and
<93>.

Xbuild Reference Manual

Xbuild overview 17

Numeric operators
Xbuild accepts the following numeric operators:
Operator

Description

Operator

Description

addition,
adds two
numbers.

anglexy(x,y)

Computes the angle


between the X-axis
to the line between
(0,0) and (x,y).

string
concatenati
on, joins
two strings.
if given a
string and a
number, the
string is
converted
into a
number and
then the two
numbers are
added.
-

subtraction,
subtracts two
numbers

acosd(num)

Computes the
arccosine (in
degrees) of a
number.

multiplication,
multiplies two
numbers

atand(num)

Computes the
arctangent (in
degrees) of a
number.

division,
divides two
numbers

atan2d(num)

Computes the
arctangent (in
degrees) of a
number.

18 Xbuild overview

Xbuild Reference Manual

Operator

Description

Operator

Description

Modulo
operation.
Performs an
integer division
and returns the
remainder.

ceil(num)

returns the nearest


integer greater than
or equal to a
number.

tan(num)

Computes the
tangent of an
angle (given in
radians).

sqrt(num)

Returns the square


root of a number.

sind(num)

Computes the
sine of an angle
(given in
degrees).

mm2in(millim
eters)

Converts from
milliliters to inches.

cosd(num)

Computes the
cosine of an
angle (given in
degrees).

exp(num)

Returns e^x where


e = 2.71828.

tand(num)

Computes the
tangent of an
angle (given in
degrees).

log(num)

Returns ln(x)
where ln is the
natural logarithm.

asin(num)

Computes the
arcsine (in
radians) of a
number.

log10(num)

Returns the base-10


logarithm of a
number.

acos(num)

Computes the
arccosine (in
radians) of a
number.

pow(base,po
wer)

Returns a base
number raised to a
power.

atan(num)

Computes the
arctangent (in
radians) of a
number.

degtorad(num
)

Returns an angle in
radians as
converted from
degrees.

Xbuild Reference Manual

Xbuild overview 19

Operator

Description

Operator

Description

atan2(num)

Computes the
arctangent (in
radians) of a
number.

radtodeg(num
)

Returns an angle in
degrees as
converted from
radians.

asind(num)

Computes the
arcsine (in
degrees) of a
number.

pi

The mathematical
value of pi to ten
decimal places.

in2mm(num)

Converts inches radiusxy(x,y)


to millimeters.

Computes the
distance from the
origin to XY.

Example
Let's say b = 12
The following line
[:a=b%10]
will result in a = 2
The operation performed by the modulo operator is to return the
remainder of a division. So a 12 divided by 10 will result in a remainder
of 2. This can be used to restrict the angles between 0 and 360 on
machines that require this limitation.

Logical operators
Operator

Function

Example

Explanation

eq

Equal

[eq(<TOOL>, 0)]

True if <TOOL>
0
Also works for
strings.

neq

Not Equal

[neq(<TOOL>, 0)]

True if <TOOL>
0
Also works for
strings.

20 Xbuild overview

Xbuild Reference Manual

Operator

Function

Example

Explanation

lt

Less Than

[lt(<TOOL>, 0)]

True if <TOOL>
<0
Also works for
strings.

gt

Greater Than

[gt(<TOOL>, 0)]

True if <TOOL>
>0
Also works for
strings.

le

Less Than or
Equal

[le(<TOOL>, 0)]

True if <TOOL>
0
Also works for
strings.

ge

Greater Than or
Equal

[ge(<TOOL>, 0)]

True if <TOOL>
0
Also works for
strings.

and

And

[and(<Z-UP>,
<INDEX>)]

True if both
<Z UP> and
<INDEX> are
true.

or

Or

[or(<Z-UP>,
<INDEX>)]

True if either
<Z UP> or
<INDEX> is true.

not

Not

[not(<ZCHANGED>)]

True if <Z
CHANGE>
is false.

apxeq

Approximately
Equal

[apxeq(<Z-COORD>,
0)]

(if tolerance is not


given, the default
is 1e-6.)

[apxeq(<Z-COORD>,
0, 1e-6)]

True if <Z
COORD> 0
within 1e-6.

Additional examples of logical operators in expressions


To output Z as 0 if Z is within 0.0001 of zero:
<IF>[apxeq(<Z-COORD>, 0 , 0.0001)]<THEN>

Xbuild Reference Manual

Xbuild overview 21

N<SEQ> G00 X<X-COORD> Y<Y-COORD> Z0<EOB>


<ENDIF>
To make Rapid Move use polar coordinates:
N<SEQ> I0 J0<EOB>
N<SEQ> G10 R[sqrt(pow(<X-COORD>, 2) +
pow(<Y-COORD>, 2))]
H[D|3.2|1.0:atan2d(<Y-COORD>, <X-COORD>)]
<EOB>
To output Z as 15 if Z is between 10 and 20 inclusively:
<IF>[and(ge(<Z-COORD>, 10), le(<Z-COORD>, 20))] <THEN>
N<SEQ> G00 X<X-COORD> Y<Y-COORD> Z15<EOB>
<ENDIF>
If P1 variable is not set, set it to the string G0:
<IF>[eq(<P1>,"")]<THEN>
[<P1>=G0]
<ENDIF>

String operators
Operator

Function

Example

Explanation

uppercase

Convert string
to all upper-case
characters

[uppercase("ab
c")]

Prints ABC.

If used with two


strings, the
strings are
concatenated.

["abc" + "def"]

Prints abcdef.

If used with a
string and a
number the
number is
converted to a
string and then
they are added.

["0.5" +0.0]

Prints 0.5. This is a


shortcut for converting
a string into a number.

Many of the logical operators also work for strings.

22 Xbuild overview

Xbuild Reference Manual

Assignment
The result of any operation can be assigned to another reserved word or to
a variable. In Xbuild, variable names can consist of one more characters
and are not case sensitive. The first character must be alphabetic and the
rest can be any combination of alphanumeric characters and the
underscore character, for example ABC, X23, CENTER_PT.
The result of an assignment operation is the value of the reserved
word or variable being assigned. For example, for [x = 5] the result
is 5.
Strings can contain numeric, logical and string values.
Examples
To increase the current value of the reserved word <Z-COORD>
by 10:
[<Z-COORD> = <Z-COORD> + 10]
To set the variable XVAR to the current value of <X-COORD>,
and then double XVAR:
[x_var = <X-COORD>]
[x_var = x_var * 2]
These statements do not change the value of <X-COORD>.
To set the variable feature to the string hole, then add the string
top to the variable feature, and set the new string to the variable
name:
[feature="hole"]
[name= "top" + feature]

Formatting expressions
The format for an expression can be customized by preceding the
expression with an optional format specification. The format specification
is separated from the expression by a colon :.

Xbuild Reference Manual

Xbuild overview 23

LTDUP|Format|Factor

where:
L stands for Leading Zeros.
T stands for Trailing Zeros.
D stands for decimal point.
U stands for unsigned value.
P stands for plus sign.
Format specifies the number of
digits, for example 3.4.
Factor specifies the multiplier, for
example 1.0.

The above form is in correspondence with the Words Info dialog


(see page 9) in Xbuild.
Examples
Expression

Result

[D|3.4|1.0:10]

10.0

[D|5.4|1.0:10]

10.0

[LD|3.4|1.0:10]

010.0

[LP|3.0|1.0:10]

+010

[PT|3.1|1.0:10]

+100

When no format specification is given and there is no colon specified,


Xbuild automatically uses the format of the numeric reserved word within
the square brackets. For example, [<X-COORD>+1] is printed in the
default format for the <X-COORD> reserved word as configured in the
Words Info dialog. If there aren't any reserved words, such as in the
expression [1+2], the default format for the <Z-COORD> reserved word
is used.

Suppressing printing of an expression


To suppress the printing of the assignment result, specify only the colon
as the format specification.
For example, neither of the following expressions will print a value
because the first character of the expression is set to ':'.

24 Xbuild overview

Xbuild Reference Manual

[:x_var=<X-COORD>+1]
[:<Y-COORD>*2]

Modality delimiters
In some cases, the CNC machine can use the concept of modality to
avoid redundant data and reduce the length of the program. When using
modality, repeated coordinates or commands are 'stripped' from the part
program.
String and Numeric reserved words may be surrounded by modality
delimiters { }, to signify to Post to remove redundant data. The modality
delimiter prevents a repetitive occurrence of a reserved word as long as
its value remains the same as the previous occurrence of it.
For example, when modality delimiters are used in {<SEQ>}, you have
an option of 'stripping' all sequence numbers from the program during
post processing. This is done by specifying 0 for the start and sequence
step numbers in Post. This forces the sequence numbering to remain the
same.
Modality brackets may be used on expressions containing reserved
words, for example: {X[<ABS-DEPTH>*2]}.
To place reserved words inside modality brackets, select the Modal
Delimiters check box:

Xbuild Reference Manual

Xbuild overview 25

Control characters in formats


Different systems may allow for ASCII (American Standard Code for
Information Interchange) control character(s), also referred to as
'nonprintable' characters. You can embed control characters in Xbuild
formats. To enter control characters, type the decimal value equivalent of
the ASCII code inside the angular brackets < >.
Use:
<13> - for a carriage return.
<10> - for a line feed.
<32> - for a space.
<9> - for a horizontal tab.
<91> - for a left square bracket.
<93> - for a right square bracket.

Changing post units


Post processors (posts) convert the tool path information displayed in
FeatureCAM into the NC code required by your machine. One of the
things the post controls is whether the NC code is output in inches or
millimeters.
To change post units:
1. In Xbuild, select General from the CNC-Info menu.
2. In the General Information dialog, in the Dimension field,
select whether the post is in Inch or Metric units, or both. We
recommend posts that support both units.

3. Click OK.
4. Choose Words-1 from the CNC-Info menu.

26 Xbuild overview

Xbuild Reference Manual

5. In the Words Info dialog, update the Format to specify the


number of digits before and after the decimal points for each linear
positional word. Typically, 3.4 is used for inch posts, and 5.3 is
used for metric posts.

6. Your post type may contain several pages of the numeric words.
Click Next to display the next set of Words Info. Repeat steps 4
through 5 to change all the linear positional words for your post
type.
7. When you have finished, click OK to close the dialog.
8. Select Formats - Program - Program Start to check for any
preparatory code denoting units (G20/G21, G70/G71).
Fanuc style controls may use G20 for inch and G21 for metric
units. If this code is present, remove it.
Heidenhain controls must have the units set in the first line of
the program:
<SEQ> BEGIN PGM [uppercase (<PROG-NAME>)]
INCH<EOB>
Edit the code so the units here match the units chosen in Step 2.
9. Save the format.

Xbuild Reference Manual

Xbuild overview 27

Mill posts
This section describes how to use Xbuild for writing mill posts.

CNC-Info menu
The CNC Info options are used to set up the basic parameters for a CNC
program:
General - specifies the output program format.
NC Codes - defines the exact character string for different NC
commands.
Feeds & Speeds - changes the minimum and maximum spindle
speeds and feed rates in a CNC program.
Fixture ID - this is a list with valid fixture IDs.
Words-N - configures the format of numeric reserved words.
Five-Axis - selects the five-axis machine type, and configures its
dimensions.

28 Mill posts

Xbuild Reference Manual

CNC-Info - General
Allows you to specify the output program format. The General
Information dialog appears.

Be sure to select Milling in the Machine Type field to have


Xbuild display appropriate options.
Any parameter may be changed by selecting it, typing the value, or
toggling to the desired selection (if a new value is entered, press Enter).
The comment block describes the post processor.
These values are default values when no CNC data file has been
loaded into the Xbuild program. When a file is loaded, several or all
of these values may change.
You can set the following parameters:
Machine type - classifies the type of post.
The choices are:
Milling - use this type of post for 2.5D or 3D milling.

Xbuild Reference Manual

Mill posts 29

Turning - use this classification for 2-axis turned parts.


Turn/Mill - use this type of post for lathe with powered rotary
tools.
Wire EDM - use this type of post for Wire EDM machines.
This distinction controls type of reserved words and program formats that
are available in the post.
Dimension - toggles between Inch and Metric output.
Post uses the selection to convert the dimensions that affect X and Y
coordinates as well as feed rate. The setting in the CNC Data file takes
precedence over the assumed inch unit in FeatureCAM. If a part program
is written in inch units, and is processed with a metric CNC data file, the
resulting part program is converted (using standard conversion constants)
into metric units.
Circ. interpol. - selects the programming format on the CNC for which
the post processor is being built.
You can choose Multi-Quadrant, Single Quadrant, or Not
Supported option, as appropriate. For example, if the Numerical
Control cannot drive an arc across a quadrant line (plus or minus X and Y
axes), then select Single Quadrant circular interpolation. When circular
interpolation is turned off in post, then wrap tolerance is used to control
fineness of toolpath.
EOB - defines the end of block character(s), or <EOB>.
We recommended that you use the default characters, that is, <13>
(carriage return) and <10> (line feed).
Decimal point - defines the decimal point character.
This character is usually a period '.' for United States controls, and
a comma ',' for European controls.
Max. macros - specifies the maximum number of macros (subprograms) available on the control.
If macros are not available, set this value to zero, and select Not
Available in the Macro Type parameter.
Macro type - specifies how macros are formatted when the part program
requires them.
Choose from the following options:
Local - places macro definitions within the main NC part
program.

30 Mill posts

Xbuild Reference Manual

End of Prog. - places macro definitions at the end of the main


part program (for example, Heidenhain controls). The PROGRAM
END program format should be specified for output at the end of
the main program and the FILE END program format should be
specified for output at the end of these macro definitions.
Not Available - signals Post that macros are not available.
Indiv. Files - places macro definition in a separate file (for
example, FANUC and GE MC 2000 controls). The name of each
macro file consists of the assigned name that was specified in Post
and the system-assigned macro number The internal sub-program
name is automatically added to the main program name as the
external file name.
One File - places all macro definitions in one file. Post generates
two files, the main part program and a file containing all macros.
This option can output to Bridgeport controls via the EZ-Utils
module, CNCCOMMUNICATION option (Heidenhain DNC
utility).
The name of the macro file consists of the assigned name specified in
Post, MA (representing the macro specification) and the .TXT file
extension. For example, SAMPLEMA.TXT (macro file) and
SAMPLE.TXT.
Dogleg rapid moves - affects simulation only.
If this option is selected, then during a rapid move from point A to point
B both simulated axes will move at the maximum rate until one of the
axes moves is completed, and then the machine will proceed to B with
only the other axis continuing in a straight line.
If this option is not selected, then the simulation shows all rapid moves
from point A to point B as straight lines. In general, rapid moves on
machines are not straight lines.
Call local macro after it is defined - automatically executes macro
when it's defined.
Some controls (such as the Heidenhain 370) automatically execute
macros when they are defined. For these controls deselect Call local
macro after it is defined so that the macro is not called twice. For
other types of controls, leave this option selected.
Include first canned cycle move in macro - outputs the current
position as the first location of a macro.
Without this selected, the first move will not be in the macro, instead it is
assumed that it is output on the canned cycle line.

Xbuild Reference Manual

Mill posts 31

To properly include the first move in a macro, you will need to use a
combination of this check box and the logical variable <CYCLEMACRO> to suppress actually performing the canned cycle on the
canned cycle line.
For a Fanuc 0M, if a canned cycle line ends with K0 then the machine
goes into canned cycle mode, but the actual canned cycle is not
performed. Here is the drilling format for the Fanuc 0M.
{N<SEQ>}<CYCLE>{X<X-COORD>}{Y<Y-COORD>}
R<ABS-ZCLEAR>Z<ABS-DEPTH>F<FEED>
<IF><CYCLE-MACRO><THEN>
K0
<ENDIF>
<EOB>
The Include first canned cycle move in macro check box
must be selected so that the initial location is output in the macro.
Post supports local coordinates - post that redefines the coordinate
system using datum shifts should have this option selected.
Post supports incremental macros - posts that program milling
macros in an incremental fashion should have this option selected.
Seq max - this is the maximum value for sequence numbers.
After reaching this number, the sequence numbers start over. If the Seq
max radio button is not selected, then no limit is set.
NC file extension - the default file extension for you CNC programs.
For example if it is set to .txt, and your part is called 'bracket', then the
G-code file will be called bracket.cnc.
2-axis machine - removes ramping moves and ensures that the plunge
move is performed in a single move.
Overall, this setting eliminates unnecessary Z moves that cannot be
handled by a 2-axis machine.
This check box is only available for milling posts.

32 Mill posts

Xbuild Reference Manual

CNC-Info - NC Codes
Specifies the exact character strings for different NC commands. The NC
Codes dialog appears.

The character strings entered in the dialog must match the required
strings specified for the NC control. This information is usually
found in the programmer's manual for the NC control.
You can set the following parameters:
Motions - the options in this frame describe motion types required by
the NC machine. All of these codes must be specified.
For example, Linear is generally defined as G1, but may be changed to
G01, or any other string (up to 11 characters). All motion commands are
passed to Post via the string reserved word <MOTION>.
The following options are available:
Rapid - rapid move.
Linear - feed move.
Circ. CW - circular interpolation, clockwise.
Circ. CCW - circular interpolation, counter-clockwise.

Xbuild Reference Manual

Mill posts 33

XY, UV - refers to Wire EDM 4-axis movements using an upper


and a lower curve. Typically, XY represents the curve at the
bottom of the part, and UV represents the curve at the top of the
part.
This option is only available for wire EDM posts.
Compensation - generates cutter diameter compensation in the output
when turned On in FeatureCAM, and if it is built into the CNC data file.
Compensation selections use the string reserved word <COMPSTAT> for one of the below options, or an empty string is assigned if
Compensation was not turned On in corresponding program (for
example, FeatureCAM, FEATUREWIRE and so on).
The Compensation frame has these options:
Cancel - compensation off.
Left - compensation on cutter, applied to left in direction of travel.
Right - compensation on cutter, applied to the right in the
direction of travel.
3D - code for turning 3D cutter compensation on. Linear X, Y , Z
motions have a vector component of the tool diameter added
according to the direction vector defined by I, J, K.
This applies to finishing moves only.
This code does not apply to Wire EDM.
Cancel 3D - turns off 3D cutter compensation.
This code does not apply to Wire EDM.
Units - Specify the G codes that set the post to Inch Units or Metric
Units. The reserved word <UNITS> outputs the current value specified
by the user. Typical values are G20/G21 or G70/G71.
Circular planes - is used for circles described in XY, ZX, YZ Cartesian
planes.
Pecking - selects types of pecking performed for drilling and tapping.
Miscellaneous - the options in this frame contain codes used for
coolant and spindle specifications.
The available options are:
Cool OFF - coolant off.
Cool Mist - coolant on, mist.

34 Mill posts

Xbuild Reference Manual

Cool Flood - coolant on, flood.


Coolant 3 - user-configurable coolant code (for example, you can
use it to turn on the air blast).
Coolant 4 - user-configurable coolant code.
The coolant options use the string reserved word
<COOLANT>.
Spindle CW - spindle on, start clockwise.
Spindle CCW - spindle on, start counter-clockwise.
The spindle options use the string reserved word
<SPINDLE>.
Spindle Stop - stops spindle.
Spindle Orient - orients spindle.
Cycles - the options in this frame describe canned cycles formats.
They are used for header, canned motion and cycle cancel blocks. The
header block (for all canned cycles) must contain formats to position
down to the clearance plane to drill the first hole.
Drill - specifies the header block for a drilling cycle.
Spot Face - specifies header block for a spot face cycle.
Deep - specifies a deep hole cycle header block.
Tap - specifies the header block for a tapping cycle.
Chip Break - specifies the header block for a chip break cycle.
Bore (F-D-F) - specifies a boring (feed-in, dwell, feed-out) cycle
header block.
Bore (F-F) - specifies a header block for a boring (feed-in, feedout) cycle.
Bore (F-S-R) - specifies a boring (feed-in, stop spindle, rapid)
cycle.
Bore (No Drag) - specifies a boring (feed-in, stop spindle, move
to side, retract) cycle.
Z rapid retract - when using canned cycles, causes tool to retract
to <ZRAPID> plane.
R plane retract - when using canned cycles, causes tool to retract
to <ZCLEAR> plane.

Xbuild Reference Manual

Mill posts 35

CNC-Info - Feeds and Speeds


Defines the minimum and maximum machine speeds and feed rates. The
Feeds & Speeds dialog appears.

You can set the following parameters:


Speed Max. RPM - maximum speed rate in rotations per minute.
Feed Max. and Feed Min. - the feed rate limits when the maximum
speed rate is specified in rotations per minute.
Degrees/Minute Max and Degrees/Minute Min. - the feed rate
limits when the maximum speed rate is specified in degrees per minute.

CNC-Info - Fixture ID
Records the various G codes that are valid fixture ID's. The Fixture ID
dialog opens. You can type the appropriate IDs directly into the list, and
click OK.

An example list might be:


51
52
53

36 Mill posts

Xbuild Reference Manual

54
55
FeatureCAM will automatically look in the current post processor and
will assign the next available fixture ID to a new setup and to the numeric
reserved word <FIXTURE>.

CNC-Info menu - Five-Axis


Selects the five axis machine type. The Five-Axis dialog opens.

Five axis machine types supported by FeatureCAM are:

Xbuild Reference Manual

Mill posts 37

Table on table machines


B and A stacked rotary tables - these milling machines
rotate about the Y-axis, then around the X-axis. They are also
called A over B machines.

A and B stacked rotary tables - these machines rotate


about X-axis then around the Y-axis. These machines are also
known as B over A machines.
45 degree angled B and C stacked rotary tables - rotate
the B table about a 45 degree angled axis and then rotate about
the C table.

45 degree angled A and C stacked rotary tables - rotate


the A table about a 45 degree angled axis and then rotate about
the C table.

38 Mill posts

Xbuild Reference Manual

5-axis positioning and 5-axis simultaneous on table


on table machines - neither automatic correction of tool
length offset nor 3D coordinate transformation is
needed. FeatureCAM transforms the toolpath according to the
rotations of the tables, so the coordinate system is always the
same as the machine's. Also, automatic correction of tool
length offset is not needed since the tool does not rotate (only
the tables do).
Machines with tilting heads
FeatureCAM supports machines with tilting heads as long as they
have the following two capabilities:
3D coordinate transforms - the control must allow
programming of 2.5D features in the X and Y planes. This
means that the depth of features are always in the Z or -Z
directions.
Tool length offset - the touch-off point (or zero point) of the
tool must move with the rotated tool.
5-axis positioning on machines with tilting head - the
machine needs to have automatic correction of tool length
offset and 3D coordinate transformation. This is because
FeatureCAM outputs the toolpath in a coordinate system that
has the same Z direction as the setup, so the machine needs 3D
coordinate transformation to transform the toolpath back
into the machine's coordinate system. Also, because the tool
length offset changes from the tilting of the tool, the machine
needs automatic correction of tool length offset to
correct that.
In terms of the coordinate system that FeatureCAM uses to
output the toolpath, it will have the same Z direction as the
setup but the X and Y directions may not be the same as the
setup. This is because FeatureCAM is restricted by the
configuration of the rotary axes on the machine. Imagine the
tool has a coordinate system attached to it which rotates with
the rotary axes. From the initial position (0 for both rotary
axes), the machine rotates to match Ztool with Zsetup. After the
rotations, Ztool now matches Zsetup but Xtool and Ytool may
not match Xsetup and Ysetup.

Xbuild Reference Manual

Mill posts 39

5-axis simultaneous on machines with tilting head the machine only needs to have automatic correction of
tool length offset. FeatureCAM outputs the toolpath in the
machine's coordinate system so no need for 3D coordinate
transformation. However, automatic correction of tool
length offset is still needed because of the tilting of the tool.
Generic
Coordinates are outputted relative to their own setups (no
transformations). This is useful for outputting code that is going to
be further processed.
For machines with tilting heads, the specific machine architectures
supported are as follows:
C rotary table and B tilting head - these machines rotate about
Z with a table, and then the head rotates around the Y-axis.

40 Mill posts

Xbuild Reference Manual

C rotary table and A tilting head - these machines rotate about


Z with a table, and the head rotates around X.

C swiveling and A tilting head - these machines rotate around


Z on the head, and then the head tilts around the X axis. They are
also known as gimbal heads.

Xbuild Reference Manual

Mill posts 41

B and A tilting head - rotates about Y, and then X in the head.


See also Setting dimensions for B and A tilting head (see page 46).

A and B tilting head - rotates about X, and then Y in the head.

42 Mill posts

Xbuild Reference Manual

B rotary table and A tilting head - rotates about Y using a


table and then X in the head.
A rotary table and B tilting head - rotates about X using a
table and then Y in the head.
B and 45 degree angled A tilting head - rotates about Y, then
rotates about X with a head that is angled by 45 degrees. This head
is also known as a huron head.

Xbuild Reference Manual

Mill posts 43

A and 45 degree angled B tilting head - rotates about X, then


about Y with a head that is angled by 45 degrees. Also known as a
huron head.

44 Mill posts

Xbuild Reference Manual

C rotary table and 45 Degree angled A tilting head rotates about C using a table, then rotates about X with a head that
is angled by 45 degrees.
C rotary table and 45 degree angled B tilting head - rotates
about C using a table, then rotates about Y with a head that is
angled by 45 degrees.
B rotary table and A tilting head - rotates about Y using a
table and then X in the head.
Machine dimensions
Table on table machines
The Rotary Center Offset values are contained in the post
processor files.

Enter the following values measured on the machine:


Y coordinate of A-axis centerline - Y distance from the
pivot point to the A-axis centerline. This can be zero which
means the pivot point is under the A axis pedestal.
Z Offset of A-axis face from B-axis centerline - Z signed
offset of A axis face from B axis centerline.

Xbuild Reference Manual

Mill posts 45

Offset of centerline of A-axis from centerline of B-axis


- X side-to-side distance in mounting of the rotational centerline
of the A axis pedestal, measured relative to B axis centerline.
Tilting head machines
Offset of gauge face from second rotary axis for
example, for a B and A tilting head machine, it's the X Y Z
offset from the A axis to the gauge face.
Offset of second rotary axis from first rotary axis for
example, for a B and A tilting head machine, it's the X Y Z
offset from the B axis to the A axis.
Linearization settings for 5-axis simultaneous:
Use linearization if selected, each move is refined into smaller
moves so that the angular movements do not result in an overcut.
Linearization tolerance the tolerance linearization uses to
refine the moves.
Setting dimensions for B and A tilting head
The five-axis dialog for a B and A tilting head machine is shown below.
You enter machine dimensions so that FeatureCAM can correctly
generate NC code based on the machine geometry. The fields are sets of
X, Y, and Z values.

46 Mill posts

Xbuild Reference Manual

You need to understand three axes and a face to characterise the machine:
first rotary axis
second rotary axis
spindle centreline
gauge face
These are labeled on the model of a B and A tilting head shown below:

The first rotary axis for this configuration is the B axis and it is aligned
with the Y axis.
The second rotary axis is the A axis and it is aligned with the X axis.
The first rotary axis carries the second rotary axis. In other words, when
the first rotary axis is moved, the second rotary axis moves with it. If the
second rotary axis (A) is moved, the first rotary axis (B) does not
necessarily move.
The spindle centreline is the axis that passes through the center of the
spindle. The gauge face is the gauge line or face of the spindle taper.
The three axes are orthogonal or perpendicular to each other and
are aligned with the machine axis.
We will step through each field and describe what distance each field
should contain:

Xbuild Reference Manual

Mill posts 47

The X coordinate of the Offset of gauge face from second


rotary axis is always 0. There is no X distance possible between
the gauge face and the second rotary axis centerline.
The Y coordinate of the Offset of gauge face from second
rotary axis is the distance from the second rotary axis centerline
to the centerline of the spindle. See diagram below.
The X coordinate of the Offset of second rotary axis from
first rotary axis is the distance from the first rotary axis to the
centerline of the spindle. See diagram below.
The Y coordinate of the Offset of second rotary axis from
first rotary axis is always 0. There is no y distance possible
between the first rotary axis centerline and the spindle centerline.

The Z coordinate of the Offset of gauge face from second


rotary axis is the distance from the second rotary axis centerline
to the gauge face. See diagram below.

48 Mill posts

Xbuild Reference Manual

The Z coordinate of the Offset of second rotary axis from


first rotary axis is the distance in Z from the first rotary axis to
the second rotary axis.

Formats menu
The Xbuild Formats menu enters specific program formats for the
various blocks which can appear in a part program. Each format is made
up of combinations of reserved words, literals, comments, and userdefined variables.
The Formats menu lists a number of general groups of formats:
Program - formats that are used in almost every part program,
and include commonly used formats (for example Program
Start, Tool Change , Segment Start, Program End).
Move - formats include the rapid and feed moves which make up
the largest portion of any part program (for example Rapid,
Linear, Circular). These program formats must be carefully
defined.
Macro - formats include Open Macro, Close Macro, Macro
Call, In-Macro Linear, and In-Macro Circular.
The Macro formats are not available for turn posts.
Cycle - formats include most of the canned cycles which are
found in many controls (for example Deep Hole, Tap).

Xbuild Reference Manual

Mill posts 49

Custom - a custom format is used as a place holder for a block of


code that may be used in several different formats. The system
reserved word <INCLUDE:> is placed into the appropriate section
of a format that uses the block of code from the custom format. The
name of custom format should be inserted after colon:
<INCLUDE: Custom Format Name>.
Each of these groups contains specific formats which, when selected, are
(see page 12)displayed in the Formats editor.
The formats use specific reserved words, which are discussed
separately for each post type. For example, milling reserved words
can be found under the Mill Post section, turning reserved words
can be found under the Turn Post section and so on.

Defining milling formats


For each segment of a part program, parameters and calculated values are
passed via the reserved words from the program formats. These program
formats act as a template; they are sequentially filled (that is, the reserved
words are substituted by their corresponding values, G and M codes) as
the part data file is post-processed.

Rules
General rules
The reserved words <X-COORD> and <Y-COORD> are the
assigned values of the first path point, and must appear in all
program formats to provide the first positioning move to the start
of the path.
It is mandatory that the reserved word <Z-COORD> be used for
the Segment Start program format. It is calculated as the largest
Z Rapid value of the current and previous segments, thereby
allowing for the tool to be retracted from the part to a safe plane.
Use of the <Z-COORD> reserved word is optional for the
Program Start and Tool Change program formats. It is
calculated in the following manner:
<Z-COORD> = TL CHG (Z)
TL CHG (Z) is programmed in FeatureCAM.

50 Mill posts

Xbuild Reference Manual

Whether <Z-COORD> is used or not, Post assumes that the tool is


at this Z level, after the code for any of the aforementioned formats
is generated.
Incremental programming rules
These are the rules for building post processors for controls that
only support incremental input.
Each occurrence of the following reserved words must be in the
specified form in the program formats.
Reserved word

Form

<X-CHANGE>

<@X-CHANGE>

<Y-CHANGE>

<@Y-CHANGE>

<X-COORD>

<@X-COORD>

<Y-COORD>

<@Y-COORD>

<Z-COORD>

<@Z-COORD>

The Program Start format may not contain any of the following
reserved words: <@X-CHANGE>, <@Y-CHANGE>, or <@ZCOORD>. This is assuming that the first tool has been positioned
at the start point (the first segment's tool change position) by the
operator before starting the NC part program.
The Program End format must contain the reserved words <@XCHANGE> and <@Y-CHANGE> to reposition the tool back to
the start point.

Program formats
As Post reads each segment from the part data file, it determines if it's the
first segment of the program, a tool change, or a non-tool changing
segment. Based upon this information, Post outputs the appropriate block
(that is, Program Start, Tool Change, or Segment Start) prior to
executing segment data. Only one of these three program formats is used
at the beginning of any one segment.
Each definition can include multiple lines, and each line must end
with <EOB>.

Xbuild Reference Manual

Mill posts 51

Program start
The Program Start format is called once at the beginning of each
program. This format must contain instructions for doing the following:
Setup the initial conditions of the machine such as the program
dimensions, absolute versus incremental positioning.
Perform the first tool change and position the tool at the Z rapid
plane.
Turn on the spindle, set its initial speed, and set up the coolant.
Functions such as <SPEED>, <SPINDLE> and <COOLANT> status
can be passed to the Post output with the first positioning move via <XCOORD> and <Y-COORD>.
If the target machine tool uses fixture offsets (G54, G55/E1, E2), the
reserved word <FIXTURE> should be positioned before the <MOTION>
<X COORD> and <YCOORD> words.
Tool change
A Tool Change block is output between segments that require a
tool change.
This block is only output if the Tool # specification (FeatureCAM)
differs from the previous one.
Functions such as <SPEED>, <SPINDLE> and <COOLANT>
status can be passed to the Post output with the first positioning
move via the <X-COORD> and <Y-COORD> reserved words.
If the target machine tool uses fixture offsets (G54, G55/E1, E2),
the reserved word <FIXTURE> should be positioned before the
<MOTION> <X COORD> and <YCOORD> words.
Segment start
Segment Start is only output between non-tool changing
segments. This typically occurs when there is a change in fixture
offset or spindle speed.
Segment Start should contain any commands that may change
between segments, for example <SPEED>, <COOLANT>, and so
on.
The reserved words <X-COORD>, <Y-COORD> and <ZCOORD> must be included in Segment Start.

52 Mill posts

Xbuild Reference Manual

If the target machine tool uses fixture offsets (G54, G55/E1, E2),
the reserved word <FIXTURE> should be positioned before the
<MOTION> <X COORD> and <YCOORD> words.
It is recommended that any coordinates not be output with
modality brackets, since there may be a change of coordinate
systems.
File end
File End specifies the format of the line(s) to be placed at the end of a
file. This is generally used with the End of Prog specification (selected
in the Macro Type field in the General Information dialog).

Move formats
Depending on the control, one of two cases is true for these program
formats.
If the CNC requires X, Y and Z axes motion to be programmed in
the same rapid line, then all three reserved words (X, Y and Z)
must be included in the X,Y Rapid Move program format. The Z
Rapid Move format must remain empty.
If the CNC does not allow for X, Y and Z axes motion to be
programmed in the same rapid line, then use both formats (the X,Y
Rapid Move and Z Rapid Move).
The order in which moves are generated depends upon whether the
current Z position is greater, or less than the previous Z position.
Rapid move
The Rapid Move format defines the output format for rapid positioning
moves.
Generally, modality delimiters { } are placed around the <X-COORD>
and <Y-COORD> reserved words. This allows the post processor to
'strip' X, or Y from the line when a coordinate is redundant. If the first
case is true (see two preceding cases in Move formats (see page 53)), then
the <Z-COORD> reserved word must be included.

Xbuild Reference Manual

Mill posts 53

Z rapid move
Z Rapid Move format is used to rapid to the plunge clearance plane in
Z. If the first case is true, then the Z Rapid Move format must remain
empty. If the second case is true, then the <Z-COORD> reserved word
must be included.
Linear move
The Linear Move format defines the output format for linear moves.
The following reserved words must be defined in this block:
<X-COORD>;
<Y-COORD>;
<Z-COORD>;
<FEED>;
<MOTION>.
Cutter diameter compensation can be turned ON/OFF in this format line
via the <COMP-START> reserved word.
Some CNC machines may require the use of the vector reserved words
<X-VECTOR> and <Y-VECTOR>.
Circular move
The method of specifying arc definition is defined in a Circular Move
block.
The following reserved words are provided as arc modifiers for I, K, or R
values:
<ARC-X>;
<ARC-Y>;
<RADIUS>;
<S-RAD>;
<X-CEN>;
<Z-CEN>.
Spindle
This format is not currently used.

54 Mill posts

Xbuild Reference Manual

Dwell
Format for dwell code output, that is G04U<DWELL><EOB>.
UDF text
Returns code/comment from a user-defined feature (UDF). <UDFTEXT> and <UDF-COMMENT> are reserved words that receive text
passed from the UDF.

Cycle formats
Format

Description

Drill cycle

This program format specifies the header block for a


drilling cycle.

Spot face cycle

The header block for a spot face cycle is specified


via this format.

Deep hole cycle

A deep hole cycle header block is determined with


this format.

Tap cycle

This format specifies the header block for a tapping


cycle.

Bore (F-F) cycle

The header block for a boring (feed-in, feed-out)


cycle is specified with this format.

Chip break cycle

This format specifies the header block for a chip


break cycle.

Bore (F-D-F) cycle

A boring (feed-in, dwell, feed-out) cycle header


block is specified via this format.

Bore (F-S-R) cycle A boring (feed-in, stop spindle, rapid) cycle is


specified with this format.
Bore (No Drag)
cycle

This format specifies a boring (feed-in, stop spindle,


move to side, retract) cycle.

Cycle cancel

This format specifies the cycle cancel block for any


of the canned cycles.

Canned move

This format specifies the format of canned cycles,


following their initial definition.

Xbuild Reference Manual

Mill posts 55

Macro formats
Format

Description

In-Macro Linear

This format is similar to the Linear Move format,


but it is only used within a macro definition
(without the <Z-COORD> reserved word).
In_Macro Move program formats can be set to
generate absolute, or incremental output. For
incremental output, Post does not duplicate path
data for translations. Post positions to the translated
location and 'calls' the original incremental macro.
Also refer to Incremental Programming Rules (see
page 50).

In-Macro Circular

This format is similar to the Circular Move


format, but it is only used within a macro definition
(without the <Z-COORD> reserved word).
In_Macro Move program formats can be set to
generate absolute, or incremental output. For
incremental output, Post does not duplicate path
data for translations. Post positions to the translated
location and 'calls' the original incremental macro.
Also refer to Incremental Programming Rules (see
page 50).

Open Macro

This format specifies the format of the lines


preceding the macro definition (start delimiter).
The <MACRO#> reserved word must be used. A
preparatory function code (for example,
incremental for defining incremental macros) can
also be used.

Close Macro

This format specifies the format of the lines


following a macro (end delimiter) definition. A
preparatory function code may be used to redefine
the absolute specification (that is, if the main
program starts in the absolute mode).

Macro Call

This format specifies the format of a line for


'calling' a macro. The reserved word <MACRO#>
must be used to identify the macro.

56 Mill posts

Xbuild Reference Manual

Milling numeric reserved words


Reserved word

Definition

<ABS-DEPTH>

Absolute Z axis depth from Z axis origin,


<ZSURF> <DEPTH>.

<ABS-SHIFTX>

X offset from machine zero to current setup without


any rotations applied.

<ABS-SHIFTY>

Y offset from machine zero to current setup without


any rotations applied.

<ABS-SHIFTZ>

Z offset from machine zero to current setup without


any rotations applied.

<ABS-STEP1>

Absolute first step, <ZSURF> <STEP1>.

<ABS-ZCLEAR>

Absolute position of Z Clear -- Z Clear + Z Surf


(not used in incremental programming).

<ABS-ZRAPID>

Absolute position of Z Rapid -- Z Rapid + Z Surf


(not used in incremental programming).

<ANG-CFEED>

Outputs the feed value required for an Okuma or


Fanuc control to maintain the programmed feed
rate. This is a Cartesian feed rate value.

<ANG-DPM>

Wrapped feed rate, degrees per minute.

<ANG-DPM-NOFR>

Same as <ANG-DPM> except no feed rate


reduction in corners when wrapping (for machines
which do the reduction).

<ANG-FPM>

Wrapped feed rate, inch (or mm) per minute.

<ANG-INVTIME>

Wrapped feed rate inverse time. This reserved word


is also calculated for 5-axis simultaneous.

<ARC-X>

Used in the circular interpolation block to specify


the signed X distance from the start point of the arc,
to the center of the arc along the X axis.

<ARC-Y>

Used in the circular interpolation block to specify


the signed Y distance from the start point of the arc,
to the center of the arc along the Y axis.

Xbuild Reference Manual

Mill posts 57

Reserved word

Definition

<ARC-Z>

Used in the circular interpolation block to specify


the signed Z distance from the start point of the arc,
to the center of the arc along the Z axis.

<BOT-LALLOW>

Corresponds to Bottom Semi Finish


Allowance or Bottom Semi Finish Allowance
attributes for a milling operation.

<COMP-NUM>

Compensation number passed from FeatureCAM.

<COMP-VAL>

Cutter compensation diameter.

<DEPTH>

Z depth value passed from FeatureCAM for


drilling-type cycles.

<DWELL>

Reproduces the dwell value passed from


FeatureCAM.

<EXP-LENGTH>

Corresponds to the Exposed length tool


parameter.

<FEED>

Feed rate value identifier passed from


FeatureCAM.

<FINI-ALLOW>

Finish allowance of a milling operation.

<FIXTURE>

Fixture ID number passed from FeatureCAM.

<FSHIFTX>

The X distance from the fixture offset to the local


coordinate system.

<FSHIFTX>

The Y distance from the fixture offset to the local


coordinate system.

<FSHIFTX>

The Z distance from the fixture offset to the local


coordinate system.

<HELIX-PITCH>

Pitch of helical move. Controlled by Max Ramp


Angle attribute.

<HLDR-LENGTH>

Length of the tool holder.

<INC-DEPTH>

Incremental depth from Z Clear, <DEPTH> +


<ZCLEAR>.

<INC-MACX>

X location of the pattern instance that will be cut by


the macro. Typically, this coordinate is not output
in the CNC program.

58 Mill posts

Xbuild Reference Manual

Reserved word

Definition

<INC-MACY>

Y location of the pattern instance that will be cut by


the macro. Typically, this coordinate is not output
in the CNC program.

<INC-MACZ>

Z location of the pattern instance that will be cut by


the macro. Typically, this coordinate is not output
in the CNC program.

<INC-STEP1>

Incremental first step, <STEP1> + <ZCLEAR>.

<MACRO#>

Macro number identifier (system-generated).


Macros are not user definable, however, some
Macros are generated automatically, especially with
multiple fixture parts and for repeated features. This
number starts at 00 and increments automatically
up to the Max Macros number that is contained on
the General Information dialog.

<MIN-STEP>

The Minimum Peck drilling parameter.

<NO-DRAG-X>

Amount to move over in X for no drag boring.

<NO-DRAG-Y>

Amount to move over in Y for no drag boring.

<NEXT-TL>

Represents the next tool to be used (may be


required by some controls).

<NOSE-RAD>

Tool nose radius of an endmill or the tip radius of a


threading tool or turning tool.

<OFFSET#>

Diameter offset register number passed from the


Tool Mapping dialog.

<OV-LENGTH>

The overall length of the tool. Corresponds to the


Overall Length parameter of a tool.

<PITCH>

The pitch value for the Tap cycle. This value is in


Z-distance per spindle revolution.

<RADIUS>

Reproduces arc radius in a circular block.

<ROT1-ANSI>

Rotation about primary axis in ANSI style.

<ROT1-ANSI-R>

Reverse of the rotation values for the primary axis


in ANSI style.

<ROT1-MATH>

Rotation about primary axis in Mathematical style.

<ROT1-MATH-R>

Reverse of the rotation values for the primary axis


in Mathematical style.

Xbuild Reference Manual

Mill posts 59

Reserved word

Definition

<ROT1-WIND>

Rotation about primary axis in Winding style.

<ROT2-ANSI-R>

Reverse of the rotation values for the secondary


axis in ANSI style.

<ROT2-ANSI>

Rotation about secondary axis in ANSI style.

<ROT2-MATH>

Rotation about secondary axis in Mathematical


style.

<ROT2-MATH-R>

Reverse of the rotation values for the secondary


axis in Mathematical style.

<ROT2-WIND>

Rotation about secondary axis in Winding style.

<S-RAD>

Generates the signed arc radius value in a circular


block, +R<180 degrees and R>180 degrees.

<SEQ>

This is a line sequence number identifier (when the


word appears in a line, it is substituted with the
current sequence number, and is subsequently
incremented by the sequence step value).

<SHIFTX>

X offset from machine zero to current setup after


axis rotations are applied.

<SHIFTY>

Y offset from machine zero to current setup after


axis rotations are applied.

<SHIFTZ>

Z offset from machine zero to current setup after


axis rotations are applied.

<SIDE-LALLOW>

Side leave allowance. Corresponds to Bottom


Leave Allowance or Finish Allowance
attributes for a milling operation.

<SPEED>

Spindle speed value passed from FeatureCAM.

<STATR-ANG>

Initial angle of helical move. Added for Heidenhain


control.

<STEP1>

First Peck value passed from FeatureCAM.

<STEP2>

Second Peck value passed from FeatureCAM.

<STEPOVER>

Step over distance passed from Feature


Properties dialog.

<STOCK-ID>

Inner diameter of the stock - for round (tube) stock


only - 0 for other types of stock.

60 Mill posts

Xbuild Reference Manual

Reserved word

Definition

<STOCK-OD>

Outer diameter of the stock - for round stock only 0 for other types of stock.

<STOCK-TYPE>

Type of stock: 1.0 for block, 2.0 for round, 3.0 for
N-sided, 4.0 for user-defined.

<STOCK-XMAX>

Bounding box - maximum X value, or X coordinate


of the upper most corner of the bounding box for
the stock in space.

<STOCK-XMIN>

Bounding box - minimum X value, or X coordinate


of the lower most corner of the bounding box for
the stock in space.

<STOCK-YMAX>

Bounding box - maximum Y value, or Y coordinate


of the upper most corner of the bounding box for
the stock in space.

<STOCK-YMIN>

Bounding box - minimum Y value, or Y coordinate


of the lower most corner of the bounding box for
the stock in space.

<STOCK-ZMAX>

Bounding box - maximum Z value, or Z coordinate


of the upper most corner of the bounding box for
the stock in space.

<STOCK-ZMIN>

Bounding box - minimum Z value, or Z coordinate


of the lower most corner of the bounding box for
the stock in space.

<TOOL>

Tool number passed from FeatureCAM.

<TOOL-DIAM>

Tool diameter, passed from FeatureCAM.

<TOOL_LENGTH>

Cutter length of the tool.

<TOOL-LENGTH>

Corresponds to cutter length of endmills or length


of drills.

<TOTAL-ANG>

Total angle of a helical move. Added for


Heidenhain.

<TPI-PITCH>

The TPI value for the Tap cycle in an inch CNC file
or the pitch value for the Tap cycle in a millimeter
CNC file.

<UCS-X>

Absolute position in X of the Part Setup in relation


to the Stock Axis.

Xbuild Reference Manual

Mill posts 61

Reserved word

Definition

<UCS-Y>

Absolute position in Y of the Part Setup in relation


to the Stock Axis.

<UCS-Z>

Absolute position in Z of the Part Setup in relation


to the Stock Axis.

<X-CEN>

Reproduces the absolute X coordinate position from


the X axis origin to the arc's center in a circular
block.

<X-CHANGE>

X coordinate of desired tool change location passed


from post options dialog.

<X-COORD>

Current X coordinate position.

<X-SURFNORM>

For 5 axis simultaneous, X component of surface


normal vector.

<X-TOOLVEC>

For 5 axis simultaneous, X component of tool


vector.

<X-VECTOR>

Calculated X vector for the next move (cutter


compensation vector for Cincinnati Milacron).

<Y-CEN>

Reproduces the absolute Y coordinate position from


the Y axis origin to the arc's center in a circular
block.

<Y-CHANGE>

Y coordinate of desired tool change location passed


from the Post Options dialog.

<Y-COORD>

Current Y coordinate position.

<Y-SURFNORM>

For 5 axis simultaneous, Y component of surface


normal vector.

<Y-TOOLVEC>

For 5 axis simultaneous, Y component of tool


vector.

<Y-VECTOR>

Calculated Y vector for the next move (cutter


compensation vector for Cincinnati Milacron).

<ZCEN>

Reproduces the absolute Z coordinate position from


the Z axis origin to the arc's center in a circular
block.

<Z-CHANGE>

Z coordinate of desired tool change location passed


from the Post Options dialog.

62 Mill posts

Xbuild Reference Manual

Reserved word

Definition

<ZCLEAR>

Z coordinate that programmed feed rate begins.


This is the Plunge Clearance attribute passed
from Hole Properties dialog.

<Z-COORD>

Current Z coordinate position.

<Z-INC>

Rough pass Z increment attribute passed from the


Feature Properties dialog.

<Z-INDEX-CLR>

The Z retract distance when indexing 4th axis.

<ZRAPID>

Z distance from surface of stock that tool rapids to.


This distance is the Z rapid plane attribute plus the
absolute distance from the UCS to the surface of
the stock.

<ZSURF>

Z coordinate of stock surface relative to UCS


origin.

<Z-SURFNORM>

For 5 axis simultaneous, Z component of surface


normal vector.

<Z-TOOLVEC>

For 5 axis simultaneous, Z component of tool


vector.

Milling logical reserved words


Reserved word

Definition

<4-AXIS-OPER>

True if operation is 4 axis simultaneous.

<5-AXIS-OPER>

True if operation is 5 axis simultaneous.

<CHIP-TAP>

True if tap cycle is CHIP.

<COMP-3D-ON>

True if 3D cutter comp is active.

<COMP-END>

True if the move represents the end section for


compensation (last element, or move of path),
otherwise <COMP-END> is false.

<COMP-ON>

True if cutter diameter compensation is ON,


otherwise <COMP-ON> is false.

Xbuild Reference Manual

Mill posts 63

Reserved word

Definition

<COMP-MID>

True if the move represents the middle section for


compensation (between the first and last moves of
path), otherwise <COMP-MID> is false.

<COMP-START>

True if the move represents the start section for


compensation (first element, or move of path),
otherwise <COMP-START> is false.

<CW-SPINDLE>

True if the spindle rotates in the clockwise


direction, otherwise <CW-SPINDLE> is false.

<CYCLE-DONE>

True for the last hole location in a canned cycle.


False otherwise.

<CYCLE-MACRO>

True if the current segment is in a canned cycle.

<DEEP-TAP>

True of tap cycle is DEEP.

<DRILL-CPTED>

True if drill moves are computed using linear


moves. False if canned cycles.

<DRILLING>

True if a drilling-type cycle is used in a segment,


otherwise <DRILLING> is false, and a milling
segment is in process.

<FLOAT-TAP>

True if tap cycle is FLOATING.

<INDEX>

True if 4th or 5th axis indexing is set in


FeatureCAM. For the Segment Start formats
<INDEX> is only true when the indexing move is
actually being performed.

<INDEXING>

True if the user has turned on indexing for X,Y,or Z


axis.

<IS-INC-MACRO>

True if incremental macros are enabled in the


Feature Properties/Strategy dialog.

<IS-MULTIPLEFIXTURE>

True if document is multiple fixture.

<IS-SYNCED>

True if the user has set a sync point at the start of


the operation.

<IS-WORLD>

True if the current setup is named WORLD.

<IS-ZINDXCLR>

Rapid move before segment start is being called as


a result of a retract to the zindex clearance.

64 Mill posts

Xbuild Reference Manual

Reserved word

Definition

<LAST-TOOL>

True if the current tool is the very last tool in the


program.

<OFFSET-CH>

Normally used in a Segment Start block; true if


the OFFSET# is changed between segments:
<IF><OFFSET-CH><THEN>
{N<SEQ>}T{<COMP-NUM>}<TOOL>
<OFFSET#><EOB>
<ENDIF>

<RIGID-TAP>

True of tap cycle is RIGID.

<USE-FIXTURE>

True if using 5th axis positioning with Fixture Ids.

<USE-ROTFEED>

True if the linear move format should use DPM


feed rate instead of linear feed rate. Replaces test of
<IF><WRAP>. Set for wrapped, 4axis simul, and 5
axis simul operations. True only if there is an
angular rotation for this move.

<WAS-WORLD>

True if the previous setup is named WORLD.

<WRAP>

True if 4th axis wrapping is set.

<WRAP-Z-DOWN>

True if wrapping and the tool is moving down in


the Z direction.

<WRAP-Z-UP>

True if wrapping and the tool is moving up in the Z


direction.

<X-WRAP>

True if the current milling operation is wrapping in


the X direction.

<XY-PLANE>

True if the current arc is in the XY plane.

<Y-WRAP>

True if the current milling operation is wrapping in


the Y direction.

<YZ-PLANE>

True if the current arc is in the YZ plane.

<Z-CHANGED>

True if current move changes Z from the previous


location.

<Z-DOWN>

True if the tool moves down in the Z direction,


otherwise <Z-DOWN> is false.

<ZX-PLANE>

True if the current arc is in the ZX plane.

Xbuild Reference Manual

Mill posts 65

Reserved word

Definition

<Z-UP>

True if the tool moves up in the Z direction,


otherwise <Z-UP> is false.

Milling string reserved words


Reserved word

Definition

<BOL>

Beginning of line identifier. Used to indent line in


NC code output. Indents line by spacing amount
between <BOL> and rest of line.

<COMP-STAT>

Returns the appropriate code from the CNC-Info NC Codes dialog for cutter diameter
compensation.

<COOLANT>

Returns the proper coolant code from the CNCInfo - NC Codes dialog.

<COOLANT-3>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<COOLANT-4>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<COOLANT-MST>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<COOLANT-OFF>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<COOLANT-ON>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<CYCLE>

Returns the appropriate drill cycle code from the


CNC-Info - NC Codes dialog.

<CYCLE-RTRCT>

Returns the appropriate retract code for canned


drilling cycles from the CNC-Info - NC Codes
dialog.

<DATE>

Returns the date that NC code was posted.

<EOB>

Specifies the end of block code on each line of a


format.

66 Mill posts

Xbuild Reference Manual

Reserved word

Definition

<FIXTURE>

Returns the current fixture offset code from the


CNC-info - Fixture ID dialog.

<FM-NAME>

Returns the FeatureCAM file name.

<HOLDER-NAME>

Returns the tool holder name from the


Manufacturing - Spindles and Toolholders
dialogs in FeatureCAM.

<MACH-TIME>

Returns the estimated time required to machine


part.

<MCSID>

Returns the current setup name. Name can be


changed in part view and in setups.

<MOTION>

Returns the appropriate motion code for the current


move from the CNC-Info - NC Codes dialog.

<OP-PASS>

Returns Rough or Finish base on the type of pass.

<OP-TYPE>

Returns the current operation type name.

<P1>

Post variable number one. Returns user defined


string placed in the Post Vars in the Feature
Properties dialog in FeatureCAM. Variables up to
<P100> may be defined.

<PGM-STOP>

Returns string from Xbuild Spindles dialog. Used


to stop program to flip part in chuck or vise to
machine other setups.

<PLANE>

Returns the appropriate code for an active plane


from the CNC-Info - NC Codes dialog.

<PROG-NAME>

Returns the part name from the setup definition


from FeatureCAM Setups dialog
(Manufacturing - Tool Manager).

<REGION-DATE>

Returns the date in the regional format (for


example, British DD/MM/YY instead of
MM/DD/YY) specified in Windows.

<SEG-CMT>

Returns a user input comment from post variables


from a particular feature.

<SEGM-ID>

Returns the name of the current feature from the


part view in FeatureCAM.

Xbuild Reference Manual

Mill posts 67

Reserved word

Definition

<SPINDLE>

Returns the appropriate code for spindle rotation


direction from the CNC-Info - NC Codes dialog.

<TIME>

Returns the time when the NC code was posted.

<TOOL-CMT>

Returns the user input comment from the Tool


Properties - Overrides dialog (Manufacturing
- Tool Manager - Current - Tools-PropertiesOverrides - Comment).

<TOOL-ID>

Returns the tool ID from the FeatureCAM


Manufacturing - Tool Mapping dialog.

<TOOL-NAME>

Returns the name of the current tool from the


FeatureCAM Manufacturing - Tool Mapping
dialog.

<UDF-COMMENT>

Used in the UDF Text format to return a comment


from an add-in macro, which creates a user-defined
feature.

<UDF-TEXT>

Used in the UDF Text format to return a specific


code from an add-in macro, which creates a userdefined feature.

<UNITS>

Returns the proper unit code from the CNC-Info NC Codes dialog.

Hole canned cycles in Xbuild


For milling posts, hole drilling canned cycles are used based on the
existence of the cycles G-codes. If FeatureCAM requests a canned cycle
for a particular cycle, and the G-code is undefined, an alternate cycle is
searched for. If the alternate also does not exist, then a computed cycle is
used.
The table below lists the alternate canned cycles. For example, if
FeatureCAM is trying to output a drill canned cycle, but there is no drill
canned cycle defined in the post, it looks to see if a spotface (its
alternative cycle) exists. If it does, a spotface cycle is used. If a spotface
cycle is not defined, then a computed drilling cycle is output.

68 Mill posts

Xbuild Reference Manual

Desired cycle

Alternate cycle

Drill

Spotface

Spotface

Drill

Deep hole

Chip break

Tap

No alternate

Chip break

Deep hole

Bore FDF

Bore FF

Bore FF

Bore FDF

Bore FSR

Bore FF

Bore No-drag

Bore FF

If you do not want to output any drilling canned cycles, just blank out all
the cycles in the NC Codes dialog of Xbuild.
For turn or turn/mill posts, the variable Enable hole canned
cycle in the Post Options dialog controls the outputting of
canned cycles.
For computed cycles to work correctly, the Spindle and Dwell
formats and the Spindle codes in Xbuild have to be completed.
The <SPINDLE> reserved word also needs to be added to the
Linear format.
Example Spindle format:
{N<SEQ>}<SPINDLE><EOB>
Example Dwell format:
{N<SEQ>}G4 <DWELL><EOB>
Example Linear format:
{N<SEQ>}{<MOTION>}{<COMP-STAT>}
{X<X-COORD>}{Y<Y-COORD>}{Z<Z-COORD>}
{F<FEED>}{<SPINDLE>}<EOB>
Also refer to Include first canned cycle move in macro (see page 29).

Xbuild Reference Manual

Mill posts 69

Relationship between FeatureCAM and


Xbuild
This section explains how the parameters that are defined in FeatureCAM
correspond to Xbuild reserved words, and how these are handled when
NC is pressed.

Input dimension
If the units of your part and the post processor are different, a conversion
factor is automatically applied to them at the time the program is posted.

Cycle types
The operations in FeatureCAM are mapped to the following canned cycle
formats:
Operation

Canned cycle format

Chamfer

Spot Face

Countersink

Spot Face

Counterbore

Spot Face

Drill

Drill

Ream

Bore(F-F)

Tap

Tap

Peck Drilling

Deep Hole and Chip Break

The following FeatureCAM parameters contain corresponding reserved


words in Xbuild:

70 Mill posts

FeatureCAM
parameter

Xbuild reserved
word

Type

Tool No.(from
Operations sheet)

<TOOL>

Numeric

Fixture ID

<FIXTURE>

Numeric

Xbuild Reference Manual

FeatureCAM
parameter

Xbuild reserved
word

Type

Tool Change Location


X (from Post
Options dialog)

<X-CHANGE>

Numeric

Tool Change Location


Y (from Post
Options dialog)

<Y-CHANGE>

Numeric

Tool Change Location


Z (from Post Options
dialog)

<Z-COORD>

Numeric

Coolant Manufacturing
Attribute (Default
Attribute or Feature
Attribute)

<COOLANT>

String

Some CNC machines require the previous Tool # and Fixture #.


In this case, use the $ symbol to represent the previous number.
Tool parameter lines are formatted in the Program Start, Tool
Change and Program End program formats.
Coolant parameters (Off, Mist and Flood) are defined in Xbuild, and are
output by Post whenever the reserved word <COOLANT> appears in a
program format block.

Z data
Xbuild has a reserved word for each Z parameter in FeatureCAM. Xbuild
also provides words that signal Post to perform arithmetic operations to
accommodate the different ways that machines handle the Z axis.
The following manufacturing attributes in FeatureCAM contain
corresponding reserved words in Xbuild:
FeatureCAM attribute

Xbuild reserved
word

Type

Z Rapid Plane

<ZRAPID>

Numeric

Plunge Clearance

<ZCLEAR>

Numeric

Xbuild Reference Manual

Mill posts 71

Handling cutter compensation


Cutter compensation is handled by Xbuild, and can be configured several
ways, depending upon the CNC requirements.
Case 1
The most common configuration is to turn compensation On in the first
X-Y feed move of the cutter path, and turn compensation Off in the last
X-Y feed move. If the aforementioned configuration is utilized, then
define the Linear Move program format as follows:
{N<SEQ>}{<COMP-STAT>}{<MOTION>}
{X<X-COORD>}{Y<Y-COORD>}
{Z<Z-COORD>}{F<FEED>}<EOB>
If it is necessary to output the vector direction of the next move (for
Cincinnati Milacron controls only), use the <X-VECTOR> and
<Y-VECTOR> reserved words.
Case 2
Other configurations may require the X and Y coordinates to be repeated
as compensation is turned On. In that case, establish a conditional
statement so that these repeated coordinates do not appear in every
linear move of the cutter path. A conditional statement for a Linear
Move program format is as follows:
<IF><COMP-ON><THEN>
{N<SEQ>}<COMP-STAT>X<$X-COORD>
Y<$Y-COORD><EOB>
<ENDIF>
{N<SEQ>}{<COMP-STAT>}{<MOTION>}
{X<X-COORD>}{Y<Y-COORD>}
{Z<Z-COORD>}{F<FEED>}<EOB>
The $ symbol is a reserved words' modifier to generate the previous
values of X and Y (to represent the current position of the tool). The <XCOORD> and <Y-COORD> reserved words always represent the next
point in the cutter path.

72 Mill posts

Xbuild Reference Manual

Handling multiple fixture documents


To use the multiple fixture document capability of FeatureCAM, either
the reserved word <FIXTURE> or the reserved word <MCSID> must be
placed in the Program Start, Tool Change and Segment Start
program formats prior to any <MOTION> statements. Your choice of
<FIXTURE> or <MCSID> depends on your programming preference
and the type of controller being used. Generally, one or the other reserved
word is used, not both.
When the reserved word <FIXTURE> is used, it is preceded by the
controller's fixture offset letter (for example 'D', 'E', 'F', 'G' or 'H') in the
appropriate program formats.
The reserved word <FIXTURE> is obtained from the Fixture ID of
the setup in FeatureCAM.
For example, the following build line is the last line of the Program
Start format of the 850sxm.cnc post:
{N<SEQ>}G0X<X-COORD>Y<Y-COORD>
Z<ABS-ZRAPID><COOLANT><EOB>
Adding an H command using the <FIXTURE> reserved word prior to the
motion command would look like this:
{N<SEQ>}H<FIXTURE>G0X<X-COORD>Y
<Y-COORD>Z<ABS-ZRAPID><COOLANT><EOB>
A similar modification to the Tool Change and Segment Start
program formats would complete the necessary changes to the post.
When using the reserved word <MCSID>, recall that this word is the
name of the setup in FeatureCAM. This reserved word has more
flexibility than the <FIXTURE> reserved word since it is a string. The
only requirement is that the setup name in FeatureCAM uses the
appropriate G-code command for your post. The placement of the
<MCSID> reserved word in the block is identical to that of the
<FIXTURE> reserved word, only it does not need a preceding command
letter. Using the above example, the modification would be:
{N<SEQ>}<MCSID>G0X<X-COORD>Y
<Y-COORD>Z<ABS-ZRAPID><COOLANT><EOB>
The setup name in this particular example must be of the form Hx where
x is a number.

Xbuild Reference Manual

Mill posts 73

In controllers that accept specific commands to indicate particular


fixture offsets, such as 'G54', or 'G55', using the <MCSID>
reserved word may lessen confusion during the design process.
By placing the reserved word <FIXTURE> or <MCSID> in the
Program Start, Tool Change, and Segment Start program formats,
the fixture offset is called immediately prior to any motion commands.
When a fixture offset is changed, it is recommended that the
<FIXTURE> or <MCSID> reserved word not be surrounded by
modal brackets such that the fixture offset is repeated at each Tool
Change or Segment Start line. This allows the Tool Change
and Segment Start lines (under appropriate conditions) to used
as a possible restart line.

74 Mill posts

Xbuild Reference Manual

Handling pecking
Pecking applies to Deep Hole, Chip Break and Tap operations.
To handle pecking in a CNC file:
1. Set the type of pecking that will be used for drilling and tapping on
the NC Codes page. FeatureCAM checks the pecking type in the
currently loaded post processor to duplicate canned cycles when
simulating toolpaths.
2. Create the appropriate program formats for the canned cycles based
on the pecking type:
fixed steps
The NC code specifies one depth and all the steps peck at that
depth. An example would be the deep hole cycle of the Fanuc 0m:
{N<SEQ>}<CYCLE>{X<X-COORD>}
{Y<Y-COORD>}R<ABS-ZCLEAR>Z
<ABS-DEPTH>Q<STEP1>F<FEED><EOB>
two steps
The NC code specifies two depths. The first step pecks at the first
depth and all the subsequent steps peck at the second depth. The
Bridgeport Machines Boss9I control deep hole cycle is an example
.{N<SEQ>}<CYCLE>Z<INC-DEPTH>
Z<INC-STEP1>Z<STEP2>F<FEED><EOB>
{N<SEQ>X<X-COORD><EOB>
value reduction

Xbuild Reference Manual

Mill posts 75

The NC code specifies the first depth, a reducing value and a


minimum depth. The first step pecks at the first depth. Each
subsequent step is reduced by the reducing value until the
minimum depth is reached. To use the FeatureCAM attributes
consistently with the other pecking methods, it is recommended
that the reducing value be calculated with the expression
[<STEP1>-<STEP2>] as shown in the deep hole drilling cycle
for the Fadal control below:
{N<SEQ>}<CYCLE>{X<X-COORD>}
{Y<Y-COORD>}R<ABS-ZCLEAR>Z
<ABS-DEPTH>I<INC-STEP>
J<[<STEP1>-<STEP2>]K<
MIN-STEP>F<FEED><EOB>
factor reduction
The NC code specifies the first depth, a reducing factor and a
minimum depth. The first step pecks at the first depth. Each
subsequent step is reduced by the reducing factor until the
minimum depth is reached. To use the FeatureCAM attributes
consistently with the other pecking methods, it is recommended
that the reducing value be calculated with the expression
[<STEP2>/<STEP1>] as shown in the deep hole drilling cycle
for the GE2000 control below:
{N<SEQ>}<CYCLE>Z<ABS-DEPTH>
R<ABS-ZCLEAR>D<TOOL>F<FEED> P1=<INC-STEP1>
P2=[<STEP2>/<STEP1>]P5=<MIN-STEP>F<FEED><EOB>
{N<SEQ>} X<X-COORD>Y
<Y-COORD><EOB>

Handling 3D arcs
3-axis techniques that produce toolpaths in the principle planes can
approximate them with 3D lines and arcs.

76 Mill posts

Xbuild Reference Manual

To activate this option, select the Arc/line approx milling attribute on


the Milling tab of the Surface Milling Properties dialog for a surface
milling feature in FeatureCAM.
To output the proper G-codes, the Post must support 3D arcs. The proper
G-codes for each circular plane must be entered in the NC Codes dialog
in Xbuild. These G-codes are stored in the <PLANE> reserved word.
The Circular Move format must also be augmented to support arcs in
each plane. The logical reserved words <XY-PLANE>, <ZX-PLANE>,
and <YZ_PLANE> distinguish the plane of the current arc.
The following is an example of the Circular Move format for 3D arcs.
The major purpose of the various cases is to output the correct arc
centers.
{N<SEQ>}{<PLANE>}<MOTION>
<IF><XY-PLANE><THEN>
X<X-COORD>Y<Y-COORD>{Z<Z-COORD>}
I<X-CEN>J<Y-CEN>
<ENDIF>
<IF><ZX-PLANE><THEN>
Z<Z-COORD>X<X-COORD>{Y<Y-COORD>}
K<Z-CEN>I<X-CEN>
<ENDIF>
<IF><YZ-PLANE><THEN>
Y<Y-COORD>Z<Z-COORD>{X<X-COORD>}
J<Y-CEN>K<Z-CEN>
<ENDIF>
{F<FEED>}<EOB>

Handling retract planes in canned cycles


If the control allows the changing of retract planes during a canned cycle
you must adjust the post with the following steps:
1. In Xbuild, select CNC Info - NC Codes, and enter the G-codes
for each rapid plane under Z rapid retract (this is the higher
plane, G98 on a Fanuc) and R plane retract (this is the lower
plane, G99 on a Fanuc).
2. In the Canned Move and all the Drilling Canned cycles, the
reserved word <CYCLE-RTRCT> must be included.

Xbuild Reference Manual

Mill posts 77

For example, for Fanuc, the G98 and G99 G-codes are entered in the NC
Codes dialog, and a sample drilling cycle would be:
{N<SEQ> }<CYCLE> <CYCLE-RTRCT> Z
<ABS-DEPTH> R <ABS-ZCLEAR> F <FEED><EOB>
{N<SEQ> }{X<X-COORD>}{ Y<Y-COORD>}<EOB>

Fanuc line numbering


Many Fanuc control users do not want line numbers, except they want to
sequentially number the tool changes.
This is accomplished with the following steps:
1. Either remove all the occurrence of N<SEQ> in the post, or make
sure that all occurrences are modal and set the Block Increment
in FeatureCAM to 0.
2. Use the following line as the tool change in the Start format. This
line sets a variable, tc, to 1 and outputs it in the format for
<SEQ>:
N[<SEQ>:tc=1] T<TOOL> M6 ( TOOL <TOOL>
[uppercase(<TOOL-NAME>)] )<EOB>
3. Use the following line as the tool change in the Tool Change
format:
N[<SEQ>:tc=tc+1] T<TOOL> M6 ( TOOL <TOOL>
[uppercase(<TOOL-NAME>)] )<EOB>

Handling milling macros


Macros are activated in FeatureCAM by creating a pattern of features,
and then selecting Use macro calls for each instance in the pattern
check box on the Pattern Strategy tab.
A Post that supports milling macros must have the Post supports
local coordinate or the Post supports incremental macros
check boxes selected in the General Information dialog.
Setting up a post processor to handle milling macros is not a matter of
specifying a single format, rather this logic affects many program
formats.

78 Mill posts

Xbuild Reference Manual

Expected G-code for different post settings


The type of macro code that is created by a specific post processor
depends on whether the post processor supports incremental
programming, local coordinate systems or both.
Incremental

Local coordinate File type

No

No

Xbuild Reference Manual

Code created

.fm

Pattern instances
are cut with
absolute
coordinates
relative to the
current setup.

.mf with
multiple
fixture

Each FM part is
cut with absolute
coordinates
relative to the
global fixture.
Pattern instances
in each FM part
are cut with
absolute
coordinates
relative to the
global fixture.

.mf with
global fixture

Each FM part is
cut with absolute
coordinates
relative to its local
fixture (G54).
Pattern instances
in each FM part
are cut with
absolute
coordinates
relative to the
part's local fixture
(G54).

Mill posts 79

Incremental

Local coordinate File type

Yes

No

80 Mill posts

Code created

.fm

Each pattern
instance calls a
macro with
incremental
coordinates
relative to the
pattern instance
location.

.mf with
multiple
fixture

Each FM part is
cut with absolute
coordinates
relative to the
global fixture.
Pattern instances
in each FM part
are cut with
incremental
coordinates
relative to the
pattern instance
location based on
the global fixture.

.mf with
global fixture

Each FM part is
cut with absolute
coordinates
relative to its local
fixture (G54).
Pattern instances
in each FM part
are cut with
incremental
coordinates
relative to the
pattern instance
location based on
the part's local
fixture (G54).

Xbuild Reference Manual

Incremental

Local coordinate File type

No

Yes

Xbuild Reference Manual

Code created

.fm

A local coordinate
system is
established for
each pattern
instance. A macro
is called with
absolute
coordinates
relative to the
pattern instance
location.

.mf with
multiple
fixture

A local coordinate
system is
established for
each FM part. A
local coordinate
system is
established for
each pattern
instance. A macro
is called with
absolute
coordinates
relative to the
pattern instance
location which is
based on the
global fixture.

Mill posts 81

Incremental

Yes

82 Mill posts

Local coordinate File type

Yes

Code created

.mf with
global fixture

Each FM part is
cut with absolute
coordinates
relative to its local
fixture (G54). A
local coordinate
system is
established for
each pattern
instance. A macro
is called with
absolute
coordinates
relative to the
pattern instance
location which is
based on the local
fixture (G54).

.fm

Local coordinates
are not used.

.mf with
multiple
fixture

A local coordinate
system is
established for
each FM part.
pattern instances in
each FM part are
cut with
incremental
coordinates
relative to the
pattern instance
location based on
the part's local
coordinate system.

.mf with
global fixture

Local coordinates
are not used.

Xbuild Reference Manual

Configuring post for local coordinate systems


Examples of local coordinate systems include the Fanuc G92 G-code,
Heidenhain's datum shift and G58 on the Siemen's control. The following
examples illustrate how to implement local coordinate systems for the
Fanuc 18 control.
Program start format
%
:<PROG-NAME><EOB>
{N<SEQ>}G90<EOB>
{N<SEQ>}T<TOOL>M6<EOB>
<IFNOT>[ and( and( eq(<FSHIFTX>,0), eq(<FSHIFTY>,0)),
eq(<FSHIFTZ>,0))]
<THEN>
[# ]{N<SEQ>}<MOTION>G<FIXTURE>X<FSHIFTX>Y<FSHIFTY>
Z[<FSHIFTZ>+<ABS-ZRAPID>]<EOB>
[# ]{N<SEQ>}G92 X0 Y0 Z<ABS-ZRAPID><EOB>
[# ]{N<SEQ>}<MOTION>X<X-COORD>Y
<Y-COORD>S<SPEED><SPINDLE><EOB>
<ENDIF>
<IF>[ and( and( eq(<FSHIFTX>,0), eq(<FSHIFTY>,0)),
eq(<FSHIFTZ>,0))]
<THEN>[# ]{N<SEQ>}<MOTION>G<FIXTURE>X<X-COORD>
Y<Y-COORD>S<SPEED><SPINDLE><EOB>
<ENDIF>
{N<SEQ>}G43H<TOOL>Z<Z-COORD>T<NEXT-TL><EOB>
{N<SEQ>}<COOLANT><EOB>
Tool change format
{N<SEQ>}M09<EOB>
{N<SEQ>}G91G30Z0.M19<EOB>
{N<SEQ>}M06<EOB>
[#]
[# if fixture change, reset G92 to current fixture home before changing to
new fixture]

Xbuild Reference Manual

Mill posts 83

<IFNOT>[ eq(<$FIXTURE>,<FIXTURE>)]<THEN>
[#]{N<SEQ>}<MOTION>X-<$FSHIFTX>Y-<$FSHIFTY>Z[<$FSHIFTZ>+<ABS-ZRAPID>]<EOB>
[#]{N<SEQ>}G92 X0 Y0 Z<ABS-ZRAPID><EOB>
[#]<IFNOT>[ and( and( eq(<FSHIFTX>,0), eq(<FSHIFTY>,0)),
eq(<FSHIFTZ>,0))]
<THEN>
[#]{N<SEQ>}<MOTION>G<FIXTURE>X<FSHIFTX>Y<FSHIFTY>Z
[<FSHIFTZ>+
<ABS-ZRAPID>]<EOB>
[#]{N<SEQ>}G92 X0 Y0 Z<ABS-ZRAPID><EOB>
[#]<ENDIF>
<ENDIF>
[#]
[# if same fixture, set new G92 location]
<IF>[ eq(<$FIXTURE>,<FIXTURE>)]<THEN>
[# ]<IFNOT>[ and( and( eq(<@FSHIFTX>,0), eq(<@FSHIFTY>,0)),
eq(<@FSHIFTZ>,0))]<THEN>
[#]{N<SEQ>}<MOTION>G<FIXTURE>X<@FSHIFTX>Y<@FSHIFT
Y>
Z[<@FSHIFTZ>+<ABS-ZRAPID>]<EOB>
[#]{N<SEQ>}G92 X0 Y0 Z<ABS-ZRAPID><EOB>
[#]<ENDIF>
<ENDIF>
{N<SEQ>}<MOTION>G<FIXTURE>G90X<X-COORD>Y
<Y-COORD>S<SPEED><SPINDLE><EOB>
{N<SEQ>}G43H<TOOL>Z<Z-COORD>T<NEXT-TL><EOB>
{N<SEQ>}<COOLANT><EOB>
Segment start format
{N<SEQ>}{<MOTION>}Z<Z-COORD><EOB>
[#]
[# if fixture change, reset G92 to current fixture home before changing to
new fixture]
<IFNOT>[ eq(<$FIXTURE>,<FIXTURE>)]<THEN>

84 Mill posts

Xbuild Reference Manual

[#]{N<SEQ>}<MOTION>X-<$FSHIFTX>Y-<$FSHIFTY>Z[<$FSHIFTZ>+<ABS-ZRAPID>]<EOB>
[#]{N<SEQ>}G92 X0 Y0 Z<ABS-ZRAPID><EOB>
[#]<IFNOT>[ and( and( eq(<FSHIFTX>,0), eq(<FSHIFTY>,0)),
eq(<FSHIFTZ>,0))]<THEN>
[#]{N<SEQ>}<MOTION>G<FIXTURE>X<FSHIFTX>Y<FSHIFTY>Z
[<FSHIFTZ>+<ABS-ZRAPID>]<EOB>
[#]{N<SEQ>}G92 X0 Y0 Z<ABS-ZRAPID><EOB>
[#]<ENDIF>
[#]{N<SEQ>}{<MOTION>}G<FIXTURE>X<X-COORD>Y
<Y-COORD>{S<SPEED>}{<COOLANT>}<EOB>
<ENDIF>
[#]
[# if same fixture, set new G92 location]
<IF>[ eq(<$FIXTURE>,<FIXTURE>)]<THEN>
[#]<IFNOT>[ and( and( eq(<@FSHIFTX>,0), eq(<@FSHIFTY>,0)),
eq(<@FSHIFTZ>,0))]<THEN>
[#]{N<SEQ>}<MOTION>G<FIXTURE>X<@FSHIFTX>Y<@FSHIFT
Y>Z[<@FSHIFTZ>+<ABS-ZRAPID>]<EOB>
[#]{N<SEQ>}G92 X0 Y0 Z<ABS-ZRAPID><EOB>
[#]{N<SEQ>}{<MOTION>}X<X-COORD>Y
<Y-COORD>{S<SPEED>}{<COOLANT>}<EOB>
[#]<ENDIF>
[#]<IF>[ and( and( eq(<@FSHIFTX>,0), eq(<@FSHIFTY>,0)),
eq(<@FSHIFTZ>,0))]<THEN>
[#]{N<SEQ>}{<MOTION>}G<FIXTURE>{X<X-COORD>}{Y<YCOORD>}{S<SPEED>}{<COOLANT>}<EOB>
[#]<ENDIF>
<ENDIF>
Program end format
<IFNOT>[ and( and( eq(<FSHIFTX>,0), eq(<FSHIFTY>,0)),
eq(<FSHIFTZ>,0))]<THEN>
[#]{N<SEQ>}<MOTION>G<FIXTURE>X-<FSHIFTX>Y-<FSHIFTY>
Z[-<FSHIFTZ>+<ABS-ZRAPID>]<EOB>
[#]{N<SEQ>}G92 X0 Y0 Z<ABS-ZRAPID><EOB>

Xbuild Reference Manual

Mill posts 85

<ENDIF>
{N<SEQ>}M09<EOB>
{N<SEQ>}G30G91Z0.M19<EOB>
{N<SEQ>}G28G90X<X-CHANGE>Y<Y-CHANGE><EOB>
{N<SEQ>}M30<EOB>

Configuring post for incremental macros


The use of Fanuc's G91 in a macro is an example of incremental macro
programming. Note that the coordinate for the relative moves are
preceeded by the @ symbol so that only the relative distance it output.
Rapid move format
<IF><IS-INC-MAC><THEN>
[#]{N<SEQ>}{<MOTION>}{X<@X-COORD>}{Y<@YCOORD>}<EOB>
<ENDIF>
<IFNOT><IS-INC-MAC><THEN>
[#]{N<SEQ>}{<MOTION>}{X<X-COORD>}{Y<YCOORD>}<EOB>
<ENDIF>
Linear move format
{N<SEQ>}{<MOTION>}{<COMP-STAT>}
<IF><COMP-START><THEN>
[#]D<COMP-NUM>
<ENDIF>
<IF><IS-INC-MAC><THEN>
[#]{X<@X-COORD>}{Y<@Y-COORD>}{Z<@ZCOORD>}{F<FEED>}<EOB>
<ENDIF>
<IFNOT><IS-INC-MAC><THEN>
[#]{X<X-COORD>}{Y<Y-COORD>}{Z<ZCOORD>}{F<FEED>}<EOB>
<ENDIF>
Circular move format

86 Mill posts

Xbuild Reference Manual

{N<SEQ>}{<PLANE>}{<MOTION>
<IF><XY-PLANE><THEN>
[#]<IF><IS-INC-MAC><THEN>
[#]X<@X-COORD>Y<@Y-COORD>{Z<@Z-COORD>}I<ARCX>J<ARC-Y>
[#]<ENDIF>
[#]<IFNOT><IS-INC-MAC><THEN>
[#]X<X-COORD>Y<Y-COORD>{Z<Z-COORD>}I<ARC-X>J<ARCY>
[#]<ENDIF>
<ENDIF>
<IF><ZX-PLANE><THEN>
[#]<IF><IS-INC-MAC><THEN>
[#]Z<@Z-COORD>X<@X-COORD>{Y<@Y-COORD>}K<ARCZ>I<ARC-X>
[#]<ENDIF>
[#]<IFNOT><IS-INC-MAC><THEN>
[#]Z<Z-COORD>X<X-COORD>{Y<Y-COORD>}K<ARC-Z>I<ARCX>
[#]<ENDIF>
<ENDIF>
<IF><YZ-PLANE><THEN>
[#]<IF><IS-INC-MAC><THEN>
[#]Y<@Y-COORD>Z<@Z-COORD>{X<@X-COORD>}J<ARCY>K<ARC-Z>
[#]<ENDIF>
[#]<IFNOT><IS-INC-MAC><THEN>
[#]Y<Y-COORD>Z<Z-COORD>{X<X-COORD>}J<ARC-Y>K<ARCZ>
[#]<ENDIF>
<ENDIF>
{F<FEED>}<EOB>
Open macro format

Xbuild Reference Manual

Mill posts 87

:<PROG-NAME><MACRO#><EOB>
<IF><IS-INC-MAC><THEN>
[#]{N<SEQ>}G91<EOB>
<ENDIF>
Close macro format
<IF><IS-INC-MAC><THEN>
[#]{N<SEQ>}G90<EOB>
<ENDIF>
{N<SEQ>}M99<EOB>
Z rapid move format
<IF><IS-INC-MAC><THEN>
[#]{N<SEQ>}{<MOTION>}{Z<@Z-COORD>}<EOB>
<ENDIF>
<IFNOT><IS-INC-MAC><THEN>
[#]{N<SEQ>}{<MOTION>}{Z<Z-COORD>}<EOB>
<ENDIF>

Fourth and fifth axis support


FeatureCAM supports the use of a rotary table as a fourth axis for
indexing between operations and for wrapping, allowing continuous
movement of the rotary axis during the cutting operations. Both of these
strategies depend on hardware which supports this kind of operation, and
the user of post-processor designed to address that hardware.
Fifth axis indexing, known also as fifth axis positioning, is supported
in the 5th axis positioning option. If using 4th or 5th axis capabilities you
must use different post processors files. For 4th axis indexing or
wrapping use a post in the 4thxs folder. For 5th axis positioning, use a
post in the 5thxs folder.

Rotation styles
FeatureCAM supports four different styles of specifying rotation angles.
These styles along with their reserved words are shown below:

88 Mill posts

Xbuild Reference Manual

Style

Primary axis

Secondary axis

ANSI/EIA RS-274-D

<ROT1-ANSI>

<ROT2-ANSI>

Mathematical

<ROT1-MATH>

<ROT2-MATH>

Relative

<@ROT1-WIND>

<@ROT2-WIND>

Winding and
Unwinding

<ROT1-WIND>

<ROT2-WIND>

ANSI/EIA RS-274-D
In this style, the value of the angle specifies the angular position
measured from zero in the positive direction. The sign of the angle
indicates the direction of rotation. For example:

Mathematical
In this style, the value of the angle specifies the angular position
measured from zero and the sign indicates the direction of measurement.
The sign of the angle also indicates the direction of rotation. For example:

Xbuild Reference Manual

Mill posts 89

Relative
In this style, the value of the angle specifies the angular distance
measured from the current position and the sign indicates the direction of
measurement. The sign of the angle also indicates the direction of
rotation. For example:

Winding and unwinding


In this style, the value of the angle specifies the angular position
measured from zero and the sign indicates the direction of measurement.
The sign of the difference between the angle and the current position
indicates the direction of rotation. For example:

4th axis indexing in the post


The axis to wrap around is fixed in the post, and must match the index
specified in FeatureCAM. All posts that ship with FeatureCAM assume
that 4th axis indexing (and wrapping) is around the X-axis.
Indexing commands must be added to the Program Start,
Segment Start and Tool Change formats.
It is not necessary to add indexing commands to feed move formats
(for example, Circular or Macro) since indexing takes place only
between operations.

90 Mill posts

Xbuild Reference Manual

The logical reserved word <INDEX> specifies indexing (either 4th or 5th
axis) has been activated for the current setup. For Segment Start
formats, <INDEXING> is true only if indexing is enabled in
FeatureCAM and the machine tool is performing the actual indexing
move.
This example is the Segment Start format from the a Bridgeport
control that supports 4th axis. The <Z-INDEX-CLR> is a Z clearance
value calculated from the maximum Z coordinate of the part (or parts if
using Tombstone machining) plus the Z Index Clearance default
attribute.
'<SEGM-ID>'<EOB>
{'COMMENT:<SEG-CMT>'}<EOB>
{N<SEQ>}F<FEED><EOB>
{N<SEQ>}{<MOTION>}{Z<Z-COORD>}<COOLANT><EOB>
{N<SEQ>}{S<SPEED>}{<SPINDLE>}<EOB>
{N<SEQ>G97}{X<SHIFTX>}{Y<SHIFTY>}{Z<SHIFTZ>}{<EOB>}
<IF><INDEX><THEN>
{N<SEQ>}Z<Z-INDEX-CLR><EOB>
{N<SEQ>}M51; INDEX <ROT1-MATH><EOB>
<ENDIF>
{N<SEQ>}<MOTION>X<X-COORD>Y<Y-COORD>
{Z<Z-COORD>}<COOLANT><EOB>

4th axis wrapping in the post


4th axis wrapping in FeatureCAM causes rotary motion of the part, while
the tool is cutting. A simple example of this might be engraving letters on
the outside of a cylinder. However, FeatureCAM can wrap any feature,
including surface milling features around the fourth axis.
To support wrapping, a test for the logical word <WRAP> and the
necessary lines should be added to the Program Start, Tool Change
and Segment Start formats as well as the feed formats (Linear and
In_Macro Linear). It is not necessary to add the fourth axis support
blocks to the Circular Move formats since all arc moves are broken into
linear moves when the wrap feature is enabled.
The following is an example of a Linear format for a Bridgeport TorqCut mill that wraps around the Y axis. Note that in the wrapping case, a
rotation is used for what would be a Y move in the non-wrapping case.

Xbuild Reference Manual

Mill posts 91

<IF><COMP-START><THEN>
{N<SEQ>}<COMP-STAT>X<$X-COORD>Y<$Y-COORD><EOB>
<ENDIF>
<IF><WRAP><THEN>
{N<SEQ>}{<MOTION>}{X<X-COORD>}{C<ROT1-MATH>}{Z<ZCOORD>}
{F<ANG-FEED>}<EOB>
<ENDIF>
<IFNOT><WRAP><THEN>
{N<SEQ>}{<MOTION>}{<COMP-STAT>}{X<X-COORD>}{Y<YCOORD>}
{Z<Z-COORD>}{F<FEED>}<EOB>
<ENDIF>
Wrapping requires special consideration in the Rapid Move format. To
prevent a collision between the tool and part during rotation, the tool must
be withdrawn from the part before the rotation takes placed. Since the
control does not normally test for this case, Xbuild includes two logical
reserved words which are used only to test for the wrap setting and the
rapid move condition. The Rapid Move format then includes both of
these words <WRAP-Z-UP> and <WRAP-Z-DOWN>, and is
implemented in the following way.
<IF><WRAP-Z-DOWN><THEN>
{N<SEQ>}{<MOTION>}{C<ROT1-MATH>}<EOB>
{N<SEQ>}{X<X-COORD>}{<COOLANT>}<EOB>
{N<SEQ>}{Z<Z-COORD>}<EOB>
<ENDIF>
<IF><WRAP-Z-UP><THEN>
{N<SEQ>}{<MOTION>}{Z<Z-COORD>}<EOB>
{N<SEQ>}{C<ROT1-MATH>}<EOB>
{N<SEQ>}{X<X-COORD>}{<COOLANT>}<EOB>
<ENDIF>
<IFNOT><WRAP><THEN>
{N<SEQ>}{<MOTION>}{X<X-COORD>}{Y<Y-COORD>}
{Z<Z-COORD>}{<COOLANT>}<EOB>

92 Mill posts

Xbuild Reference Manual

<ENDIF>

5th axis indexing in the post


Fifth axis indexing allows 2 D or 3D toolpaths to be performed from
many orientations. For 5th axis positioning, use a post in the 5thxs folder.
Indexing commands must be added to the Program Start,
Segment Start and Tool Change formats.
It is not necessary to add indexing commands to feed move formats
(Linear, Circular or Macro) since indexing takes place only
between operations.
The logical reserved word <INDEX> specifies indexing (either 4th or 5th
axis) has been activated for the current setup. To help create smaller NC
programs, <INDEX> is interpreted differently in different program
formats:
for Program Start and Tool Change formats, <INDEX> is true
if indexing is enabled in FeatureCAM.
for Segment Start formats, <INDEX> is true only if indexing is
enabled in FeatureCAM and the machine tool is performing the
actual indexing move.
The following is an example of the Segment Start format for the Fanuc
16 control.
<IF><INDEX><THEN>
{N<SEQ>}{<MOTION>}G53G90G00G80G49Z0M11M71<EOB>
<10><13>
{N<SEQ>}{<MOTION>}{X<X-COORD>}A<ROT1-WIND>
B<ROT2-WIND>M10M70<EOB>
<ENDIF>
<IF><WRAP><THEN>
{N<SEQ>}{<MOTION>}{X<X-COORD>Y0}{A<ROT1-WIND>}
{Z<Z-COORD>}{<COOLANT>}<EOB>
<ENDIF>
<IFNOT><WRAP><THEN>
{N<SEQ>}{<MOTION>}{Z<Z-COORD>}{<COOLANT>}<EOB>
{N<SEQ>}{<MOTION>}{X<X-COORD>}{Y<Y-COORD>}<EOB>

Xbuild Reference Manual

Mill posts 93

<ENDIF>
{N<SEQ>}S<SPEED>F<FEED><EOB>

94 Mill posts

Xbuild Reference Manual

Turn posts
This section describes how to use Xbuild for writing turn posts.

CNC-Info menu
The CNC Info options are used to set up the basic parameters for a CNC
program:
General - specifies the output program format.
NC Codes - defines the exact character string for different NC
commands.
Feeds & Speeds - changes the minimum and maximum spindle
speeds and feed rates in a CNC program.
Fixture ID - this is a list with valid fixture IDs.
Words-N - configures the format of numeric reserved words.
Turrets - describes all of the turrets on a lathe.
Spindles - contains the M codes for selecting the spindles.
Cycles - specifies the manner in which drilling, threading and
grooving cycles are handled.

Xbuild Reference Manual

Turn posts 95

CNC-Info menu - General


Allows you to specify the output program format. The General
Information dialog appears.

Be sure to select Turning in the Machine Type field to have


Xbuild display appropriate options.
Any parameter may be changed by selecting it, typing the value, or
toggling to the desired selection (if a new value is entered, press Enter).
The comment block describes the post processor.
These values are default values when no CNC data file has been
loaded into the Xbuild program. When a file is loaded, several or all
of these values may change.
You can set the following parameters:
Machine type - classifies the type of post.
The choices are:
Milling - use this type of post for 2.5D or 3D milling.
Turning - use this classification for 2-axis turned parts.
Turn/Mill - use this type of post for lathe with powered rotary
tools.
Wire EDM - use this type of post for Wire EDM machines.
This distinction controls type of reserved words and program formats that
are available in the post.
Dimension - toggles between Inch and Metric output.

96 Turn posts

Xbuild Reference Manual

Post uses the selection to convert the dimensions that affect X and Y
coordinates as well as feed rate. The setting in the CNC Data file takes
precedence over the assumed inch unit in FeatureCAM. If a part program
is written in inch units, and is processed with a metric CNC data file, the
resulting part program is converted (using standard conversion constants)
into metric units.
Circ. interpol. - selects the programming format on the CNC for which
the post processor is being built.
You can choose Multi-Quadrant, Single Quadrant, or Not
Supported option, as appropriate. For example, if the Numerical
Control cannot drive an arc across a quadrant line (plus or minus X and Y
axes), then select Single Quadrant circular interpolation. When circular
interpolation is turned off in post, then wrap tolerance is used to control
fineness of toolpath.
EOB - defines the end of block character(s), or <EOB>.
We recommended that you use the default characters, that is, <13>
(carriage return) and <10> (line feed).
Decimal point - defines the decimal point character.
This character is usually a period '.' for United States controls, and
a comma ',' for European controls.
Dogleg rapid moves - affects simulation only.
If this option is selected, then during a rapid move from point A to point
B both simulated axes will move at the maximum rate until one of the
axes moves is completed, and then the machine will proceed to B with
only the other axis continuing in a straight line.
If this option is not selected, then the simulation shows all rapid moves
from point A to point B as straight lines. In general, rapid moves on
machines are not straight lines.
Tool Line Comp - allows for the compensation of tool length by
subtracting the tool's X and Z length from the coordinate data at post
processing time.
Using Tool Ln Comp allows the user to shift or compensate for
different tool lengths without presetting the origin for each tool. For
Japanese machines such as FANUC, this selection should be turned Off.
If the output is to be incremental, Tool Ln Comp must be turned On.
Seq max - this is the maximum value for sequence numbers.

Xbuild Reference Manual

Turn posts 97

After reaching this number, the sequence numbers start over. If the Seq
max radio button is not selected, then no limit is set.
NC file extension - the default file extension for you CNC programs.
For example if it is set to .txt, and your part is called 'bracket', then the
G-code file will be called bracket.cnc.

CNC-Info menu - NC Codes


With the NC Codes dialog, the exact character strings that are required
for commands by the NC machine for different motion types can be
specified.

The character strings entered in the dialog must match the required
strings specified for the NC control. This information is usually
found in the programmer's manual for the NC control.
You can set the following parameters:
Motions - the options in this frame describe motion types required by
the NC machine. All of these codes must be specified.
For example, Linear is generally defined as G1, but may be changed to
G01, or any other string (up to 11 characters). All motion commands are
passed to Post via the string reserved word <MOTION>.
The following options are available:
Rapid - rapid move.
Linear - feed move.
Circ. CW - circular interpolation, clockwise.
Circ. CCW - circular interpolation, counter-clockwise.

98 Turn posts

Xbuild Reference Manual

XY, UV - refers to Wire EDM 4-axis movements using an upper


and a lower curve. Typically, XY represents the curve at the
bottom of the part, and UV represents the curve at the top of the
part.
This option is only available for wire EDM posts.
Compensation - generates cutter diameter compensation in the output
when turned On in FeatureCAM, and if it is built into the CNC data file.
Compensation generates tool tip radius compensation in the output
when turned On in FeatureTURN, and if it is built into the CNC data file.
Compensation selections use the string reserved word <COMPSTAT> for one of the below options, or an empty string is assigned if
Compensation was not turned On in FeatureTURN.
The Compensation frame has these options:
Cancel - compensation off.
Left - compensation on cutter, applied to left in direction of travel.
Right - compensation on cutter, applied to the right in the
direction of travel.
3D - code for turning 3D cutter compensation on.
This code does not apply to Wire EDM.
Cancel 3D - turns off 3D cutter compensation.
This code does not apply to Wire EDM.
Thread - code for single point threading cycle.
Style - select single line or step (multiple) line thread cycle.
Pecking - selects types of pecking performed for drilling and tapping.

Xbuild Reference Manual

Turn posts 99

CNC-Info menu - Turrets


Defines all of the turrets on a lathe. The Turret Information dialog
appears.

You can set the following parameters:


Multi-turret programming - indicates the style of multi-turret
programming that is available on this machine. If the lathe only has a
single turret, select None. For Okuma style lathes with multiple turrets
that requires a single part program for all of the turrets, select Okuma.
For Fanuc style multi-turret lathes that desire a separate output file for
each turret, select Fanuc.
Synch Number Start - this is the initial M code number that is
reserved for synchronization codes (also called wait codes). Most
machines reserve all M codes above a certain number for synchronization
codes.
Synch Number Increment - this is the increment between
synchronization codes.

100 Turn posts

Xbuild Reference Manual

Turret Rotation Auto - automatically rotates turret to next tool shortest


direction.
Turret Rotation CW - rotates turret to next tool CW.
Turret Rotation CCW - rotates turret to next tool CCW.
FeatureCAM can support up to four turrets. Each turret location is
represented as either Main Spindle Side Upper Turret, Main
Spindle Side Lower Turret, SubSpindle Side Upper Turret or
Main Spindle Side Lower Turret. Select the check boxes that apply
to your specific machine, and then specify the following parameters for
each spindle if they apply:
Coolant On - turns on the coolant.
Coolant Off - turns off the coolant.
Can address main spindle - select if the turret can cut on the
main spindle.
Can address sub spindle - select if the turret can cut on the
subspindle.
Can hold live tools - select if the turret can hold drills or mills
that can spin.
Can hold B axis tools - select if the turret can hold tools that
can rotate around the Y axis.
C Angle Offset - indicates the C angle for the tool at its start
position. Typically upper turrets should be at 0 degrees and lower
turrets will be at 180 degrees.
Z and X distances between turrets are signed values measured from
the primary turret reference point to the secondary turret reference
point. The turret reference points are always the locations from
which the tool lengths are measured.

Xbuild Reference Manual

Turn posts 101

CNC-Info menu - Spindles


Contains the M codes for selecting the spindles. The Spindle
Information dialog appears.

You can set the following parameters:


Select Main Spindle - code for selection of main spindle.
Select Sub Spindle - code for selection of sub spindle.
Main and sub spindles have the same Z axis direction check
box - select if the Z directions are the same for both spindles.
If this check box is not selected, it is assumed that the Z directions
are opposite.
Machine Z coordinate at subspindle home - value for Sub Z home
(typically zero).
Machine Z coordinate at subspindle max (left) - value for Sub Z
max (from machine builder).
Synchronize frame - code for synchronizing spindles.
The Synchronize frame has these options:
Turn Speed - code for synchronizing the speed on both spindles.
Turn Phase - code for synchronizing the phase on both spindles.
Turn Off - code for turning off spindle turn synchronizing.

102 Turn posts

Xbuild Reference Manual

CNC-Info menu - Feeds and Speeds


These parameters are used to specify the spindle direction, feed units and
the speed range codes that are required by the machine. The Feeds and
Speeds dialog opens.

You can set the following parameters:


Feed max and Feed min are the feed rate limits when specified in Feed
Per Minute.
Degrees/Minute Max and Degrees/Minute MIN are the feed rate
limits when specified in degrees per minute.
Range 1- Range 4 - are for lathes that have speed ranges. For each
range, enter the M-codes for selecting the range and the maximum speed
for the range.
UPM (Units per Minute) and UPR (Units per Revolution) describe the
feed rate in terms of UPM or UPR (or the spindle). Only one option at a
time is used by Post, depending upon FeatureTURN's segment data.
Spindle CW (clockwise) and Spindle CCW (counter-clockwise)
describe the spindle On and direction code. Both of these selections use
the string reserved word <SPINDLE> to specify spindle On and
direction.
Spindle Dir may be specified in FeatureTURN with a negative, or
positive spindle RPM value. A negative value specifies a CCW
direction, while a positive value specifies a CW direction.
When CSS is turned on in FeatureTURN, the spindle speed is
limited to the maximum set for the appropriate speed range set here.

Xbuild Reference Manual

Turn posts 103

CNC-Info menu - Cycles


Specifies the manner in which drilling, threading and grooving cycles are
handled. The Cycles Information dialog opens.

You can set the following parameters:


Groove simple - if this option is selected, a groove is output as series
of computed moves. Or, in the case of a straight walled dimensioned
groove, the roughing operation is output as a canned cycle.
Groove canned - if this option is selected, the curve is output in the
NC code twice and the roughing and finishing canned cycles reference
the curves. If reuse path is selected then the curve is output only once and
the roughing and finishing cycles reference the same curve.
Grooving has only limited canned cycle support. Only roughing of
straight-walled grooves are output as a canned cycle. This applies
to grooves with Chamfer = 0, Angle = 0 and Radius = 0.
When Canned is selected, a format for a canned threading, drilling, or
tapping cycle is defined, which is output by Post only one time. If
Computed is chosen, the drilling, threading, or tapping move definitions
are output as the respective cycle's pass for each step.

104 Turn posts

Xbuild Reference Manual

CNC-Info menu - Fixture ID


Records the various G codes that are valid fixture ID's. The Fixture ID
dialog opens. You can type the appropriate IDs directly into the list, and
click OK.

An example list might be:


51
52
53
54
55
FeatureCAM will automatically look in the current post processor and
will assign the next available fixture ID to a new setup and to the numeric
reserved word <FIXTURE>.

Formats menu
The Xbuild Formats menu enters specific program formats for the
various blocks which can appear in a part program. Each format is made
up of combinations of reserved words, literals, comments, and userdefined variables.
The Formats menu lists a number of general groups of formats:
Program - formats that are used in almost every part program,
and include commonly used formats (for example Program
Start, Tool Change , Segment Start, Program End).

Xbuild Reference Manual

Turn posts 105

Move - formats include the rapid and feed moves which make up
the largest portion of any part program (for example Rapid,
Linear, Circular). These program formats must be carefully
defined.
Macro - formats include Open Macro, Close Macro, Macro
Call, In-Macro Linear, and In-Macro Circular.
The Macro formats are not available for turn posts.
Cycle - formats include most of the canned cycles which are
found in many controls (for example Deep Hole, Tap).
Custom - a custom format is used as a place holder for a block of
code that may be used in several different formats. The system
reserved word <INCLUDE:> is placed into the appropriate section
of a format that uses the block of code from the custom format. The
name of custom format should be inserted after colon:
<INCLUDE: Custom Format Name>.
Each of these groups contains specific formats which, when selected, are
(see page 12)displayed in the Formats editor.
The formats use specific reserved words, which are discussed
separately for each post type. For example, milling reserved words
can be found under the Mill Post section, turning reserved words
can be found under the Turn Post section and so on.

Defining turning formats


For each segment of a part program, parameters and calculated values are
passed via the reserved words from the program formats. These program
formats act as a template; they are sequentially filled (that is, the reserved
words are substituted by their corresponding values, G and M codes) as
the part data file is post-processed.

Rules
The reserved words <Z-COORD> and <X-COORD> are the assigned
values of the first path point, and must appear in all program formats to
provide the first positioning move to the start of the path.

106 Turn posts

Xbuild Reference Manual

Program formats
As Post reads each segment from the part data file, it determines if it's the
first segment of the program, a tool change, or a non-tool changing
segment. Based upon this information, Post outputs the appropriate block
(that is, Program Start, Tool Change, or Segment Start) prior to
executing segment data. Only one of these three program formats is used
at the beginning of any one segment.
Each definition can include multiple lines, and each line must end
with <EOB>.
Program start
Post outputs lines that are defined in the Program Start format at the
beginning of a program. In the Program Start format, general
preparatory codes (for example absolute, incremental, and so on) are
placed to define the dimension system. The first tool change must also
be defined. Functions such as <SPEED>, <SPINDLE> and
<COOLANT> status, as well as the first positioning move can be passed
to the Post output via <Z-COORD> and <X-COORD> reserved words.
Spindle change
Used when operation switches from one spindle to another.
Tool change
A Tool Change block is output between segments that require a
tool change.
This block is only output if the Tool # specification, or Turret
selection in FeatureTURN differs from the previous one.
The tool should be positioned to a safe location (index position),
before indexing tools.
Functions such as <SPEED>, <SPINDLE> and <COOLANT>
status can be passed to the Post output with the first positioning
move via the <Z-COORD> and <X-COORD> reserved words.
Segment start
Segment Start is only output between non-tool changing
segments. This typically occurs when there is a change in fixture
offset or spindle speed.

Xbuild Reference Manual

Turn posts 107

Segment Start should contain any commands that may change


between segments, for example <SPEED>, <OFFSET #>,
<CSS-SPEED> and so on.
The reserved words <X-COORD> and <Z-COORD> must be
included in Segment Start.
Program end
This block can be used to:
turn the Coolant Off;
position the tool to an endpoint;
rewind the part program.
The Program End format uses the reserved words <X-RETURN> and
<Z-RETURN> to calculate the return to the first index position.

Move formats
Rapid move
The Rapid Move format defines the output format for rapid positioning
moves.
Generally, modality delimiters { } are placed around the <X-COORD>
and <Z-COORD> reserved words. This allows the post processor to
'strip' X, or Z from the line when a coordinate is redundant. In motion
blocks (rapid, linear and circular), the reserved word <MOTION>
receives the path definition parameter from FeatureTURN (Rapid,
Linear, Arc CW, Arc CCW, or the Thread command).
Linear move
The Linear Move format defines the output format for linear moves.
The following reserved words must be defined in this block:
<MOTION>;
<X-COORD>;
<Z-COORD>;
<FEED>.
Tool tip compensation must be turned ON in this format line via the
<COMP-STAT> reserved word.

108 Turn posts

Xbuild Reference Manual

Some CNC machines may require the use of the vector reserved words
<Z-VECTOR> and <X-VECTOR>.
Circular move
The method of specifying arc definition is defined in a Circular Move
block.
The following reserved words are provided as arc modifiers for I, K, or R
values:
<ARC-X>;
<ARC-Z>;
<RADIUS>;
<S-RAD>;
<X-CEN>;
<Z-CEN>.
Spindle
This format gets called when you turn off the spindle or change spindle
directions.
Dwell
Format for dwell code output, that is G04U<DWELL><EOB>.
Bar feed
This block contains the necessary codes for opening and closing the
spindle and also the bar feed code.
Catcher in
This block would contain the M-code for retracting the parts catcher.
Catcher out
This block contains the M-code for extending the parts catcher.
Rough cycle start
This block contains the code for starting the roughing canned cycle.
Refer to the Numeric turning canned cycle block words (see page 119)
table for applicable reserved words.

Xbuild Reference Manual

Turn posts 109

Rough cycle end


This block contains the code (if any required) for ending the roughing
canned cycle.
Refer to the Numeric turning canned cycle block words (see page 119)
table for applicable reserved words.
Finish cycle start
This block contains the code for starting the finishing canned cycle.
Refer to the Numeric turning canned cycle block words (see page 119)
table for applicable reserved words.
Finish cycle end
This block contains the code for ending the finishing canned cycle.
Refer to the Numeric turning canned cycle block words (see page 119)
table for applicable reserved words.
Spindle open
This format contains commands for opening the current spindle.
It should contain logic for opening the main and subspindle.
The logical variable <MAIN-SPCMD> is used to determine which
spindle is current.
Spindle close
This format contains commands for closing the current spindle.
It should contain logic for closing the main and subspindle.
The logical variable <MAIN-SPCMD> is used to determine which
spindle is current.
Spindle position
This format positions the subspindle with a rapid move.
The reserved word <SPINDLE-POS> contains the position of the
subspindle.
When the sub-spindle is positioned using both a rapid and a feed
move, the Spindle Position and Spindle Position Feed
formats are called in succession.

110 Turn posts

Xbuild Reference Manual

Spindle position feed


This format positions the subspindle with a feed move.
The Subspindle feature for positioning has an intermediate point that can
be specified.
Spindle orient
This format is used to orient the spindle.
It should contain logic for orienting the main spindle and subspindle. This
format is used for setting the angle of a spindle. It can be used before or
after grabbing the part.
Spindle start/stop
The Spindle Start/Stop format starts or stops the spindle. The reserved
word <SPINDLE> contains the M-code to perform these functions.
UDF text
Returns code/comment from a user-defined feature (UDF). <UDFTEXT> and <UDF-COMMENT> are reserved words that receive text
passed from the UDF.
Turret home
This format is called by the system or user to command the turret home.

Cycle formats
Drill cycle
This block contains the canned cycle for twist drill operations including
the support of peck drilling.
For drilling, the following reserved words have the following values:
<DEPTH> - the calculated depth of the drilling operation
including compensation for tool tip.
<STEP1> - pecking depth. This value is calculated by dividing
<DEPTH> by the Number of Pecks.
This is an example drilling cycle format:
{N<SEQ>}G83X0Z<DEPTH>Q<STEP1>F<FEED><EOB>
Refer to the Numeric drilling and threading type cycle words (see page
120) table for applicable reserved words.

Xbuild Reference Manual

Turn posts 111

Tapped canned cycle


Enter the program block for tapping. For this operation <DEPTH> is the
depth of the tapping operation.
Refer to the Numeric drilling and threading type cycle words (see page
120) table for applicable reserved words.
Thread cycle
When one of these options is chosen, the desired format may be entered
for the threading program block.
Refer to the Numeric drilling and threading type cycle words (see page
120) table for applicable reserved words.
Groove cycle
There are three turning groove canned cycle formats available in Xbuild,
and they apply in two different situations.
There are two kinds of grooving canned cycle: simple canned cycle
and path canned cycle. If you choose not to use any canned cycles,
then you'll be using longhand code referred to as computed.
Groove simple/computed
You need to fill in the Groove Simple/Computed format whenever
you specify the Use simple canned cycle or computed cycle
option on the Strategy tab of the Turning Groove feature.
Simple canned cycles
The simple canned cycle can be turned on by selecting the Simple radio
button in the Cycles Information dialog of Xbuild (CNC-Info Cycles).
If it's on, then any rectangular simple groove feature (straight walls and
no chamfer or bottom radius) will be posted out as a single line of code
using the Groove Simple/Computed format.
An example of this format can be found in fan6ti.cnc post, which is
shipped with FeatureCAM.
For example:
N<SEQ> G75 X<X-COORD>Z<ZCOORD>I<DEPTH>K<STEPOVER>F<FEED><EOB>

112 Turn posts

Xbuild Reference Manual

If simple canned cycles are being used (that is the simple canned cycle is
turned on in the Cycles Information dialog, and you've filled in the
Groove Simple/Computed format), then the system computes the
diagonal bottom point of the groove slot as the target point.

FeatureCAM only supports canned cycles that utilize this computed


target point. If a canned cycle program format is required, then the
values of the <X-COORD> and <Z-COORD> reserved words (see
the example below) are the X and Z coordinates of the target points.
Computed style of grooving
If you are using computed style of groove, then the Groove
Simple/Computed format must be (at the very least) identical to the
Linear Move format. Other parameters can be used (see the example
below).
For example, if you need a dwell, you should select the Simple radio
button in the Cycles Information dialog of Xbuild (CNC-Info Cycles), and then fill in the Groove Simple/Computed format with
something like the following:
{N<SEQ>}{<MOTION>}{X<X-COORD>}{Z<ZCOORD>}{F<FEED>}<EOB>
{N<SEQ>} GO4 F<DWELL><EOB>
Groove path start and groove path end
These formats are used for path canned cycles.
The path canned cycle can be turned on by selecting the check box on the
on the Strategy tab of the Turning Groove feature. If it's on, then the
curve of the feature is output as the path. For examples, see the Groove
Path Start and Groove Path End formats in path_cyc.cnc post,
which is shipped with FeatureCAM.
Selecting Use path canned cycle on the Turning Groove feature
will ignore the Simple/Computed radio buttons in the Cycles
Information dialog in Xbuild and, instead, will use the Groove Path
Start and Groove Path End formats.

Xbuild Reference Manual

Turn posts 113

The Simple/Computed radio button in Xbuild are applicable only if


the Use path canned cycle option on the Strategy tab of the
Turning Groove feature is off.
The path posts (path_cyc.cnc, pths_cyc.cnc and
pp15_cyc.cnc) do support grooving canned cycles - not the
simple kind but the path kind.

Turning numeric reserved words


This section contains tables with numeric reserved words used in turn
posts.

Numeric general words


Reserved word

Definition

<BAXIS-ROT>

Returns turning tool rotary angle where turning tool


is locked in B-axis spindle. Commonly used to flip
turn tools when moving from main to sub.

<CALC-SPEED>

Calculated direct RPM speed at the path's start


point; the spindle can be turned ON, or readjusted
in direct RPM prior to rapid traversing to the path's
start point, where CSS is turned On. The <CALCSPEED> reserved word can be used to
automatically calculate the direct RPM 'turn on'
speed (to turn on CSS after position moves), which
avoids rapid traversing to and from a remote
indexing point in the CSS mode.

<CLEARANCE>

Corresponds to the clearance attribute.

<CLR-DEPTH>

<CLEARANCE> + <DEPTH>

<COMP-NUM>

Compensation number passed from FeatureCAM.

<CSS-SPEED>

Corresponds to the Surface Speed parameter on


the Feed/Speed tab of a feature.

<DWELL>

Corresponds to the Dwell parameter for Cutoff,


Groove, and Tapping.

<ENG-ANGLE90>

90 - Engage Angle for turning or 90 + Engage


Angle for boring.

114 Turn posts

Xbuild Reference Manual

Reserved word

Definition

<FEED>

Passes the feed rate value to the word format of


<FEED-UPM> or <FEED-UPR>, depending
upon the Feed Units specified in FeatureTURN.

FEED-UPM

Format of this word is used to pass feed rate value


and/or the reserved word <FEED> when Use IPR
is not selected on the Feed/Speed tab for a
feature.

FEED-UPR

Format of this word is used to pass feed rate value


and/or the reserved word <FEED> when Use IPR
is selected on the Feed/Speed tab for a feature.

<INC-MACX>

X location of the pattern instance that will be cut by


the macro. This coordinate is typically not output in
the CNC program.

<INC-MACZ>

Z location of the pattern instance that will be cut by


the macro. This coordinate is typically not output in
the CNC program.

<LIFT-OFF>

For groove only. Corresponds to Liftoff Dist.


attribute.

<NEXT-TL>

Next tool to be used, may be required by some


controls. Corresponds to the Tool column of the
Tool Mapping dialog.

<NOSE-RAD>

Tool nose radius of an endmill or the tool tip radius


of a turning or threading tool.

<OFFSET#>

Tool length offset number. Corresponds to the


Offset parameter in the Tool Mapping dialog.

<OP-ORDERNUM>

Used to create Psync codes for Okuma machines.


Because Okuma has only one file for both turrets,
each operation needs an individual sync code that
determines the operation order (whether synced or
not). When the turrets are synced the P codes for
both turrets are the same.

<R-CSS>

Radius value in constant surface speed; in Post, this


value is set to the first X coordinate value.

<RTR-ANGLE-P>

The Withdraw Angle used for EZ-Path.

<RTR-FEED>

Withdraw feed rate.

Xbuild Reference Manual

Turn posts 115

Reserved word

Definition

<SEQ>

This is a line sequence number identifier (when the


word appears in a line, it is substituted with the
current sequence number, and is subsequently
incremented by the sequence step value).

<SPEED>

Spindle RPM value passed from feature


Properties dialog.

<SP-MAX>

Maximum spindle RPM when CSS is On, used to


set the maximum RPM at which the spindle should
run. Corresponds to the CSS Max RPM turning
attribute or the Max. speed for the current range
specified on the Feeds&Speeds dialog of Xbuild.

<SPINDLE-POS>

Subspindle position.

<STEPOVER>

For groove only. Corresponds to Stepover % *


Tool Width.

<STOCK-ID>

Inner diameter of the stock - for round (tube) stock


only - 0 for other types of stock.

<STOCK-OD>

Outer diameter of the stock - for round stock only 0 for other types of stock.

<STOCK-TYPE>

Type of stock: 1.0 for block, 2.0 for round, 3.0 for
N-sided, 4.0 for user-defined.

<STOCK-XMAX>

Bounding box - maximum X value, or X coordinate


of the upper most corner of the bounding box for
the stock in space.

<STOCK-XMIN>

Bounding box - minimum X value, or X coordinate


of the lower most corner of the bounding box for
the stock in space.

<STOCK -YMAX>

Bounding box - maximum Y value, or Y coordinate


of the upper most corner of the bounding box for
the stock in space.

<STOCK-YMIN>

Bounding box - minimum Y value, or Y coordinate


of the lower most corner of the bounding box for
the stock in space.

<STOCK-ZMAX>

Bounding box - maximum Z value, or Z coordinate


of the upper most corner of the bounding box for
the stock in space.

116 Turn posts

Xbuild Reference Manual

Reserved word

Definition

<STOCK-ZMIN>

Bounding box - minimum Z value, or Z coordinate


of the lower most corner of the bounding box for
the stock in space.

<SYNC-NUM1>

Returns sync number from the CNC-Info Turrets dialog. Used to synchronize multiple
turrets.

<SYNC-SPEED>

For use in Okuma-style multi-turret posts only, this


variable contains the synchronization code for a
change in spindle speed. The sync code must be
output on the same line as the spindle speed.

<TL-WIDTH>

Width of selected tool.

<TOOL>

Tool number passed from FeatureCAM.


Corresponds to the Tool column of the Tool
Mapping dialog.

<TURRET-NUM>

Returns the number of the current turret.

<X-CHANGE>

X coordinate of desired tool change location passed


from Post Options dialog. Post Options can be
reached from FeatureCAM by clicking on the Post
name in the lower right portion of the FeatureCAM
screen.

<X-COORD>

Returns current X coordinate value.

<X-INDEX>

X-Index turret position passed from FeatureTURN.


Corresponds to the X coordinate of the Tool
Change Location (the setting in the Post
Options dialog). Post Options can be reached
from FeatureCAM by clicking on the Post name in
the lower right portion of the FeatureCAM screen.

<X-PRESET>

Distance between the tool program point and the


part origin when at the index position along the X
axis; this value is calculated by Post as:
<X-PRESET> = <X-INDEX> + <X TOOL
LENGTH> - <distance btw turrets>
<distance btw turrets> is equal to zero for primary
turret.

Xbuild Reference Manual

Turn posts 117

Reserved word

Definition

<X-RETURN>

X coordinate of the previous X-PRESET value plus


any differences between tool change locations; this
value is calculated by Post as:
<X-RETURN> = <$X-PRESET> + <X-INDEX> <$X-INDEX>

<X-VECTOR>

Calculated X vector for the next move.

<Z-COORD>

Returns current Z coordinate value.

<Z-CHANGE>

Z coordinate of desired tool change location passed


from Post Options dialog. Post Options can be
reached from FeatureCAM by clicking on the Post
name in the lower right portion of the FeatureCAM
screen.

<Z-INDEX>

Z-Index turret position passed from FeatureTURN.


Corresponds to the Z coordinate of the Tool
Change Location (the setting in the Post
Options dialog). Post Options can be reached
from FeatureCAM by clicking on the Post name in
the lower right portion of the FeatureCAM screen.

<Z-PRESET>

Distance between the tool program point and the


part origin when at the index position along the Z
axis; this value is calculated by Post as:
<Z-PRESET> = <Z-INDEX> + <Z TOOL
LENGTH> - <distance btw turrets>.
<distance btw turrets> is equal to zero for primary
turret.

<Z-RETURN>

Z coordinate of the previous Z-PRESET value plus


any differences between tool change locations; this
value is calculated by Post as:
<Z-RETURN> = <$Z-PRESET> + <Z-INDEX> <$Z-INDEX>

<Z-VECTOR>

118 Turn posts

Calculated Z vector for the next move.

Xbuild Reference Manual

Numeric turning canned cycle block words


The following example code fragment from a Fanuc control is used to
illustrate the parameters below.
N012 G72 P013 Q018 U4.0 W2.0 D7000 F30 S55
N013 G00 Z58.0 F15 S58
N014 G01 X120.0 Z70.0
N015 Z80.0
N016 X80.0Z909.0
N017 Z110.0
N018 X36.0Z132.0
N019 G70P013Q018
Reserved word

Definition

<ENG-FEED>

Turning, ezpath canned cycle, engage feed rate.

<NEW-ID>

Turning, ezpath canned cycle. Forces the <PATHID> reserved word to be incremented.

<PATH-ID>

The current canned cycle path ID.

<PRO-FEED>

Finishing feed rate. This value is usually specified


along with the profile. It is often ignored during
roughing.
This variable has the value of 15 in the example
above.

<RTR-LENGTH>

Length of the retract move for turn canned cycles.


Corresponds to Withdraw Length in
FeatureTURN.

<SEQ-END>

Ending NC program line number of profile for


roughing and finishing canned cycle.
This variable has the value of 18 in the example
above.

<SEQ-START>

Starting NC program line number of profile for


roughing and finishing canned cycle.
This variable has the value of 13 in the example
above.

<X-ALLOW>

Xbuild Reference Manual

Corresponds to X Finish Allowance in


FeatureTURN.

Turn posts 119

Reserved word

Definition

<Z-ALLOW>

Corresponds to Z Finish Allowance in


FeatureTURN.

Numeric circular block words


Reserved word

Definition

<ARC-Z>

Used in the circular interpolation block to specify


the signed Z distance from the start point of the arc
to the center of the arc, along the Z axis.

<ARC-X>

Used in the circular interpolation block to specify


the signed X distance from the start point of the arc
to the center of the arc, along the X axis.

<RADIUS>

Reproduces arc radius in a circular block.

<S-RAD>

Generates the signed arc radius value in a circular


block, +R<180 degrees and -R>180 degrees.

<Z-CEN>

Reproduces the absolute Z coordinate position from


the Z axis origin to the arc's center in a circular
block.

<X-CEN>

Reproduces the absolute X coordinate position from


the X axis origin to the arc's center in a circular
block.
To generate the signed distance from the arc's center to the arc's
start position, locate the <ARC-Z> and <ARC-X> reserved words
in the Words Info dialog (see page 9), and change their FACTOR
values to -1. To generate the unsigned distance from the arc's
start position to the center of an arc, select the UNS_V check boxes
for these reserved words in the Words Info dialog.

Numeric drilling and threading type cycle words

120 Turn posts

Xbuild Reference Manual

Reserved word

Definition

<DEPTH>

This word has different values for different


operations:
Tap operation - calculated depth of tap.
Twist drill operation - calculated depth of
drilling operation including tip.
Turning, Boring and Face operations depth of cut.
Groove operation - depth of cut.

<END-X>

The X location where the thread cutting pass ends.


This is usually the same as <START-X> except for
tapered threads.

<END-Z>

The Z location where the thread cutting pass ends.

<ENG-ANGLE>

Corresponds to the 90 - Infeed Angle threading


attribute.

<LEADX>

Calculated tip to tip X axis lead.

<LEADZ>

Corresponds to Pitch thread dimension.

<MIN-INFEED>

Corresponds to the Min Infeed attribute.

<NUM-SPRING>

Number of thread spring passes. Corresponds to


Spring Passes threading attribute.

<RTR-ANGLE>

Corresponds to Withdraw Angle.

<RTR-ANGLE90>

Withdraw Angle - 90.


This parameter was added to support threading on a
Fanuc. On that controller, a vertical retract is
considered to be 0, not 90.

<START-X>

The X location where the thread cutting pass starts.

<START-Z>

The Z location where the thread cutting pass starts.

<STEP1>

This word has different values for different


operations:
Thread operation - Step 1 of threading pass.
Drill operation - First peck.
Groove operation - Stepover %.

Xbuild Reference Manual

Turn posts 121

Reserved word

Definition

<STEP2>

This word has different values for different


operations:
Thread operation - Step 2 of threading pass.
Drill operation - Second peck.

<TAPER-DEPTH>

The Z distance between the lowest and highest


points on the thread.

<THRD-DEPTH>

Corresponds to Thread Height in FeatureTURN.

<TIP-ANGLE>

The tip angle of the tool.

122 Turn posts

Xbuild Reference Manual

Turning logical reserved words


Reserved word

Definition

<AUTO-ROUND>

True if the Auto Round check box is selected in


Turn properties.

<BAR-FEED>

True if the current operation is a bar feeder


operation.

<BAR-PULL>

True if the current operation is a bar puller


operation.

<COMP-END>

True if the move represents the end section for


compensation (last element, or move of path),
otherwise <COMP-END> is false.

<COMP-MID>

True if the move represents the middle section for


compensation (between the first and last moves of
path), otherwise <COMP-MID> is false.

<COMP-ON>

True if the Tool nose radius compensation


check box is selected in Turn properties.

<COMP-START>

True if the move represents the start section for


compensation (first element, or move of path),
otherwise <COMP-START> is false.

<CSS-ON>

True if the Constant surface speed check box


is selected in Turn properties.

<CUTOFF-CHECK> True if the Cut-off checker check box is selected


in the Position the spindle subspindle transfer
feature (available for Turn and Turn/Mill posts).
Checks for lack of torque between spindles to check
part has been cut into two pieces, before the
subspindle is sent home. Avoids damage to jaws
and part which would result if Cutoff process was
incomplete and the subspindle went home.
<CW-SPINDLE>

Xbuild Reference Manual

True if spindle is rotating clockwise.

Turn posts 123

Reserved word

Definition

<EJECT-CHECK>

True if the Eject check check box is selected in


the Position the spindle page of the
Subspindle transfer feature (available for Turn
and Turn/Mill posts). Causes the machine's 'Eject
checker' probe to check that the previous part has
been ejected before grabbing the part from the
opposite spindle. Avoids damage if the part has not
been ejected.

<FACE-BFACE>

True if performing a facing or back-facing


operation. This would be true for a Turning feature
using a Face or Back face roughing strategy or a
Facing feature.

<FINISH>

True for finish operations.

<FLOAT-TAP>

True if Floating tap cycle is selected in the


feature Properties.

<HAS-SP-CTRL>

Currently applies to turning only. True when Upper


Turret is working on Main and also true when
Lower Turret is working on Sub. Used to suppress
Lower Turret output (G96, S500, M3) when pinch
turning on Main.

<HAS-TOOL>

Used to suppress unnecessary output when an


operation does not have a tool (such as bar feed).

<ID>

True for Inside Diameter operations.

<IDOD-GROV>

Used to differentiate among G codes that are


specialized for grooves on ID (inner diameter), OD
(outer diameter), or those on the FACE as shown in
the examples below:
<IFNOT><IDOD-GROV>
Implies that a Face Groove Cycle program
format block is output.
<IF><IDOD-GROV>
Implies that an ID, or OD Groove Cycle format
block is output.

<IS-FOLLOW>

124 Turn posts

True if the operation uses follow turning.

Xbuild Reference Manual

Reserved word

Definition

<IS-INC-MAC>

True if incremental macros are enabled in the


feature Properties - Strategy dialog.

<IS-PINCH>

True if the operation uses pinch turning.

<IS-SYNCED>

True if turrets are synced.

<LAST-TOOL>

True if the current tool is the very last tool in the


program.

<LEFT-HANDED>

True if the current tool is left handed.

<MAIN-SPCMD>

True if the current spindle is the main. False if the


subspindle is the current spindle.

<MAIN-SPNDLE>

True if main spindle is current spindle.

<OD>

True for Outside Diameter operations.

<OFFSET-CH>

Normally used in a Segment Start block; true if


the OFFSET# is changed between segments:
<IF><OFFSET-CH><THEN>
{N<SEQ>}T{<COMP-NUM>}
<TOOL><OFFSET#><EOB>
<ENDIF>

<POS-DIR>

True if the operation is cutting in a positive


direction.

<POST-RCAN>

True for the moves after rough canned cycle.

<PRE-GCAN>

True for the last move before groove canned cycle.

<PRE-PCAN>

True for the moves before finish canned cycle.

<PRE-RCAN>

True for the moves before rough canned cycle.

<RANGE-CH>

Normally used in a Segment Start block, and is


true if there is a change in gear range:
<IF><RANGE-CH><THEN>
{N<SEQ>}MO5<EOB>
{N<SEQ>}<SP-RANGE><EOB>
{N<SEQ>}S<CALC-SPEED>
<SPINDLE-ON><EOB>
<ENDIF>

Xbuild Reference Manual

Turn posts 125

Reserved word

Definition

<REUSE-PATH>

True if the Reuse path in Canned cycle check


box is selected in Turn properties.

<RIGID-TAP>

True if rigid tap cycle is selected in feature


properties.

<SPNDLEPRESS>

True if using a pushing/pressing or skip function


when transferring a part from one spindle to
another.

<TAPER>

True for tapered threads.

<TCAN-CYCLE>

True if inside a turning canned cycle.

<TCAN-END>

True for last move in the profile.

<TCAN-START>

True for first move in the profile.

<TH-ATSUBPOS>

True if turret home format is called because of


subspindle position where subspindle is moving
closer to the main spindle.

<TH-ATTOOLCH>

True if turret home format is called because of tool


change.

<TOOL-LEFT>

True if the tool is on the left of the cutting path.

<UNDER-CHECK>

True if the Undercut Check check box is selected


in turn properties.

126 Turn posts

Xbuild Reference Manual

Turning string reserved words


Reserved word

Definition

<AIR-BLAST>

Returns the proper air-blast codes from the CNCInfo - NC Codes dialog according to selections
from the Misc. feature creation page.

<BOL>

Beginning of line identifier. Used to indent line in


NC code output. Indents line by spacing amount
between <BOL> and rest of line.

<CANCEL-COOL>

Used to output NC code turning off coolant at end


of operation. See the CNC-Info - Coolant dialog.

<COMP-STAT>

Returns the applicable code from the CNC-Info NC Codes dialog, when tool nose radius
compensation is selected in the Turn Properties
dialog (for example G41, G42).
Turns On at the first feed move of the profile path.

<COOLANT>

Returns the coolant 'turn on' code for the selected


turret from the CNC-Info - Turrets dialog.

<COOLANT-3>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<COOLANT-4>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<COOLANT-MST>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<COOLANT-OFF>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<COOLANT-ON>

Returns string from the Xbuild CNC-Info - NC


Codes dialog.

<DATE>

Returns the date that NC code was posted.

<EOB>

Specifies the end of block code on each line of a


format.

<FM-NAME>

Returns the name of the FeatureCAM file.

Xbuild Reference Manual

Turn posts 127

Reserved word

Definition

<F-UNITS>

Returns the applicable code for feed per revolution


or feed per linear unit feed rates from the CNCInfo - Feeds&Speeds dialog. For example, G99,
G98.
Feed rate per revolution can be selected in the Turn
Properties - Feeds&Speeds dialog.

<FIXTURE>

Returns the current fixture offset code from the


CNC-Info - Fixture ID dialog.

<MACH-TIME>

Returns the estimated time required to machine


part.

<MCSID>

Returns the current setup name. Name can be


changed in part view and in setups.

<MOTION>

Returns the applicable motion code for the current


move from the CNC-Info - NC codes dialog.

<OP-PASS>

Returns Rough or Finish based on the type of pass.

<OP-TYPE>

Returns the current operation type name, for


example turn, groove.

<P1>...<P9>

User-definable parameters passed from the


particular Feature Properties - Post Vars
dialog.
Assigned to perform specific actions that are not
normally handled as standard functions.

<PGM-STOP>

Returns string from Xbuild Spindles dialog. Used


to stop program to flip part in chuck or vise to
machine other setups.

<PRO-COMP>

When tool tip compensation and canned cycle


status is selected, <PRO-COMP> returns the
applicable code from the CNC-Info - NC Codes
dialog to establish a right/left tool relationship with
the part, and turns On at the first feed move of the
profile path.

<PRO-FUNITS>

Used within a Turning Canned Cycle format to


return applicable code for feed per revolution or
feed per linear unit, for example G99, G98.

128 Turn posts

Xbuild Reference Manual

Reserved word

Definition

<PROG-NAME>

Returns the part name from the setup definition


from FeatureCAM Setups dialog.

<REGION-DATE>

Returns the date in the regional format (for


example, British DD/MM/YY instead of
MM/DD/YY) specified in Windows.

<SEG-CMT>

Returns a user input comment from the particular


Feature Properties - Post Vars dialog.

<SEGM-ID>

Returns the name of the current feature from the


part view in FeatureCAM.

<SPINDLE>

Returns the applicable code for spindle rotation


direction from the CNC-Info - NC Codes dialog,
for example M3, M4.

<SPNDLE-SEL>

Returns the applicable code to select main or sub


spindle from the CNC-Info - Spindles dialog.

<SPDL-SYNCRN>

Spindle synchronization status. Valid in the spindle


synchronize format. Returns the synchronize code
from the Xbuild Spindles dialog.

<SP-RANGE>

Returns code to engage applicable speed range


from the CNC-Info - Feeds&Speeds dialog.

<TIME>

Returns the time when the NC code was posted.

<TOOL-CMT>

Returns the user input comment from Tool


Properties - Overrides dialog.

<TOOL-ID>

Returns the tool ID from Tool Mapping dialog.

<TOOL-NAME>

Returns the name of the current tool from Tool


Manager dialog.

<TOOL-ORIENT>

Returns the tool orientation prefix from the


<TOOL-NAME> for turning tools only, for
example SW, NE.

<TRT-TURN>

Returns the applicable code for a CW or CCW


turret rotation from the CNC-Info - Turrets
dialog.
Corresponds to the Turret Direction parameter
from the Feature Properties - Tool Usage
dialog.

Xbuild Reference Manual

Turn posts 129

Reserved word

Definition

<TURRET>

Selects the programmed turret.


Corresponds to the Turret parameter from the
Feature Properties - Tool Usage dialog.

<UDF-COMMENT>

Used in the UDF Text format to return a comment


from an add in macro which creates a user defined
feature.

<UDF-TEXT>

Used in the UDF Text format to return a specific


code from an add in macro which creates a user
defined feature.

<UNITS>

Returns the proper unit code from the CNC-Info NC Codes dialog.

Relationship between FeatureTURN


and Xbuild
This section explains how the parameters that are defined in
FeatureTURN correspond to Xbuild reserved words, and how these are
handled when NC is pressed.

Roughing and profiling cycles


Post applies the offset and other cycle data parameters that are
appropriate to the cycle. Xbuild provides the <X-COORD> and <ZCOORD> reserved words to receive the path coordinate data. Additional
reserved words: <ARC-X>, <ARC-Z>, <X-CEN>, <Z-CEN>,
<RADIUS>, and <S-RAD> are provided by Xbuild to receive the
circular interpolation modifiers that are needed for arc moves.

Start/end points
If start or endpoints have been defined in FeatureTURN, they become
part of the path's definition. Post generates a rapid move from a start point
to the first part of the machining operation, and a rapid move from the last
move of the operation to the endpoint is also generated.

130 Turn posts

Xbuild Reference Manual

Other reserved words


Optional sequence numbering is defined in Post, and is placed at the
beginning of any block that contains the reserved word <SEQ>.
The end of block character (a control code that signals a completed line)
is defined by the <EOB> reserved word.

Computed tapping cycles


For computed tapping cycle to work correctly, the Spindle format in
Xbuild has to be completed. The <SPINDLE> reserved word also needs
to be added to the Linear format.
Example Spindle format:
{N<SEQ>}<SPINDLE><EOB>
Example Linear format:
{N<SEQ>}{<F-UNITS>}{<COMP-STAT>}{<MOTION>}
{X<X-COORD>}{Z<Z-COORD>}{F<FEED>}{<SPINDLE>}
<EOB>
See also Tapped canned cycle (see page 112).

Xbuild Reference Manual

Turn posts 131

Turn/mill posts
This section describes how to use Xbuild for writing turn/mill posts.

CNC-Info menu
The CNC Info options are used to set up the basic parameters for a CNC
program:
General - specifies the output program format.
NC Codes - defines the exact character string for different NC
commands.
Feeds & Speeds - changes the minimum and maximum spindle
speeds and feed rates in a CNC program.
Fixture ID - this is a list with valid fixture IDs.
Words-N - configures the format of numeric reserved words.
Turrets - describes all of the turrets on a lathe.
Spindles - contains the M codes for selecting the spindles.
Cycles - specifies the manner in which drilling, threading and
grooving cycles are handled.

132 Turn/mill posts

Xbuild Reference Manual

CNC-Info menu - General


Allows you to specify the output program format. The General
Information dialog appears.

Be sure to select Turn/Mill in the Machine Type field to see the


appropriate options.
Any parameter may be changed by selecting it, typing the value, or
toggling to the desired selection (if a new value is entered, press Enter).
The comment block describes the post processor.
These values are default values when no CNC data file has been
loaded into the Xbuild program. When a file is loaded, several or all
of these values may change.
You can set the following parameters:
Machine type - classifies the type of post.
The choices are:
Milling - use this type of post for 2.5D or 3D milling.

Xbuild Reference Manual

Turn/mill posts 133

Turning - use this classification for 2-axis turned parts.


Turn/Mill - use this type of post for lathe with powered rotary
tools.
Wire EDM - use this type of post for Wire EDM machines.
This distinction controls type of reserved words and program formats that
are available in the post.
Dimension - toggles between Inch and Metric output.
Post uses the selection to convert the dimensions that affect X and Y
coordinates as well as feed rate. The setting in the CNC Data file takes
precedence over the assumed inch unit in FeatureCAM. If a part program
is written in inch units, and is processed with a metric CNC data file, the
resulting part program is converted (using standard conversion constants)
into metric units.
Circ. interpol. - selects the programming format on the CNC for which
the post processor is being built.
You can choose Multi-Quadrant, Single Quadrant, or Not
Supported option, as appropriate. For example, if the Numerical
Control cannot drive an arc across a quadrant line (plus or minus X and Y
axes), then select Single Quadrant circular interpolation. When circular
interpolation is turned off in post, then wrap tolerance is used to control
fineness of toolpath.
EOB - defines the end of block character(s), or <EOB>.
We recommended that you use the default characters, that is, <13>
(carriage return) and <10> (line feed).
Decimal point - defines the decimal point character.
This character is usually a period '.' for United States controls, and
a comma ',' for European controls.
Dogleg rapid moves - affects simulation only.
If this option is selected, then during a rapid move from point A to point
B both simulated axes will move at the maximum rate until one of the
axes moves is completed, and then the machine will proceed to B with
only the other axis continuing in a straight line.
If this option is not selected, then the simulation shows all rapid moves
from point A to point B as straight lines. In general, rapid moves on
machines are not straight lines.
B Axis Support - select this check box for those machines which have
a B axis that allows tools to engage part at various angles.

134 Turn/mill posts

Xbuild Reference Manual

B-Axis range is - select your B-Axis range.


Use WCS for B-Axis on OD - select this check box to use a work
coordinate system for the B Axis even for an OD feature.
Rotary Tool frame
Max. macros - specifies the maximum number of macros (subprograms) available on the control.
If macros are not available, set this value to zero, and select Not
Available in the Macro Type parameter.
Macro type - specifies how macros are formatted when the part program
requires them.
Choose from the following options:
Local - places macro definitions within the main NC part
program.
End of Prog. - places macro definitions at the end of the main
part program (for example, Heidenhain controls). The PROGRAM
END program format should be specified for output at the end of
the main program and the FILE END program format should be
specified for output at the end of these macro definitions.
Not Available - signals Post that macros are not available.
Indiv. Files - places macro definition in a separate file (for
example, FANUC and GE MC 2000 controls). The name of each
macro file consists of the assigned name that was specified in Post
and the system-assigned macro number The internal sub-program
name is automatically added to the main program name as the
external file name.
One File - places all macro definitions in one file. Post generates
two files, the main part program and a file containing all macros.
This option can output to Bridgeport controls via the EZ-Utils
module, CNCCOMMUNICATION option (Heidenhain DNC
utility).
The name of the macro file consists of the assigned name specified in
Post, MA (representing the macro specification) and the .TXT file
extension. For example, SAMPLEMA.TXT (macro file) and
SAMPLE.TXT.
Call local macro after it is defined - automatically executes macro
when it's defined.

Xbuild Reference Manual

Turn/mill posts 135

Some controls (such as the Heidenhain 370) automatically execute


macros when they are defined. For these controls deselect Call local
macro after it is defined so that the macro is not called twice. For
other types of controls, leave this option selected.
Include first canned cycle move in macro - outputs the current
position as the first location of a macro.
Without this selected, the first move will not be in the macro, instead it is
assumed that it is output on the canned cycle line.
To properly include the first move in a macro, you will need to use a
combination of this check box and the logical variable <CYCLEMACRO> to suppress actually performing the canned cycle on the
canned cycle line.
For a Fanuc 0M, if a canned cycle line ends with K0 then the machine
goes into canned cycle mode, but the actual canned cycle is not
performed. Here is the drilling format for the Fanuc 0M.
{N<SEQ>}<CYCLE>{X<X-COORD>}{Y<Y-COORD>}
R<ABS-ZCLEAR>Z<ABS-DEPTH>F<FEED>
<IF><CYCLE-MACRO><THEN>
K0
<ENDIF>
<EOB>
The Include first canned cycle move in macro check box
must be selected so that the initial location is output in the macro.
Post supports local coordinates - post that redefines the coordinate
system using datum shifts should have this option selected.
Post supports incremental macros - posts that program milling
macros in an incremental fashion should have this option selected.
Seq max - this is the maximum value for sequence numbers.
After reaching this number, the sequence numbers start over. If the Seq
max radio button is not selected, then no limit is set.
NC file extension - the default file extension for you CNC programs.
For example if it is set to .txt, and your part is called 'bracket', then the
G-code file will be called bracket.cnc.
Polar interpolation done by - selects how the polar interpolation is
performed.
The two options are:

136 Turn/mill posts

Xbuild Reference Manual

FeatureCAM - in this case, the polar interpolation will be


performed by FeatureCAM. That means that Cartesian coordinates
are mapped into polar coordinates by FeatureCAM prior to being
sent to the post.
Machine Tool - FeatureCAM will send Cartesian coordinates to
the post processor. The formats of post processor must be
configured to request polar interpolation from the machine control.

CNC-Info - NC Codes
Specifies the exact character strings for different NC commands. The NC
Codes dialog appears.

The character strings entered in the dialog must match the required
strings specified for the NC control. This information is usually
found in the programmer's manual for the NC control.
You can set the following parameters:
Motions - the options in this frame describe motion types required by
the NC machine. All of these codes must be specified.

Xbuild Reference Manual

Turn/mill posts 137

For example, Linear is generally defined as G1, but may be changed to


G01, or any other string (up to 11 characters). All motion commands are
passed to Post via the string reserved word <MOTION>.
The following options are available:
Rapid - rapid move.
Linear - feed move.
Circ. CW - circular interpolation, clockwise.
Circ. CCW - circular interpolation, counter-clockwise.
XY, UV - refers to Wire EDM 4-axis movements using an upper
and a lower curve. Typically, XY represents the curve at the
bottom of the part, and UV represents the curve at the top of the
part.
This option is only available for wire EDM posts.
Compensation - generates cutter diameter compensation in the output
when turned On in FeatureCAM, and if it is built into the CNC data file.
Compensation selections use the string reserved word <COMPSTAT> for one of the below options, or an empty string is assigned if
Compensation was not turned On in corresponding program (for
example, FeatureCAM, FEATUREWIRE and so on).
The Compensation frame has these options:
Cancel - compensation off.
Left - compensation on cutter, applied to left in direction of travel.
Right - compensation on cutter, applied to the right in the
direction of travel.
3D - code for turning 3D cutter compensation on. Linear X, Y , Z
motions have a vector component of the tool diameter added
according to the direction vector defined by I, J, K.
This applies to finishing moves only.
This code does not apply to Wire EDM.
Cancel 3D - turns off 3D cutter compensation.
This code does not apply to Wire EDM.
Thread - code for single point threading cycle.
Style - select single line or step (multiple) line thread cycle.

138 Turn/mill posts

Xbuild Reference Manual

Circular planes - is used for circles described in XY, ZX, YZ Cartesian


planes.
Pecking - selects types of pecking performed for drilling and tapping.
Rotary tool - the options in this frame deals with coolant specifications.
This section of NC codes is only displayed for turn/mill posts.
The available options are:
Cool OFF - coolant off.
Cool Mist - coolant on, mist.
Cool Flood - coolant on, flood.
Coolant 3 - user-configurable coolant code (for example, you can
use it to turn on the air blast).
Coolant 4 - user-configurable coolant code.
Coolant selections use the string reserved word <COOLANT>.
Cycles - the options in this frame describe canned cycles formats.
They are used for header, canned motion and cycle cancel blocks. The
header block (for all canned cycles) must contain formats to position
down to the clearance plane to drill the first hole.
Drill - specifies the header block for a drilling cycle.
Spot Face - specifies header block for a spot face cycle.
Deep - specifies a deep hole cycle header block.
Tap - specifies the header block for a tapping cycle.
Chip Break - specifies the header block for a chip break cycle.
Bore (F-D-F) - specifies a boring (feed-in, dwell, feed-out) cycle
header block.
Bore (F-F) - specifies a header block for a boring (feed-in, feedout) cycle.
Bore (F-S-R) - specifies a boring (feed-in, stop spindle, rapid)
cycle.
Bore (No Drag) - specifies a boring (feed-in, stop spindle, move
to side, retract) cycle.
Z rapid retract - when using canned cycles, causes tool to retract
to <ZRAPID> plane.
R plane retract - when using canned cycles, causes tool to retract
to <ZCLEAR> plane.

Xbuild Reference Manual

Turn/mill posts 139

CNC-Info menu - Turrets


Defines all of the turrets on a lathe. The Turret Information dialog
appears.

You can set the following parameters:


Multi-turret programming - indicates the style of multi-turret
programming that is available on this machine. If the lathe only has a
single turret, select None. For Okuma style lathes with multiple turrets
that requires a single part program for all of the turrets, select Okuma.
For Fanuc style multi-turret lathes that desire a separate output file for
each turret, select Fanuc.
Synch Number Start - this is the initial M code number that is
reserved for synchronization codes (also called wait codes). Most
machines reserve all M codes above a certain number for synchronization
codes.
Synch Number Increment - this is the increment between
synchronization codes.

140 Turn/mill posts

Xbuild Reference Manual

Turret Rotation Auto - automatically rotates turret to next tool shortest


direction.
Turret Rotation CW - rotates turret to next tool CW.
Turret Rotation CCW - rotates turret to next tool CCW.
FeatureCAM can support up to four turrets. Each turret location is
represented as either Main Spindle Side Upper Turret, Main
Spindle Side Lower Turret, SubSpindle Side Upper Turret or
Main Spindle Side Lower Turret. Select the check boxes that apply
to your specific machine, and then specify the following parameters for
each spindle if they apply:
Coolant On - turns on the coolant.
Coolant Off - turns off the coolant.
Can address main spindle - select if the turret can cut on the
main spindle.
Can address sub spindle - select if the turret can cut on the
subspindle.
Can hold live tools - select if the turret can hold drills or mills
that can spin.
Can hold B axis tools - select if the turret can hold tools that
can rotate around the Y axis.
C Angle Offset - indicates the C angle for the tool at its start
position. Typically upper turrets should be at 0 degrees and lower
turrets will be at 180 degrees.
Z and X distances between turrets are signed values measured from
the primary turret reference point to the secondary turret reference
point. The turret reference points are always the locations from
which the tool lengths are measured.

Xbuild Reference Manual

Turn/mill posts 141

CNC-Info menu - Spindles


Contains the M codes for selecting the spindles. The Spindle
Information dialog appears.

You can set the following parameters:


Select Main Spindle - code for selection of main spindle.
Select Sub Spindle - code for selection of sub spindle.
Main and sub spindles have the same Z axis direction check
box - select if the Z directions are the same for both spindles.
If this check box is not selected, it is assumed that the Z directions
are opposite.
Machine Z coordinate at subspindle home - value for Sub Z home
(typically zero).
Machine Z coordinate at subspindle max (left) - value for Sub Z
max (from machine builder).
Synchronize frame - code for synchronizing spindles.
The Synchronize frame has these options:
Turn Speed - code for synchronizing the speed on both spindles.
Turn Phase - code for synchronizing the phase on both spindles.
Turn Off - code for turning off spindle turn synchronizing.

142 Turn/mill posts

Xbuild Reference Manual

CNC-Info menu - Feeds and Speeds


These parameters are used to specify the spindle direction, feed units and
the speed range codes that are required by the machine. The Feeds and
Speeds dialog opens.

You can set the following parameters:


Feed max and Feed min are the feed rate limits when specified in Feed
Per Minute.
Degrees/Minute Max and Degrees/Minute MIN are the feed rate
limits when specified in degrees per minute.
Range 1- Range 4 - are for lathes that have speed ranges. For each
range, enter the M-codes for selecting the range and the maximum speed
for the range.
UPM (Units per Minute) and UPR (Units per Revolution) describe the
feed rate in terms of UPM or UPR (or the spindle). Only one option at a
time is used by Post, depending upon FeatureTURN's segment data.
Spindle CW (clockwise) and Spindle CCW (counter-clockwise)
describe the spindle On and direction code. Both of these selections use
the string reserved word <SPINDLE> to specify spindle On and
direction.
Spindle Dir may be specified in FeatureTURN with a negative, or
positive spindle RPM value. A negative value specifies a CCW
direction, while a positive value specifies a CW direction.
When CSS is turned on in FeatureTURN, the spindle speed is
limited to the maximum set for the appropriate speed range set here.

Xbuild Reference Manual

Turn/mill posts 143

CNC-Info menu - Cycles


Specifies the manner in which drilling, threading and grooving cycles are
handled. The Cycles Information dialog opens.

You can set the following parameters:


Groove simple - if this option is selected, a groove is output as series
of computed moves. Or, in the case of a straight walled dimensioned
groove, the roughing operation is output as a canned cycle.
Groove canned - if this option is selected, the curve is output in the
NC code twice and the roughing and finishing canned cycles reference
the curves. If reuse path is selected then the curve is output only once and
the roughing and finishing cycles reference the same curve.
Grooving has only limited canned cycle support. Only roughing of
straight-walled grooves are output as a canned cycle. This applies
to grooves with Chamfer = 0, Angle = 0 and Radius = 0.
When Canned is selected, a format for a canned threading, drilling, or
tapping cycle is defined, which is output by Post only one time. If
Computed is chosen, the drilling, threading, or tapping move definitions
are output as the respective cycle's pass for each step.

144 Turn/mill posts

Xbuild Reference Manual

CNC-Info menu - Fixture ID


Records the various G codes that are valid fixture ID's. The Fixture ID
dialog opens. You can type the appropriate IDs directly into the list, and
click OK.

An example list might be:


51
52
53
54
55
FeatureCAM will automatically look in the current post processor and
will assign the next available fixture ID to a new setup and to the numeric
reserved word <FIXTURE>.

Xbuild Reference Manual

Turn/mill posts 145

CNC-Info menu - Five-Axis


Selects the five axis machine type. The Five-Axis dialog opens.

FeatureCAM supports the following machine architecture:


C turning spindle and B tilting head - rotates about the
turning spindle in C and then the milling head rotates about B.
The machine needs to have automatic correction of tool
length offset, and have support for 3D coordinate transforms.
This is because FeatureCAM outputs the toolpath in a
coordinate system that has the same Z direction as the setup,
so the machine needs 3D coordinate transformation to
transform the toolpath back into the machine's coordinate
system. Also, because the tool length offset changes from the
tilting of the tool, the machine needs automatic correction of
tool length offset to correct that.
Machine dimensions for linearization:
Offset of gauge face from second rotary axis for
turn/mill machine, it's the X Y Z offset from the B axis to the
gauge face.
Linearization settings for 5-axis simultaneous:

146 Turn/mill posts

Xbuild Reference Manual

Use linearization if selected, each move is refined into smaller


moves so that the angular movements do not result in an overcut.
Linearization tolerance the tolerance linearization uses to
refine the moves.

Defining turn/mill formats


For each segment of a part program, parameters and calculated values are
passed via the reserved words from the program formats. These program
formats act as a template; they are sequentially filled (that is, the reserved
words are substituted by their corresponding values, G and M codes) as
the part data file is post-processed.

General structure
For Program Start, Tool Change, Rapid and Z Rapid formats the
general logical flow is to handle turning and milling in separate sections.
For milling, use the <ROTARYX> reserved word to distinguish between
face milling and OD milling.
<IF><TURNING><THEN>
[* Do turning tasks]
<ENDIF>
<IF><MILLING><THEN>
<IF><ROTARYX><THEN>
[* Do OD milling tasks]
<ENDIF>
<IFNOT><ROTARYX><THEN>
[* Do Face milling tasks]
<ENDIF>
<ENDIF>

Program start format and tool change format


For milling moves, you must enable the C-axis and orient the C-axis in
both of these formats.
Here is an example for the Acramatic 850 TC:
<IF><MILLING><THEN>

Xbuild Reference Manual

Turn/mill posts 147

{N<SEQ>}M21<EOB>
{N<SEQ>}S<SPEED><SPINDLE> <EOB>
{N<SEQ>}C<ROT1-WIND><EOB>
<ENDIF>

Rapid move
Rapid moves should include the C axis move as shown below:
{N<SEQ>}{<MOTION> }{X<X-COORD>}
{Z<Z-COORD>}
<IF><MILLING><THEN>
{C<ROT1-WIND>}
<ENDIF>
For posts where the machine tool is performing the polar interpolation,
the post will still have to perform the polar interpolation for positioning.
In the example below, the C and X coordinates are calculated using the
anglexy and radiusxy functions.
<IF><MILLING><THEN>
<IFNOT><ROTARYX><THEN>
{<MOTION>}C[anglexy(<X-COORD>,<Y-COORD>)]
X[radiusxy(<X-COORD>, <Y-COORD>)*2]
{Z<Z-COORD>}<EOB>
<ENDIF>
Also refer to Fourth and fifth axis support (see page 88).

Linear move
For machines in which FeatureCAM is doing the interpolation the
formats must be conditional on whether it is a turning or milling move.
Case 1
In the milling case, the C-axis rotation and the angular feedrate must be
output. The following is an example from the Acramatic 850TC:
<IF><TURNING><THEN>
{X<X-COORD>}{Z<Z-COORD>}F<FEED><EOB>
<ENDIF>From

148 Turn/mill posts

Subject

Received

Size

Xbuild Reference Manual

Chris Murray

ArtCAM Case Study Competiton

11:26 15 KB

<IF><MILLING><THEN>
{X<X-COORD>}{Z<Z-COORD> }{C<ROT1-WIND>}
{F<ANG-FPM>}<EOB>
<ENDIF>
Case 2
For machines in which the controller performs the interpolation, make
sure to select the Polar interpolation done by machine tool check
box in the General Information dialog. This changes the toolpaths as
they are output from FeatureCAM into the post. Here is an example for a
Fanuc 16, 18 or 21:
<IF><TURNING><THEN>
{X<X-COORD>}{Z<Z-COORD>}F<FEED><EOB>
<ENDIF>
<IF><MILLING><THEN>
{X<X-COORD>}{C<Y-Coord>}{Z<Z-COORD>}
{F<FEED>}<EOB>
<ENDIF>

Turn/mill reserved words


In general, milling reserved words are available in turn/mill mode when a
milling feature is being processed. The same thing is true for turning
reserved words.
The following are some exceptions:
The milling reserved words <CYCLE>, <PLANE>, <XYPLANE>, <ZX-PLANE>, and <YZ-PLANE> are also available
for turning features in turn/mill mode.
The turning reserved words <SP-RANGE>, <F-UNITS>, and
<RANGE-CH> are also available for milling features in turn/mill
mode.
The milling reserved words <X-VECTOR>, <Y-VECTOR>, and
<USE-FIXTURE> are not available in turn/mill mode.
The turning reserved words <X-VECTOR> and <Z-VECTOR>
are not available in turn/mill mode.

Xbuild Reference Manual

Turn/mill posts 149

When Xbuild is in the turn/mill mode, the Reserved Words


dialog is color-coded to indicate the availability of the reserved
words.

Turn/mill numeric reserved words


The following numeric reserved words are only available in turn/mill
posts.
Reserved word

Definition

<ANG-DPMNOFR>

Wrapped feed rate, degrees per minute, no feed rate


reduction.

<ANGLEXY>

Returns the angle of the point <X-COORD>,<YCOORD> on the front face of the part. Replaces
anglexy() function. Used to determine the angular
position of holes on the Z face of the part. The X
axis of the part is 0 degrees.

<BAXIS-ROT>

Returns the angle by which the B-axis tool is


rotated. This is not the same as the B-angle of the
tool.

<RADIUSXY>

Returns the distance or radius of the point <XCOORD>,<Y-COORD> from the center of the
part. Replaces the radiusxy() function. Used to
determine the angular position of holes on the Z
face of the part.

<SYNC-NEXT>

Returns the next available sync code and


increments the internal current sync number.

Turn/mill logical reserved words


The following logical reserved words are only available in turn/mill posts.
Reserved word

Definition

<4-AXIS-OPER>

True if operation is 4 axis simultaneous.

<5-AXIS-OPER>

True if operation is 5 axis simultaneous.

<COMP-3D-ON>

True if 3D cutter comp is active.

150 Turn/mill posts

Xbuild Reference Manual

Reserved word

Definition

<CUTOFF-CHECK> True if the Cutoff check check box is selected in


the Position the spindle page of the
Subspindle transfer feature (available for Turn
and Turn/Mill posts). Checks for lack of torque
between spindles to check part has been cut into
two pieces, before the subspindle is sent home.
Avoids damage to jaws and part which would result
if Cutoff process was incomplete and the
subspindle went home.
<EJECT-CHECK>

True if the Eject check check box is selected in


the Position the spindle page of the
Subspindle transfer feature (available for Turn
and Turn/Mill posts). Causes the machine's 'Eject
checker' probe to check that the previous part has
been ejected before grabbing the part from the
opposite spindle. Avoids damage if the part has not
been ejected.

<HAS-TOOL>

True if the turning operation has a tool associated


with it, otherwise <HAS-TOOL> is False.

<IS-FOLLOW>

True if the operation uses follow turning.

<IS-MFDOC>

True for multiple fixture documents.

<IS-PINCH>

True if the operation uses pinch turning.

<IS-SYNCED>

True if turrets are synced.

<MILLING>

True if current feature is a Milling feature.

<ROTARY-OD>

True if active tool is a rotary x tool. Applies to


drilling and milling.

<SPINDLEPRESS>

True when Use Push/Press function is selected


on the Position the spindle page of the
Subspindle transfer feature. On those machines
with this option, it serves to apply pressure on the
part by having the sub push the part into the Main
spindle jaws, thus seating the part more accurately
into the subspindle jaws during transfer.

<TURNING>

True if current feature is a Turning feature.

Xbuild Reference Manual

Turn/mill posts 151

Reserved word

Definition

<USE-ROTFEED>

True if the linear move format should use DPM


feed rate instead of linear feed rate. Replaces test of
<IF><WRAP>. Set for wrapped, 4axis simul, and 5
axis simul operations. True only if there is an
angular rotation for this move.

<ZFACE-POLAR>

True if the segment uses polar interpolation on the


zface of the part.

<ZFACE-YAXIS>

True if cut feature using Y coordinates check box in


feature properties dialog is selected. Machine must
have Y axis to use this option.

Turn/mill string reserved words


The following string reserved words are only available in turn/mill posts.
Reserved word

Definition

<AIR-BLAST>

Returns the proper air-blast codes from the CNCInfo - NC Codes dialog according to selections
from the Misc. feature creation page.

<CANCEL-COOL>

Used to output NC code turning off coolant at end


of operation. See the CNC-Info - Coolant dialog.

<CLAMP-ON>

Clamp/brake status word. Returns the clamp on or


brake on reserved word (from Xbuild Spindles
dialog) for the current spindle when they need to be
turned on after a C rotation change. See also
clamping reserved words (see page 153).

<CLAMP-OFF>

Clamp/brake status word. Returns the clamp off or


brake off reserved word (from Xbuild Spindles
dialog) for the current spindle when they need to be
turned off before a C rotation change. See also
clamping reserved words (see page 153).

<MAIN-BK-OFF>

Returns string from Xbuild Spindles dialog to


turn main spindle brake off.

<MAIN-BK-ON>

Returns string from Xbuild Spindles dialog to


turn main spindle brake on.

152 Turn/mill posts

Xbuild Reference Manual

Reserved word

Definition

<MAIN-CL-OFF>

Returns string from Xbuild Spindles dialog to


unclamp main spindle.

<MAIN-CL-ON>

Returns string from Xbuild Spindles dialog to


clamp main spindle.

<SUB-BK-OFF>

Returns string from Xbuild Spindles dialog to


turn sub spindle brake off.

<SUB-BK-ON>

Returns string from Xbuild Spindles dialog to


turn sub spindle brake on.

<SUB-CL-OFF>

Returns string from Xbuild Spindles dialog to


unclamp sub spindle.

<SUB-CL-ON>

Returns string from Xbuild Spindles dialog to


clamp sub spindle.

Turn/mill clamping reserved words


The clamping reserved words <CLAMP-ON> and <CLAMP-OFF> have
sophisticated functionality within FeatureCAM that requires special
considerations in the post. In order to get correct results, the post author
must:
use the <CLAMP-ON> reserved word in the Canned Cycle Move
format.
use the <CLAMP-ON> reserved word in any drilling canned cycle
formats that will be used.
<CLAMP-ON> is required in both the drill format and canned move
format in order to output clamping codes on individual moves in the
canned cycle. If <CLAMP-ON> is not present, the clamping codes will
only be output once in the segment start section for the canned cycle and
will not work for combined cycles.
The <CLAMP-ON> word will be active for milling cycles if there is a
change in the C angle. If there was no change, the modality brackets will
prevent the M code from being output. FeatureCAM figures out the
correct main/sub spindle and brake/clamp code.

Xbuild Reference Manual

Turn/mill posts 153

The <CLAMP-OFF> word will be active if clamping is currently on and


needs to be turned off. This happens if we switch to turning mode or if
there is a C angle change.
The following examples summarize the recommended use of the
clamping reserved words in various formats of a post. Note that all of
these reserved words should be in modality brackets.
Program Start format:
If milling
XYZC
{<CLAMP-ON>}

Segment Start and Tool Change formats:


{<CLAMP-OFF>}
If milling
XYZC
{<CLAMP-ON>}

Rapid and Z Rapid formats:


If milling
{<CLAMP-OFF>}
XYZC
{<CLAMP-ON>}

Drilling canned cycles:


G81 .. {<CLAMP-ON>}

Canned Move format:


X Y Z C {<CLAMP-ON>}

154 Turn/mill posts

Xbuild Reference Manual

Cycle Cancel format:


<CLAMP-OFF> is available in the canned cycle cancel format, but is not
required.

Xbuild Reference Manual

Turn/mill posts 155

Multi-turret turning
posts
This section describes how to use Xbuild for writing multi-turret turning
posts.

Multi-turret reserved words


Reserved
words

Type

Definition

<SYNC-NUM1>

Numeric

These are the synchronization codes


associated with the current operation.

through

If these variables are blank, they will not be


output.

<SYNC-NUM5>
<SYNC-SPEED>

Numeric

For use in Okuma style multi-turret posts


only, this variable contains the
synchronization code for a change in
spindle speed. The sync code must be
output on the same line as the spindle
speed.

<TURRET-NUM>

Numeric

The number of the turret that is active for


the current operation.

156 Multi-turret turning posts

Xbuild Reference Manual

Defining multi-turret posts


Synchronization codes that are associated with an operation must be
output at the beginning of the operation. FeatureCAM allows up to five
synchronization codes to be associated with a single operation. The
following lines must appear in the Program Start, Tool Change,
Segment Start and Program End program formats:
{M<SYNC-NUM1>}<EOB>
{M<SYNC-NUM2>}<EOB>
{M<SYNC-NUM3>}<EOB>
{M<SYNC-NUM4>}<EOB>
{M<SYNC-NUM5>}<EOB>
Theses variable are specially programmed so that they are not
output if the variable is blank.

Synchronizing spindle speed changes on Okuma


lathes
For Okuma lathes, the Program Start, Tool Change, and Segment
Start formats must output a special sync code along with a change in
spindle speeds.
A sample from a Segment Start format for an Okuma post is shown
below:
<IF><CSS-ON><THEN
G96 S<CSS-SPEED><32>
<ENDIF>
<IFNOT><CSS-ON><THEN>
G97 S<CALC-SPEED><32>
<ENDIF>
<SPINDLE><COOLANT>{P<SYNC-SPEED>}
<EOB>
<MOTION> X<X-COORD> Z
<Z-COORD><EOB>
<ENDIF>

Xbuild Reference Manual

Multi-turret turning posts 157

Pinch and follow turning


For pinch and follow turning, the Linear move and Canned Cycle
formats must be altered. To support inserting wait codes at every scan
line, you must output the sync code in the Linear format as follows:
<IF><TCAN-START><THEN>
Z<Z-COORD> F<PRO-FEED>{M<SYNC-NUM1>}
<EOB>
<ENDIF>
To support the output of sync codes at the start of the canned cycle the
sync code must be output in the Canned Cycle Start as shown below
for a Mori Seiki with a Mitsubishi control:
<IFNOT><FACE-BFACE><THEN>
{M<SYNC-NUM1>}<EOB>
G71 U<DEPTH> R<RTR-LENGTH><EOB>
G71 P<SEQ-START> Q<SEQ-END> U<X-ALLOW>
W<Z-ALLOW> {F<FEED>}<EOB>
<ENDIF>
The Canned Cycle Start format must be altered to support outputting a
synchronization code at the beginning of the canned cycle as shown
below. Only one synchronization code is possible, so you need to only
print out a single wait code.
{M<SYNC-NUM1>}<EOB>
G70 P<SEQ-START> Q<SEQ-END><EOB>

Making a multi-turret post


To make a multi-turret post:
1. Start with a working turning post, one that can turn with the
primary turret.

158 Multi-turret turning posts

Xbuild Reference Manual

2. Choose the CNC Info-Turrets from the Menu bar, and use the
Turret Information dialog to set the controls appropriately.

3. Open the Program Start format in the Formats editor, and add
the following sync code lines:
{M<SYNC-NUM1>}<EOB>
{M<SYNC-NUM2>}<EOB>
{M<SYNC-NUM3>}<EOB>
{M<SYNC-NUM4>}<EOB>
{M<SYNC-NUM5>}<EOB>
These reserved words are specially programmed so that they
are not output if the reserved word is blank.
4. Repeat the previous step for the Tool Change, Segment Start,
Program End,and all of the sub spindle formats.
5. If you are using turning canned cycles, add the sync code line
below to the all of the turning canned cycle formats:
{M<SYNC-NUM1>}<EOB>

Xbuild Reference Manual

Multi-turret turning posts 159

To view an example of how the synchronization codes are used, in


Xbuild open a CNC file in the T-LBRY/examples folder. Save it
as the .CNX file by selecting File - Document CNC from the
Menu bar, and open the created file with a text editor like Notepad.
Now you can search for the string 'SYNC-NUM' to see where it is
used.

160 Multi-turret turning posts

Xbuild Reference Manual

Wire EDM posts


This section describes how to use Xbuild for writing wire EDM posts.

CNC-Info menu
The CNC Info options are used to set up the basic parameters for a CNC
program:
General - specifies the output program format.
NC Codes - defines the exact character string for different NC
commands.
Machine Constants - configures the machine constants in a
CNC program.
Words-N - configures the format of numeric reserved words.

Xbuild Reference Manual

Wire EDM posts 161

CNC-Info menu - General


Allows you to specify the output program format. The General
Information dialog appears.

Be sure to select Wire EDM in the Machine Type field to have


Xbuild display appropriate options.
Any parameter may be changed by selecting it, typing the value, or
toggling to the desired selection (if a new value is entered, press Enter).
The comment block describes the post processor.
These values are default values when no CNC data file has been
loaded into the Xbuild program. When a file is loaded, several or all
of these values may change.
You can set the following parameters:
Machine type - classifies the type of post.
The choices are:
Milling - use this type of post for 2.5D or 3D milling.
Turning - use this classification for 2-axis turned parts.

162 Wire EDM posts

Xbuild Reference Manual

Turn/Mill - use this type of post for lathe with powered rotary
tools.
Wire EDM - use this type of post for Wire EDM machines.
This distinction controls type of reserved words and program formats that
are available in the post.
Dimension - toggles between Inch and Metric output.
Post uses the selection to convert the dimensions that affect X and Y
coordinates as well as feed rate. The setting in the CNC Data file takes
precedence over the assumed inch unit in FeatureCAM. If a part program
is written in inch units, and is processed with a metric CNC data file, the
resulting part program is converted (using standard conversion constants)
into metric units.
Circ. interpol. - selects the programming format on the CNC for which
the post processor is being built.
You can choose Multi-Quadrant, Single Quadrant, or Not
Supported option, as appropriate. For example, if the Numerical
Control cannot drive an arc across a quadrant line (plus or minus X and Y
axes), then select Single Quadrant circular interpolation. When circular
interpolation is turned off in post, then wrap tolerance is used to control
fineness of toolpath.
EOB - defines the end of block character(s), or <EOB>.
We recommended that you use the default characters, that is, <13>
(carriage return) and <10> (line feed).
Decimal point - defines the decimal point character.
This character is usually a period '.' for United States controls, and
a comma ',' for European controls.
ISO Taper Arc - controls the output of arcs for tapered corners in the
ISO-style.
The options are:
Omit arc - in this case, line of G-code for the arc is left out.
Instead a modifier is added to the end of the linear move indicating
that a fillet should be added. This is primarily used for Sodick
machines.
Keep arc - this is the normal case where G-code is output for the
arc move.
Max. macros - specifies the maximum number of macros (subprograms) available on the control.

Xbuild Reference Manual

Wire EDM posts 163

If macros are not available, set this value to zero, and select Not
Available in the Macro Type parameter.
Macro type - specifies how macros are formatted when the part program
requires them.
Choose from the following options:
Local - places macro definitions within the main NC part
program.
End of Prog. - places macro definitions at the end of the main
part program (for example, Heidenhain controls). The PROGRAM
END program format should be specified for output at the end of
the main program and the FILE END program format should be
specified for output at the end of these macro definitions.
Not Available - signals Post that macros are not available.
Indiv. Files - places macro definition in a separate file (for
example, FANUC and GE MC 2000 controls). The name of each
macro file consists of the assigned name that was specified in Post
and the system-assigned macro number The internal sub-program
name is automatically added to the main program name as the
external file name.
One File - places all macro definitions in one file. Post generates
two files, the main part program and a file containing all macros.
This option can output to Bridgeport controls via the EZ-Utils
module, CNCCOMMUNICATION option (Heidenhain DNC
utility).
The name of the macro file consists of the assigned name specified in
Post, MA (representing the macro specification) and the .TXT file
extension. For example, SAMPLEMA.TXT (macro file) and
SAMPLE.TXT.
NC file extension - the default file extension for you CNC programs.
For example if it is set to .txt, and your part is called 'bracket', then the
G-code file will be called bracket.cnc.

164 Wire EDM posts

Xbuild Reference Manual

CNC-Info menu - NC Codes


Specifies the exact character strings for different NC commands. The NC
Codes dialog appears.

The character strings entered in the dialog must match the required
strings specified for the NC control. This information is usually
found in the programmer's manual for the NC control.
You can set the following parameters:
Motions - the options in this frame describe motion types required by
the NC machine. All of these codes must be specified.
For example, Linear is generally defined as G1, but may be changed to
G01, or any other string (up to 11 characters). All motion commands are
passed to Post via the string reserved word <MOTION>.
The following options are available:
Rapid - rapid move.
Linear - feed move.
Circ. CW - circular interpolation, clockwise.
Circ. CCW - circular interpolation, counter-clockwise.
XY, UV - refers to Wire EDM 4-axis movements using an upper
and a lower curve. Typically, XY represents the curve at the
bottom of the part, and UV represents the curve at the top of the
part.
This option is only available for wire EDM posts.
Compensation - generates cutter diameter compensation in the output
when turned On in FeatureWIRE, and if it is built into the CNC data file.

Xbuild Reference Manual

Wire EDM posts 165

Compensation selections use the string reserved word <COMPSTAT> for one of the below options, or an empty string is assigned if
Compensation was not turned On in corresponding program (for
example, FeatureCAM, FEATUREWIRE and so on).
The Compensation frame has these options:
Cancel - compensation off.
Left - compensation on cutter, applied to left in direction of travel.
Right - compensation on cutter, applied to the right in the
direction of travel.
3D - code for turning 3D cutter compensation on. Linear X, Y , Z
motions have a vector component of the tool diameter added
according to the direction vector defined by I, J, K.
This applies to finishing moves only.
This code does not apply to Wire EDM.
Cancel 3D - turns off 3D cutter compensation.
This code does not apply to Wire EDM.
Taper - generates wire taper in the output when Left or Right is
selected in FeatureWIRE, and built into the CNC build file.
The reserved word <TAP-STAT> is assigned to one of these strings. The
most common commands for taper cutting are assigned below. Of course
there may be other strings as well, depending on the type of control.
Cancel - G50.
Left - G51.
Right - G52.

CNC-Info menu - Machine Constants


Configures the machine constants in a CNC program. The Machine
Constants dialog opens.

166 Wire EDM posts

Xbuild Reference Manual

You can set the following parameters:


Guide span - distance between the wire guides.
Table - distance between the wire guides.
Arm Stroke - upper guide travel distance.

Defining wire EDM formats


For each segment of a part program, parameters and calculated values are
passed via the reserved words from the program formats. These program
formats act as a template; they are sequentially filled (that is, the reserved
words are substituted by their corresponding values, G and M codes) as
the part data file is post-processed.

Program formats
As Post reads each segment from the part data file, it determines if it's the
first segment of the program, a tool change, or a non-tool changing
segment. Based upon this information, Post outputs the appropriate block
(that is, Program Start, Tool Change, or Segment Start) prior to
executing segment data. Only one of these three program formats is used
at the beginning of any one segment.
Each definition can include multiple lines, and each line must end
with <EOB>.
Program start
Post outputs the lines defined in the Program Start format at the
beginning of the program. In Program Start, general preparatory
functions are placed to define the dimensional system, absolute, or
incremental modes, and so on. In this block X and Y start locations(G92)
must also be preset. Other functions, such as machine constants can be
passed to the Post output as well as the first positioning move using the
<X-COORD> and <Y-COORD> reserved words.
Segment start
A Segment Start is output between segments. Segment Start should
contain any commands that may change between segments such as
UPPER ARM POS, AD TABLE HT, and parameters P1 through P9,
for example:
N<SEQ>{E<ARM-POS>Z01}<EOB>

Xbuild Reference Manual

Wire EDM posts 167

N<SEQ>{E<AWTH>Z02}<EOB>
or
<IF><STOP><THEN>M00
<ENDIF
( = output of program stop command between segments)
The following reserved words should not be used in the
Segment Start format:
<X-COORD>;
<Y-COORD>;
<TAP-REG>;
<TAP-VAL>;
<TAP-ANG>;
<COMP-STAT>;
<COMP-REG>;
<COMP-VAL>;
<SUFFIX>.
Program end
This block is normally used to output the rewind command and to reset
the control to some standard settings after program completion.
File end
File End specifies the format of the line(s) to be placed at the end of a
file. This is generally used with the End of Prog specification (selected
in the Macro Type field in the General Information dialog).

Move formats
Rapid move
The Rapid Move format defines the output format for rapid positioning
moves.

168 Wire EDM posts

Xbuild Reference Manual

Generally, modality delimiters { } are placed around the <X-COORD>


and <Y-COORD> reserved words. This allows the post processor to
'strip' X, or Y from the line when a coordinate is redundant. In motion
blocks (rapid, linear and circular), the reserved word <MOTION>
receives the path definition parameter from FeatureWIRE (Rapid,
Linear, Arc CW, or Arc CCW).
Linear move
The Linear Move format defines the output format for linear moves.
The following reserved words must be defined in this block:
<MOTION>;
<X-COORD>;
<Z-COORD>;
Wire diameter compensation can be turned On/Off in this format line
with the reserved word <COMP-STAT>. Also other commands like
<TAP-STAT> for taper cutting, <TAP-ANG> as taper angle, Wire
thread and cut, Register settings, and so on maybe used here.
Circular move
The Circular Move defines the output format for arc moves. The
following reserved words are provided as arc modifiers for I, J, or R
values:
<ARC-X>;
<ARC-Y>;
<RADIUS>;
<S-RAD>;
<X-CEN>;
<Y-CEN>.
XY UV move
The XY,UV Move defines the linear output format for a four axis moves.
The reserved words <MOTION>, <X-COORD>,and <Y-COORD>
must be defined together with the third U and fourth V axis commands
<U-RELATIV> , <V-RELATIV> , <U-COORD> , <V-COORD>.
Wire diameter compensation can be turned On/Off in this format line
with the reserved word <COMP-STAT>. Also other commands like
Wire thread and cut, Register settings, and so on maybe used here.

Xbuild Reference Manual

Wire EDM posts 169

XY UV start move
This section is output before the first XY,UV move and normally used
to activate special machine settings which maybe necessary for the
control to machine a four axis part.
XY UV end move
This section is output after the last XY,UV move and normally used to
deactivate or reset special machine settings which may have been
necessary for the control to machine a four axis part.
UDF text
Returns code/comment from a user-defined feature (UDF). <UDFTEXT> and <UDF-COMMENT> are reserved words that receive text
passed from the UDF.

Macro formats
Format

Description

In-Macro Linear

This format is similar to the Linear Move format,


but it is only used within a macro definition
(without the <Z-COORD> reserved word).
In_Macro Move program formats can be set to
generate absolute, or incremental output. For
incremental output, Post does not duplicate path
data for translations. Post positions to the translated
location and 'calls' the original incremental macro.
Also refer to Incremental Programming Rules (see
page 50).

170 Wire EDM posts

Xbuild Reference Manual

Format

Description

In-Macro Circular

This format is similar to the Circular Move


format, but it is only used within a macro definition
(without the <Z-COORD> reserved word).
In_Macro Move program formats can be set to
generate absolute, or incremental output. For
incremental output, Post does not duplicate path
data for translations. Post positions to the translated
location and 'calls' the original incremental macro.
Also refer to Incremental Programming Rules (see
page 50).

Open Macro

This format specifies the format of the lines


preceding the macro definition (start delimiter).
The <MACRO#> reserved word must be used. A
preparatory function code (for example,
incremental for defining incremental macros) can
also be used.

Close Macro

This format specifies the format of the lines


following a macro (end delimiter) definition. A
preparatory function code may be used to redefine
the absolute specification (that is, if the main
program starts in the absolute mode).

Macro Call

This format specifies the format of a line for


'calling' a macro. The reserved word <MACRO#>
must be used to identify the macro.

Xbuild Reference Manual

Wire EDM posts 171

Wire EDM reserved words


Reserved
words

Type

Definition

<ARC-U>

Numeric

Same as <ARC-X> but for the upper curve.

<ARC-V>

Numeric

Same as <ARC-Y> but for the upper curve.

<ARC-X>

Numeric

Used in the circular interpolation block to


specify the signed X distance from the start
point of the arc, to the center of the arc
along the X axis.

<ARC-Y>

Numeric

Used in the circular interpolation block to


specify the signed Y distance from the start
point of the arc, to the center of the arc
along the Y axis.

<ARM-POS>

Numeric

Reproduces the upper arm position from


FeatureWIRE.

<ARM-STR>

Numeric

The upper guide travel distance (entered as


Arm Stroke in the Machine Constants
dialog in Xbuild).

<AWTH>

Numeric

Reproduces the additional work table


height from FeatureWIRE.

<COMP-END>

Logical

True if the move represents the end section


for compensation (last element, or move of
path), otherwise <COMP-END> is false.

<COMP-ON>

Logical

True if cutter diameter compensation is On,


otherwise <COMP-ON> is false.

<COMP-MID>

Logical

True if the move represents the middle


section for compensation (between the first
and last moves of path), otherwise
<COMP-MID> is false.

<COMP-NUM>

Numeric

Compensation number passed from


FeatureCAM.

<COMP-NUMCH>

Logical

True if wire radius compensation status


(On or Off) or value (0.15) or register
number (1) has changed.

172 Wire EDM posts

Xbuild Reference Manual

Reserved
words

Type

Definition

<COMP-START>

Logical

True if the move represents the start section


for compensation (first element, or move of
path), otherwise <COMP-START> is false.

<COMP-STAT>

String

When cutter diameter compensation status


is selected, <COMP-STAT> establishes a
right/left tool relationship with the part, and
outputs the cutter compensation code at the
first feed move of the profile path.

<COMP-VAL>

Numeric

Copies the wire compensation value from


FeatureWIRE.

<CONT-END>

Logical

True if the move is the last move on a


contour.

<CONT-START>

Logical

True if the move is the first move on a


contour.

<CURVID>

String

Copies the curve ID from FeatureWIRE.

<CUTNUMBER>

Numeric

Identifies the pass number for multi-pass


contouring.

<DATE>

String

Reproduces the date that the part program


was postprocessed.

<DWELL>

Numeric

Reproduces the dwell value passed from


FeatureCAM.

<DWELL+>

Logical

True if dwell is greater than 0.0.

<ENDIF>

System

Last element in a conditional statement.

<EOB>

Other

Specifies the end of block code for each


line of a program format.

<FEED>

Numeric

Feed rate value identifier passed from


FeatureCAM.

<FIRST-ANG>

Numeric

Reproduces the taper angle at the motion


start from FeatureWIRE.

<FIRST-CUT>

Logical

True for the first pass of multi-pass


contouring.

Xbuild Reference Manual

Wire EDM posts 173

Reserved
words

Type

Definition

<G-SPAN>

Numeric

The distance between the wire guides


(entered as Guide Span in the Machine
Constants dialog in Xbuild).

<IF>

System

First element in a conditional statement,


always followed by a logical reserved word
to verify that a condition is true.

<IFNOT>

System

First element in a conditional statement,


always followed by a logical reserved word
to verify that a condition is false.

<IS-DIE>

Logical

True for die features.

<IS-PUNCH>

Logical

True for punch features.

<IS-TAPER>

Logical

True for tapered features.

<IS-XYUV>

Logical

True for 4-axis XY UV features.

<ISO-ON>

Logical

True if ISO tapering is on.

<ISO-RAD>

Numeric

The radius of an iso taper arc.

<LOWER-LEN>

Numeric

Length of the lower curve for the current


operation.

<MACRO#>

Numeric

Macro number identifier (systemgenerated). Macros are not user definable,


however some Macros are generated
automatically, especially with multiple
fixture parts and for repeated features. This
number starts at 00 and increments
automatically up to the Max Macros
number that is contained on the General
Information dialog.

<MCSID>

String

The name of the current setup.

<MOTION>

String

Produces the correct motion-type (that is,


Rapid, Linear, Circular CW/CCW) for
the various program formats.
<MOTION> is specified in the Motions
frame of the CNC Info-NC Code dialog
in Xbuild.

174 Wire EDM posts

Xbuild Reference Manual

Reserved
words

Type

Definition

<PROG-NAME>

String

Reproduces the output file name. It is set in


the Setup dialog in FeatureCAM.

<Q-ANGLE>

Numeric

Angle between wire and Z-Axis in the


plane perpendicular to wire motion.

<R-ANGLE>

Numeric

Angle between wire and Z-Axis in the


plane parallel to wire motion.

<RADIUS>

Numeric

Reproduces arc radius in a circular block.

<S-RAD>

Numeric

Generates the signed arc radius value in a


circular block, +R<180 degrees and -R>180
degrees.

<SEG-CMT>

String

Comment on an operation. This is set under


post variables. For controls that require
comments to be a single line, <SEG-CMT>
must be only one line.

<SEGM-ID>

String

Provides the option to output the Seg ID


(Segment Identifier) passed from
FeatureCAM.

<SEQ>

Numeric

This is a line sequence number identifier


(when the word appears in a line, it is
substituted with the current sequence
number, and is subsequently incremented
by the sequence step value).

<STOP>

Logical

True if the stop commands needs to be


output.

<SUFFIX>

String

Reproduces the suffix string passed from


FeatureWIRE.

<TAB-HT>

Numeric

The distance from the work table down to


the lower guide (entered as Table Height
in the Machine Constants dialog in
Xbuild).

<TAP-ANG>

Numeric

Reproduces the taper angle at the motion


end from FeatureWIRE.

<TAP-REG>

Numeric

Reproduces the taper register number from


FeatureWIRE.

Xbuild Reference Manual

Wire EDM posts 175

Reserved
words

Type

Definition

<TAP-REG-CH>

Logical

True if a taper angle status (On or Off) or


value (3.7) or register number (1) has
changed.

<TAP-STAT>

String

When taper function is used, <TAP-STAT>


reproduces the right or left wire relationship
with the part specified in FeatureWIRE.

<TAP-VAL>

Numeric

Copies the taper register number from


FeatureWIRE.

<THEN>

System

Second element in a conditional statement,


placed after a logical reserved word.

<TOTALLOWER>

Numeric

Total length of the lower curves for all


operations.

<TOTALUPPER>

Numeric

Total length of the upper curves for all


operations.

<U-CEN>

Numeric

Same as <X-CEN> but for the upper curve.

<U-CENRELAT>

Numeric

Result of <U-CEN> - <X-CEN>

<U-COORD>

Numeric

U axis absolute coordinate identifier.

<U-RELAT>

Numeric

Result from <X-COORD> - <U-COORD>


= Incremental distance from X-position of
lower contour.

<UPPER-LEN>

Numeric

Length of the upper curve for the current


operation.

<V-CEN>

Numeric

Same as <Y-CEN> but for the upper curve.

<V-CENRELAT>

Numeric

Result of <V-CEN> - <Y-CEN>

<V-COORD>

Numeric

V axis absolute coordinate identifier.

<V-RELAT>

Numeric

Result from <Y-COORD> - <V-COORD>


= Incremental distance from Y-position of
lower contour.

<WATER>

Numeric

Reproduces the water value identifier from


FeatureWIRE.

176 Wire EDM posts

Xbuild Reference Manual

Reserved
words

Type

Definition

<WIRE-CUT>

Logical

True if the Wire Change parameter is set


to Cut in FeatureWIRE.

<WIRE-THRD>

Logical

True if the Wire Change parameter is set


to Thread in FEATUREWIRE.

<X-ANGLE>

Numeric

The polar angle of the upper toolpath point


in the YZ plane.

<X-CEN>

Numeric

Reproduces the absolute X coordinate


position from the X axis origin to the arc's
center in a circular block.

<X-COORD>

Numeric

X axis coordinate identifier.

<XYUV-ARC>

Logical

True if outputting arc moves in 4-axis.

<Y-ANGLE>

Numeric

The polar angle of the upper toolpath point


in the XZ plane.

<Y-CEN>

Numeric

Reproduces the absolute Y coordinate


position from the Y axis origin to the arc's
center in a circular block.

<Y-COORD>

Numeric

Y axis coordinate identifier.

Relationship between FeatureWIRE


and Xbuild
This section explains how the parameters that are defined in
FeatureWIRE correspond to Xbuild reserved words, and how these are
handled when NC is pressed.

Input dimension
The coordinate data dimension system is defined during an FeatureWIRE
programming session (View menu - Setup dialog). The Inch or Metric
dimension system is saved as a 'flag' in the CNC data file.

Xbuild Reference Manual

Wire EDM posts 177

When Post is executed, it compares the input dimension system that was
saved in the part program with the output dimension system that was
selected in Xbuild (CNC-Info menu - General Information dialog). If
they differ, a conversion factor is automatically applied. Therefore, a
CNC data file that was created in Xbuild must be built in accordance with
the desired output dimension system.

Path definition
Motion commands in Xbuild are used to define appropriate command
strings, for example G0, G1, G2, G3. Each type of motion block is
formatted in program formats using the <MOTION> reserved word.
Coordinate data is formatted using the following reserved words:
<X-COORD>;
<Y-COORD>;
<Z-COORD>;
<ARC-X>;
<ARC-Y>;
<X-CEN>;
<Y-CEN>.
Arc specifications are established in the Circular Move program format.

Other reserved words


Optional sequence numbering is defined in Post, and is placed at
the beginning of any block that contains the reserved word
<SEQ>.
The end of block character (a control code that signals a completed
line) is defined by the reserved word <EOB>, defined in the
General Info dialog.
Other parameters P1 through P9 can also be used.

Handling macros
Macros (sub-programs) that were previously defined inside, or outside of
the main program can be 'called' to reproduce a set of operations. Calling
these macros saves CNC memory when duplicated, or repeated.

178 Wire EDM posts

Xbuild Reference Manual

Post automatically generates macros in the NC file when the


FeatureWIRE Macro selection (Uni-dir (uses macro) on the Feature
Strategy tab) is On and the post processor is configured for macros.
There are that many options and user requests, that it's simply not
possible to ship a standard post for macro support. In most of the
cases some customizing and testing is needed before using macro
support.

Handling wire compensation


Wire compensation is handled by Xbuild and can be configured several
ways, depending on the CNC control requirements.
Case 1
The most common configuration is with Compensation On in the first
linear X, Y feed move of the wire path, and Compensation Off in
the last linear X, Y feed move of the path. If this is the required
configuration, then define the LINEAR format as follows:
{N<SEQ>}{<COMP-STAT>}{<MOTION>}
{X<X-COORD>}{Y<Y-COORD>}{F<FEED>}
<EOB>
In the example shown above, you see the use of the modal delimiters
(see page 25) {X<X-COORD>} and {Y<Y-COORD>}. They prevent the
software from outputting repeated coordinates to shorten the NC code.
Case 2
When using cutter compensation, some controls require the output of both
X and Y coordinates when Compensation is turned On. To achieve
this, it is necessary to set up a conditional statement so that these
coordinates are both output. If this is the required configuration, then
define the LINEAR format as follows:
<IF><COMP-START><THEN>
{N<SEQ>} <MOTION> <COMP-STAT>
X<X-COORD> Y<Y-COORD><EOB>
<ENDIF>
<IFNOT><COMP-START><THEN>
{N<SEQ>} {<MOTION>} {<COMP-STAT>}
{X<X-COORD>} {Y<Y-COORD>} <EOB>
<ENDIF>

Xbuild Reference Manual

Wire EDM posts 179

The first <IF> <COMP-START> . . . <ENDIF> conditional statement


is True on the first linear move when Compensation is turned On. In
that case the corresponding linear move section without modal delimiters
is used and all coordinates are output, no matter if they are identical to the
last position or not. For all other moves, when the <COMP-START>
condition is False, the second statements section with modal delimiters
is used.

Handling tapers
Taper is handled by Xbuild and can be configured several ways,
depending upon the CNC control's requirements.
The reserved words <FIRST-ANG> , <TAP-ANG>, and <TAP VAL>
are available to represent the various possible taper settings that might be
used by the controls.
Use:
<FIRST-ANG> - to represent the taper angle at the beginning of
the move;
<TAP-ANG> - to represent the taper angle at the end of the move.
<TAP-VAL> - to output a taper register.
All these words are defined in the Curves Contour manager, or in case
of a continuous taper on the Toolpath Options page in the Segment
Data dialog.
The following example of a linear move block is used for Fanuc controls:
{N<SEQ>} {T<FIRST-ANG >}<EOB>
{N<SEQ>} {<COMP-STAT>} {<MOTION>}
{X<X-COORD>} {Y<Y-COORD>} {T<TAP-ANG>}
<EOB>

Handling XY UV
The XYUV selection in FeatureWIRE is used to define part programs for
independent XYUV cutting. The two curves, defined for upper and lower
contour in FeatureWIRE, are translated into XY and UV moves, which
are output using the corresponding EPOST sections. In Xbuild, the G
code for XYUV cutting is specified using the XY, UV option in the NC
Codes dialog.
The following formats control the XYUV ouput :
XY UV start move (see page 170);

180 Wire EDM posts

Xbuild Reference Manual

XY UV end move (see page 170);


XY UV move (see page 169).
Heres a sample XYUV block for Fanuc controls:
{N<SEQ>} {<MOTION>} {X<X-COORD>} {Y<Y-COORD>}
{U<U-RELAT>} {V<V-RELAT>}<EOB>
If you use standard incremental output for the words <U-RELAT>
and <V-RELAT>, make sure that the FACTOR setting in the
Words Info dialog (see page 9) is set to -1.

Cycle type
POST calculates the wire path based on the type of cycle. These
calculations are accomplished by applying the offset and other cycle data
parameters appropriate to the current cycle.

Outputting 4-axis wire EDM arc moves


For arc moves in XYUV, you can enable it by selecting the Multi Quad.
(Avail. in XYUV) option in the Circ. Interpolation field in the
General Information dialog of Xbuild.
You must be in an EDM post.
Arc moves will be output when both the upper and the lower moves are
arcs. The XYUV format should look similar to:
<IF><XYUV-ARC><THEN>
N<SEQ>{ <MOTION>}{ X<X-COORD>}
{ Y<Y-COORD> }I<ARC-X> J<ARC-Y> U<U-RELAT>
V<V-RELAT> K<U-CEN-RELAT> L<V-CEN-RELAT><EOB>
<ELSE>
N<SEQ>{ <MOTION>}{ X<X-COORD>}
{ Y<Y-COORD> } U<U-RELAT> V<V-RELAT>
<EOB>
<ENDIF>

Xbuild Reference Manual

Wire EDM posts 181

The <XYUV-ARC> reserved word will be true when outputting arc


moves. The <ARC-X> and <ARC-Y> reserved words will be the vector
from the start point of the lower arc to the center. <U-CEN-RELAT> and
<V-CEN-RELAT> will be the vector from the center of the lower arc to
the center of the upper arc.

182 Wire EDM posts

Xbuild Reference Manual

Tutorials
This section contains tutorials to get you started with Xbuild.

Understanding milling formats


This tutorial provides a basic understanding of the correspondence
between toolpath moves and program formats. You will create a milling
post, but the concepts are applicable to all types of post processors. This
tutorial is in metric units.
Specific Instructions
1. Open 001.fm from the training CD.
2. Generate toolpaths, and single step through the program. You will
notice that this simple program rapids performs the following
moves:
Rapids from the tool change position to the Z Rapid Plane
above the slot.
Rapids in Z to the Plunge Clearance Plane.
Feeds down in Z into the slot.
Feeds across in X.
Rapids to the Z Rapid Plane.
Rapids to the tool change position.
3. Select the text.CNC post processor from the training CD. This is a
post processor that simply outputs the name of each program
format that is called. This shows you the order in which the
program formats are called for this program.
4. Click the NC Code tab. The following code is displayed:

Xbuild Reference Manual

Tutorials 183

Program_Start - begins the program, grabs the first tool and


rapids above the part.
Z_Rapid - rapids to plunge clearance plane.
Linear_Move - feeds down into the slot.
Linear_Move - feeds across in X.
Z_Rapid - rapids to the Z Rapid Plane.
Program_End - ends program, turns off coolant, rewinds
program...
File_End - ends file, usually just a % to end the transmission.
Note that tool is never explicitly positioned to the tool change
location as the simulation might lead you to believe.
5. Deselect slot2 in the tree view, and generate the NC code. The
following code is created.
Program_Start
Z_Rapid
Linear_Move
Linear_Move
Z_Rapid
Rapid_Move
Z_Rapid
Linear_Move
Linear_Move
Z_Rapid
Program_End
File_End
6. Since both features use a 5mm tool, all that is required between
the features is to move to the new location and cut another slot. The
program accomplishes this with the new Rapid Move format.
This format performs a rapid move in X and Y.
7. Edit slot2 to have a width of 10mm, and regenerate the code. This
will force a tool change from a 5mm tool to a 10mm tool. The
following code is created:
Program_Start
Z_Rapid

184 Tutorials

Xbuild Reference Manual

Linear_Move
Linear_Move
Z_Rapid
Tool_Change
Z_Rapid
Linear_Move
Linear_Move
Z_Rapid
Program_End
File_End
8. Tool_change is the new program format. This format changes
the tool and rapids to the next location in X and Y.
9. Edit slot2 to return the width to 5mm, and change its speed to
1000 rpm. Regenerate the NC code. The Tool_Change segment
has been replaced by the Segment_Start format. If there is a
change in fixture IDs or a change in speed this format is called
instead of the Tool_Change format.
Summary of new formats in this tutorial
Format

Description

Rapid Move

A rapid move in X and Y. If there is no change in the


tool, fixture ID or speed rate, this format is called to
move between cutting locations.

Tool Change

If the tool changes this format is called.

Segment Start

If only the speed or fixture ID changes this format is


called.

Understanding drilling formats


This tutorial is designed to give you an understanding of drilling formats.
You will create programs that use explicit linear moves and canned
cycles. This tutorial is in metric units.

Xbuild Reference Manual

Tutorials 185

Specific Instructions
1. Open 001.fm from the training CD. This is just a simple hole that
is spot-drilled and drilled.
2. Generate toolpaths, and single step through the program. You will
notice that this simple program spot drills in a single move,
changes tools and peck drills the hole. The spot drilling is
performed by the Drill_Cycle format, and the peck drilling is
performed by the Deep_Hole cycle.
Program_Start
Z_Rapid
Drill_Cycle
Cycle_Cancel
Z_Rapid
Tool_Change
Z_Rapid
Deep_Hole
Cycle_Cancel
Z_Rapid
Program_End
File_End
3. Edit the hole. Click the hole operation, and change the Drill
Cycle to Chip Break on the Cycle tab.
4. Regenerate the code. You will see that the call to the Deep_Hole
cycle has been changed to a call to the Chip_Break cycle.
5. If the .CNC file does not contain NC codes for drilling cycles, then
FeatureCAM will create explicit moves. Open the post
textnodrillcycles.CNC, and create the code. The following code
(without canned cycles) is created.
Program_Start
Z_Rapid
Linear_Move
Z_Rapid
Tool_Change
Z_Rapid

186 Tutorials

Xbuild Reference Manual

Linear_Move
Z_Rapid
Linear_Move
Z_Rapid
Linear_Move
Z_Rapid
Program_End
File_End

Creating program formats


While you will normally base a new post on an existing post, in this
tutorial, you will create program formats from scratch. The formats you
create would be applicable to a Fanuc0 control.
Specific Instructions
1. Open the 001.fm file in FeatureCAM.
2. In Xbuild open the text.CNC file.
3. Click the Formats menu, select the Move option, and choose
Linear.
4. The Formats editor is launched, and the contents of the Linear
program format is displayed.
At this point the format only has the literal Linear_Move. This
means that every time this program format is called, the string
Linear_Move is output to the NC file.
Our goal is to create the following line:
{N<SEQ>}{<MOTION>}{X<X-COORD>}
{Y<Y-COORD>}{Z<Z-COORD>}{F<FEED>}<EOB>
5. Select all of the text in the format and hit the BACKSPACE key to
remove it.
6. Now let's create the collection of reserved words and then add the
literals.
7. Select File - WordList from the Menu bar. The list of
FeatureCAM reserved words is displayed.
8. Click the Modal Delimiters check box so that all of the reserved
words will be surrounded by brackets { }.

Xbuild Reference Manual

Tutorials 187

9. Find <SEQ> in the Reserved List dialog, and click on it. The
string {<SEQ>} will be inserted into the format.
10.Insert the <MOTION>, <X-COORD>, <Y-COORD>, <ZCOORD>, <FEED> and <EOB> reserved words to get the string
shown below:
{<SEQ>}{<MOTION>}{<X-COORD>}{<Y-COORD>}
{<Z-COORD>}{<FEED>}{<EOB>}
11.Now type N before the <SEQ> reserved word:
{N<SEQ>}
12.Enter the X, Y, Z and F literals to result in the following strings:
{<MOTION>}{X<X-COORD>}{Y<Y-COORD>}
{Z<Z-COORD>}{F<FEED>}<EOB>
13.Select File - Quit from the Menu bar, and click Yes to confirm
your action. The Formats editor will close.
14.Select File - Save from the Menu bar, and click Yes to confirm
your action.
15.In FeatureCAM, generate toolpaths for slot1.
16.Now the following lines of real G-code have replaced the
Linear_Move strings:
N25G1Z-5.0F105.
N35X52.5F209.
17.Now use the Formats editor to modify the following program
formats:
Program Start
%<EOB>
:<PROG-NAME><EOB>
{N<SEQ>}G17G21G40G49G80G90G94<EOB>
{N<SEQ>}T<TOOL>M6<EOB>
{N<SEQ>}<MOTION>G90G<FIXTURE>
X<X-COORD>Y<Y-COORD>S<SPEED>
<SPINDLE><EOB>
{N<SEQ>}G43Z<Z-COORD>H<TOOL>
<COOLANT><EOB>

188 Tutorials

Xbuild Reference Manual

Rapid
{N<SEQ>}{<MOTION>}{X<X-COORD>}
{Y<Y-COORD>}<EOB>
Z Rapid
{N<SEQ>}{<MOTION>}{Z<Z-COORD>}<EOB>
Program End
{N<SEQ>}G28G91Y0Z0M9<EOB>
{N<SEQ>}M30<EOB>
File End
%<EOB>
18.Save your changes to the post, and regenerate the NC code to
create the following program:
%
:001
N25G17G21G40G49G80G90G94
N35T1M6
N45G0G90G54X32.5Y0.S5200M3
N55G43Z15.862H1M8
N65Z2.54
N75G1Z-5.0F105.
N85X52.5F209.
N95G0Z15.862
N105G28G91Y0Z0M9
N115M30
%%

Converting a post to 5-axis


simultaneous
You can convert a 5-axis (milling) or B-axis (turn/mill) positioning post
to 5-axis simultaneous post:
1. Enter the Machine Dimensions in the Five Axis dialog. They
are used by FeatureCAM to do transformation and linearization.

Xbuild Reference Manual

Tutorials 189

2. Select Linearization if you want to enable it. Linearization


divides a linear move into smaller moves to avoid overcut or
undercut resulting from the rotary movements.
3. Enclose any 3D coordinate transformation (tilted working plane)
block for 5-axis positioning with <IFNOT><5-AXISOPER><THEN><ENDIF>. Since 5-axis simultaneous
operations do not use 3D coordinate transformation, this ensures
those blocks are not outputted.
4. Add the rotary angles to the Rapid, Z Rapid and Linear formats.
For example, enter: {A<ROT1-WIND>}{C<ROT2-WIND>} for a
machine with a C rotary table and A tilting head.
5. Add blocks to enable inverse time feed for 5-axis simultaneous
operations if your machine requires it.
Some machines require this for the calculation of the feed rates in
the rotary movements. On newer machines, usually the regular feed
is sufficient. For example, you would need to add the following
blocks to the Program Start, Tool Change and Segment
Start formats:
<IF><5-AXIS-OPER><THEN>
M code to enable inverse time feed
<ELSE>
M code to enable regular feed
<ENDIF>
6. Change <FEED> to <ANG-INVTIME> in the Linear format.
Since <ANG-INVTIME> has the same value as <FEED> for non
5-axis simultaneous operations, you do not need to add an <IF> to
the Linear format.

190 Tutorials

Xbuild Reference Manual

Index

B
Bar feed 109

C
Catcher in 109
Catcher out 109
Changing post units 26
Circular move 54, 109
Computer tapping cycles 131
Conditional statements 8
Configuring reserved words 9
Control characters 26
Converting post 189
Creating program formats 187
Custom format See Formats menu
Cycle formats
Milling cycle formats 55
Turning cycle formats 111
Drill cycle 111
Groove cycle 112
Tapped canned cycle 112
Thread cycle 112

D
Defining formats
Mill posts
Cycle formats 55

Xbuild Reference Manual

Macro formats 56
Move formats 53
Program formats 51
Rules 50
Multi-turret posts
Making a multi-turret post 158
Pinch and follow turning 158
Syncronizing spindle speed 157
Turn posts
Cycle formats 111
Move formats 108
Program formats 107
Rules 106
Turn/mill posts
General structure 147
Linear move 148
Program start and tool change
formats 147
Rapid move 148
Wire EDM posts
Macro formats 56
Move formats 168
Program formats 107
Dialogs
Cycles 104
Feeds and Speeds 36, 103
Five-Axis 37, 146
Fixture ID 36, 105
General 29, 96, 133, 162
Machine Constants 166

Index 191

NC Codes 33, 98, 137, 165


Reserved Words dialog 13
Spindles 102
Turrets 100
Words Info dialog 9
Drill cycle 111
Drilling formats 185
Dwell 55, 109

Linear move 54, 108, 148


Logical operators 20
Logical reserved words 8
Milling 63
Turn/mill 150
Turning 123

Edit menu 15
Expressions
Assignment 23
Formatting 23
Logical operators 20
Numeric operators 18
Square brackets 17
String operators 22
Suppressing printing of 24

F
FeatureCAM 1, 70
FeatureTURN 130
FeatureWIRE 177
File menu 4, 12
Finish cycle end 110
Finish cycle start 110
Five axis machine types 37
Formats editor
Edit menu 15
File menu 12
Reserved Words dialog 13
Formats menu 11
Formatting expressions 23
Four axis wire EDM arc moves 181
Fourth and fifth axis support
Fifth axis indexing 93
Fourth axis indexing 90
Fourth axis wrapping 91
Rotation styles 88

192 Index

Groove cycle 112

H
Hole canned cycles 68, 77

M
Machine dimensions 37
Macro formats
Milling macro formats 56
Wire EDM macro formats 56
Making a multi-turret post 158
Making reserved words modal See
Modality delimiters
Menus
Edit menu 15
File menu 4, 12
Formats menu 11
Milling CNC-Info menu
Feeds and Speeds 36
Five-Axis 37
Fixture ID 36
General 29
NC Codes 33
Sim-Info menu 7
Turn/mill CNC-Info menu
Cycles 104
Feeds and Speeds 103
Five-Axis 146
Fixture ID 105
General 133
NC Codes 137

Xbuild Reference Manual

Spindles 102
Turrets 100
Turning CNC-Info menu
Cycles 104
Feeds and Speeds 103
Fixture ID 105
General 96
NC Codes 98
Spindles 102
Turrets 100
Wire EDM CNC-Info menu
General 162
Machine Constants 166
NC Codes 165
Milling formats 183
Milling posts
3D arcs 76
CNC-Info menu 28
Cutter compensation 72
Cycle types 70
Defining formats 50
Fanuc line numbering 78
Formats menu 11
Fourth and fifth axis support 88
Input dimension 70
Milling macros 78
Expected G-code 79
Implementing local coordinate
systems 83
Incremental macros 86
Multiple fixture documents 73
Pecking 75
Reserved words
Logical reserved words 63
Numeric reserved words 57
String reserved words 66
Z data 71
Modality delimiters 25
Move formats
Milling
Circular move 54
Dwell 55
Linear move 54

Xbuild Reference Manual

Rapid move 53
Spindle 54
UDF text 55
Z-rapid move 54
Turning
Bar feed 109
Catcher in 109
Catcher out 109
Circular move 109
Dwell 109
Finish cycle end 110
Finish cycle start 110
Linear move 108
Rapid move 108
Rough cycle end 110
Rough cycle start 109
Spindle 109
Spindle close 110
Spindle open 110
Spindle orient 111
Spindle position 110
Spindle postion feed 111
Spindle start/stop 111
Turret home 111
UDF text 111
Wire EDM
Circular move 169
Linear move 169
Rapid move 168
UDF text 170
XY UV end move 170
XY UV move 169, 170
Multi-turret turn posts
Defining formats 157
Muti-turret reserved words 156

N
Numeric operators 18
Numeric reserved words 7
Milling 57
Turn/mill 150
Turning

Index 193

Canned cycle block words 119


Circular block words 120
Drilling and threading cycle
words 120
General words 114

O
Operators
Logical operators 20
Numeric operators 18
String operators 22

P
Pinch and follow turning 158
Program formats
Milling
File end 53
Program start 52
Segment start 52
Tool change 52
Turning
Program end 108
Program start 107
Segment start 107
Spindle change 107
Tool change 107
Wire EDM
File end 53
Program end 168
Program start 167
Segment start 167
Program start and tool change formats
147

R
Rapid move 53, 108, 148
Reserved words
Conditional statements 8
Configuring 9
Logical 8
Milling

194 Index

Logical reserved words 63


Numeric reserved words 57
String reserved words 66
Muti-turret reserved words 156
Numeric 7
String 8
System 8
Turn/mill 149
Logical reserved words 150
Numeric reserved words 150
String reserved words 152
Turning
Logical reserved words 123
Numeric reserved words 114
String reserved words 127
Wire EDM reserved words 172
Reserved Words dialog 13
Rough cycle end 110
Rough cycle start 109
Rules 50, 106, 147, 157

S
Sim-Info menu 7
Spindle 54, 109
Spindle close 110
Spindle open 110
Spindle orient 111
Spindle position 110
Spindle postion feed 111
Spindle start/stop 111
Square brackets 17
String operators 22
String reserved words 8
Milling 66
Turn/mill 152
Turning 127
Syncronizing spindle speed 157
System reserved words 8

T
Table on table machines 37

Xbuild Reference Manual

Tapped canned cycle 112


Thread cycle 112
Tilting head machines 37
Turn posts
CNC-Info menu 95
Computer tapping cycles 131
Defining formats 106
Formats menu 11
Other reserved words 131
Roughing and profiling cycles
130
Start/end points 130
Turning reserved words
Logical reserved words 123
Numeric reserved words 114
String reserved words 127
Turn/mill posts
CNC-Info menu 132
Defining formats 147
Turn/mill 149
Logical reserved words 150
Numeric reserved words 150
String reserved words 152
Turret home 111
Tutorials
Converting post 189
Creating program formats 187
Drilling formats 185
Milling formats 183

U
UDF text 55, 111, 170
Units 26

W
Wire EDM posts
CNC-Info menu 161
Cycle type 181
Defining formats 107
Four axis wire EDM arc moves
181

Xbuild Reference Manual

Hadling wire compensation 179


Input dimension 177
Other reserved words 178
Path definition 178
Tapers 180
Wire EDM macros 178
Wire EDM reserved words 172
XY UV 180
Words Info dialog 9

X
Xbuild
Control characters 26
Expressions 15
File menu 4
Formats editor 12
Formats menu 11
Mill posts
Cycle formats 55
Macro formats 56
Move formats 53
Program formats 51
Rules 50
Modality delimiters 25
Multi-turret posts
Making a multi-turret post 158
Pinch and follow turning 158
Syncronizing spindle speed 157
Overview 1
Post type 2, 3
Reserved words 7
Sim-Info menu 7
Turn posts
Cycle formats 111
Move formats 108
Program formats 107
Rules 106
Turn/mill posts
General structure 147
Linear move 148
Program start and tool change
formats 147

Index 195

Rapid move 148


Wire EDM posts
Macro formats 56
Move formats 168
Program formats 107
XY UV end move 170
XY UV move 169, 170

Z
Z-rapid move 54

196 Index

Xbuild Reference Manual

Potrebbero piacerti anche