Code Generator
Code Generator
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
EdgeCAM is a suite of software allowing users to design parts and then simulate the manufacturing
processes necessary to create them on a machine tool. The end-product of an EdgeCAM worksession is a
generalised instruction list, like this one:
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically
This
list has to for
be translated
a particularinto
controller.
a CNC file
In practice,
format suitable
a previously
for a particular
tried and tested
make and
text type
file for
of aCNC
similar
controller.
CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
Code Generator files perform this translation function for EdgeCAM. They also provide extra commands
originating from the Code Wizard and its templates.
that are seamlessly integrated into the EdgeCAM command structure. Although EdgeCAM provides
standard Code Generator files, new Code Generators are usually written (using these as templates) to suit
particular CNC controller and machine tool combinations.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file (having an *.?cp extension) from a man-readable source text file (which
must have an *.?xt extension).
SeeFile Naming Conventions.
For example,
The compiled Machine Tool File can then be selected within a EdgeCAM worksession to specify the format
for the output CNC code (this is known as "selecting the Machine Tool" when entering EdgeCAM
Manufacture mode). Any number of Machine Tool Files may be present on a EdgeCAM system to give
maximum flexibility.
The man-readable file must contain all the appropriate parameters required to convert the raw EdgeCAM
data into usable CNC code, and must be written specifically for a particular controller. In practice, an
existing text file for a similar CNC controller would be edited to produce a customised parameter source file.
WARNING:
To avoid any possible damage to your machine tools and material, test EVERY Code Generator File
THOROUGHLY before using it to cut material.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
The author of a Code Generator parameter source file must be conversant with CNC code and be familiar
with the EdgeCAM Machining module in question.
Knowledge of a high level programming language (for example 'C', BASIC, PASCAL or FORTRAN) would
also be useful.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
To understand the computing process during an EdgeCAM machining/code generating session, note this
sequence of events:
1. Enter the EdgeCAM Manufacture option and select a Code Generator (actually referred to as a
Machine Tool in the modifier box). At this point the Code Generator is read in to select the commands
that are available with this Code Generator. Some of the menu commands that are common to all
Code Generators are taken from the relevant command file.
2. Within the Files menu, select the command Generate Code to start creating CNC code from the
instruction list for the machining session. Once you have entered a name for the CNC file, the system
loads edgempp.exe. This reloads the Code Generator to translate the intermediate data to the output
file(s).
The Code
Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "MachineisTool"
file from
man-readable
source
text
fileselect
containing
allthe
theprogram
appropriate
3. If edgempp.exe
executed
froma the
program group,
and
you
Rerun,
reparameters
and logic
required
to convert
the rawgenerated
EdgeCAMtemporary
data into usable
CNC
code.file is also
processes
the output
using
the previously
files. The
source
recompiled if any edits have occurred.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
The Code Generator is a sequential ASCII file which, when compiled, becomes a binary file. The sequential
file, which can be edited, is usually referred to as the source text file. This file consists of a series of
definitions that each has a specific purpose.
A Code Generator is generally derived from a previously tried and tested source text file.
See Also
The compiled file names will be the first eight characters plus the appropriate extension as listed below.
The Compiler recognises the type of Code Generator it is compiling by the source file extension. The
extension must always be ?xt where the ? is as follows:
Milling/Laser/Flame-cutting etc.
*.mxt
EdgeCAM Code
*.2xt Generator Compiler Guide
2-axis Turning
4-axis Turning
*.4xt
*.cxt
The
Generator Compiler is an integral
WireCode
Erosion
*.wxt part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
The %MACHINE statement should be consistent with the extension to make recognition of the type of file
easier.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
For
example:
using
a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
%MACHINE=MILL=...
NNCNC01.MXT compiles as
NNCNC01.MCP
This document contains information to help you produce a customised Code Generator parameter source
file
specifically for a particular controller.
In practice,
a previously
tried and tested text file for a similar CNC
%MACHINE=LATHE=...
NNCNC01.2XT
compiles
as
controller would be edited to produce
a
customised
source
file,
or
final adjustments made to a file
NNCNC01.TCP
originating from the Code Wizard and its templates.
%MACHINE=LATHE=...
NNCNC01.4XT compiles as
NNCNC01.TCP
%MACHINE=LATHE=...
NNCNC01.CXT compiles as
NNCNC01.TCP
%MACHINE=UVWIRE=...
NNCNC01.WXT compiles as
NNCNC01.WCP
Copyright
1988-2005
Pathtrace Engineering
Systems. All
reserved.to 8.3 DOS like names. However, you may
Please note
that EdgeCAM
Code Generators
arerights
not limited
wish to adhere to this convention, as EdgeCAM running under Windows 3.1 and Win32S use it. This allows
Code Generators to be freely interchanged without renaming.
The type of lathe Code Generator is determined by the Compiler by the existence of particular macros in the
source file. For example,. Macro 43 = C Axis file, Macro 23 = 4 Axis file.
The Compiler also outputs a *.doc file which can be given to customers with the Code Generator. This file
can be either in printed form or to be viewed using the standard Windows application Notepad.exe, as a
reference guide to the commands within the Code Generator. The Compiler outputs all lines starting with an
asterisk to the .doc file. Any remarks that are only for the applications engineer's reference should begin
with a semi-colon.
Variable Declarations
Users may create their own variables which are referred to as user-defined variables. These are always
entered in upper case and may be of two kinds -numeric and string.
All user defined string and numeric variables must be declared using the statement %DECLARE=. The
general format for this is:
%DECLARE={variable1},{variable2},{variable3},......
Any number of %DECLARE= statements may appear in the post file. User defined string and numeric
variables may be declared within the same statement but for clarity it is better to separate them.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
See Also
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
and logic required to convert the raw EdgeCAM data into usable CNC code.
Numeric
Variables
String Variables
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Numeric Variables
10
All numeric variables have names beginning with a '#' and have a numeric value associated with them. This
has either been:
Declared explicitly, e.g. #BLOCK=10, or
Calculated, e.g. #BLOCK=#START+#COUNT, or
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
String Variables
11
The names for user defined character strings begin with a '$'. These string variables represent a string of
alpha characters which the user has supplied during the machining session or whilst code generating. The
string will be output by the Code Generator.
During compilation of a %MACRO, if a user-defined variable is encountered which has not been declared,
then the following error message will appear:
User-defined variable names may be of any length but must consist solely of alphanumerics (A-Z and 0-9).
It is only necessary to declare user-defined variables, as system variables are predefined. Any attempt to
declare variables not starting with either a '#' or a '$' will result in the Code Generator compiler error:
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
'Invalid
declaration
ina man-readable
{line in error}'
Generator
or "Machine
Tool" file from
source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
where[machine type] may be MILL, LATHE, or UVWIRE. The user-defined text may be up to 78
characters long and will appear on the screen during code generating and would typically contain machine
tool/controller/user name information.
The Code
Compiler
an integral
part of the EdgeCAM suite of software. It creates a Code
Here
is an Generator
example layout
for aisturning
centre:
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
%MACHINE=LATHE=Mori
Seikithe
SL-35
(MM units)
Fanuc
16TF
parameters
and logic required to convert
raw EdgeCAM
data into
usable
CNCcontroller
code.
MM=1,4000,3000,400,1,1,1,0,0,3,50
MT=Upper Turret,10,200,0,300,500,500,1000,-500,-500,-100,2000,1000,10
MT=Lower Turret,10,-200,0,300,-200,0,300,500,500,1000,-500,-500,Source100,1000,200,5
text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a%ENDMACH
suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
The remaining lines of the machine tool macro are Code Generator defined modifiers which can be used
with any of the Code Generator macros.
This document contains information to help you produce a customised Code Generator parameter source
The machine tool macro is terminated by the %ENDMACH statement.
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
See
Also from the Code Wizard and its templates.
originating
MM (Machine Details Line)
MT (Machine Tool Turret Details Line)
12
13
MM=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,26,27
Position
Information
Range
Module
Units
0 = Inches
1 = Millimetres
All
2
3
EdgeCAM
Code Generator
Compiler
Maximum Rapid Rate
Value
All Guide
Maximum Spindle RPM
Value
Mill+Turn
4
Maximum Angular Feed
Value in Degrees/minute
Turn
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
5
Two tapes
0 = No
Turn
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
1 = Yes
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
6
Rapid 3D
0 = No
Mill+Turn
1 = Yes
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
7
Resolve
rapid movement
Resolved
Mill+Turn
using
a suitable
text editor.
Please note that if0 a= Code
Wizard source file is altered
manually it cannot be
1
=
Unresolved
subsequently updated by the Wizard without losing the manual changes.
8
Compatibility
SeeCompatibility
Mill
9 document
Axes
of Rotation
Seeproduce
Axes of Rotation
Mill
This
contains
information to help you
a customised Code Generator
parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
10
Plane Switching
0 = XY
Mill
controller would be edited to produce a customised source file, or final adjustments made to a file
1 = XY, ZX
originating from the Code Wizard and its templates.
2 = XY, ZY
3 = XY, ZX, ZY
11
Initial Plane
Value
Mill
12
Not used
13
0 = Profile
1 = Guide
UVWire
14
Z Top Guide
Value
UV Wire
15
Z Bottom Guide
Value
UV Wire
16
Value
Mill+Turn
17
Mill+Turn
18
Maximum Programmable
Radius
SeeMaximum Programmable
Radius
Mill+Turn
19
0 = Disabled
1 = Enabled
Mill+Turn
20
CX Interpolation
0 = Disabled
1 = Enabled
Turn
SeeCX Interpolation
21
0 = Disabled
1 = NURB (Fanuc)
2 = Spline (Heidenhain)
3 = Siemens 840D
SeeSpline Output
Mill
26
27
Helical arcs
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Here is an example MM line:
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
and logic required to convert the raw EdgeCAM data into usable CNC code.
MM=1,4000,3000,400,1,1,1,0,0,3,50
So, the Maximum RPM is specified as 3000 RPM (position 3=3000).
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
See
Also
subsequently
updated by the Wizard without losing the manual changes.
Compatibility (Position 8 of the MM Line)
Axes of Rotation (Position 9 of the MM Line)
This document
contains
information
to help
produceMachining
a customised Code Generator parameter source
Code
Generators
Configured
for Rotary
andyou
Multiplane
file
specifically
for Configured
a particular for
controller.
In Machining
practice, a Cycles
previously tried and tested text file for a similar CNC
Code
Generators
Five Axis
controller
wouldMode
be edited
to produce
a customised
Rotary Output
(Position
17 of the
MM Line) source file, or final adjustments made to a file
originating
from
the
Code
Wizard
and
its
templates.
Maximum Programmable Radius (Position
18 of the MM Line)
CX Interpolation (Position 20 of the MM Line)
Spline output (Position 21 of the MM Line)
Default CNC Code Filename Extension (Position 27 of the MM Line)
14
Bit
0
1
2
Meaning
Simple Index disabled. (Milling only)
EdgeCAM
Code Generator Compiler Guide
Simple Index enabled. (Milling only)
Visit the Reset macro once the Mirror macro has finished. (Milling only)
4
Enables Reverse Offset. (Milling only)
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
8 or "Machine This
tool side in cases
where
single
45-degree
line
is being profiled.
Generator
Tool"reverses
file fromthe
a man-readable
source
text afile
containing
all the
appropriate
(Turningtoonly)
parameters and logic required
convert the raw EdgeCAM data into usable CNC code.
16
Enable true NEXTMOVE look ahead within the Toolchange Macro. (Turning and
Milling)
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
See Note below.
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
updated by
the Wizard
without
losing4 the
manualcompensation
changes.
32
Enable
EdgeCAM
Version
controller
enhancements. (Milling only)
Note: This bit should only be set in Code Generator files intended exclusively for use
EdgeCAM
or later.
This document containswith
information
to Version
help you4.0
produce
a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
Note
originating from the Code Wizard and its templates.
There is a limitation with the NEXTMOVE system variables within the toolchange macro (%MACRO=15). If
a two stage rapid move is created directly after the toolchange (in the case of Turning by applying a Safe
Approach) the NEXTMOVE variables are set to the intermediate point rather than the final destination point.
To enable the ability to set the NEXTMOVE variables to the next destination point, you should add 16 to the
MM line switch 8. Although this feature gives improved look ahead, the logic in existing code generators
can be upset unless they are modified to take into account this change.
15
Typically, fixed secondary axes are used for 5 axis machining, whereas free secondary axes are used in
multi-plane machining.
A axis is rotation about the world X axis.
B axis is rotation about the world Y axis.
C axis
is rotation
about
the world
Z axis.
The
Code
Generator
Compiler
is an
integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
See Also and logic required to convert the raw EdgeCAM data into usable CNC code.
Code Generators Configured for Rotary and Multiplane Machining
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
16
Primary
Secondary (free)
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
B axis
2 (default)
16
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
axis
4 Please note that
32 if a Code Wizard source file is altered manually it cannot be
using aC suitable
text editor.
subsequently updated by the Wizard without losing the manual changes.
For example,
This
documenta contains
machine information
tool which has
to help
a fixed
youaxis
produce
primary
a customised
A and a free
Code
axisGenerator
secondaryparameter
B would give:
source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
System variable MACHTYPE = 1(A) + 16(B)= 17
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
AMOVE BMOVE and CMOVE hold the rotational value of the primary and secondary axes dependant upon
the definition in the %Machine statement (position 9). From the above example, the machine type = 1(A
primary) + 16(B secondary) = 17, therefore:
AMOVE = ROT1
BMOVE = ROT2
CMOVE = #FUNNY
17
ROT1 and ROT2 will always be identical to two of the variables in both planar and rotary modes. For
turning, CMOVE will always be the primary axis. These variables are accessed through the Index macro.
When rotary mode has been selected, all rotary system variables will be available in the Feed, Rapid and
Move Angular macros.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
18
A axis
B axis
C axis
Primary
Secondary (fixed)
64
2 (default) Code
128 Generator Compiler Guide
EdgeCAM
4
256
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
19
The Profile Milling command supports six different toolpath outputs dependent upon Switch 17 on the MM
line and the Compensation modifier.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Tool Centre path at depth: The wrapped toolpath outputs the NC co-ordinates by outputting the tool centre
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
position at the specified depth of the cycle.
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
MM 17= 0 , Compensation = Pathtrace
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
Tool
path
ateditor.
Wrap Please
level: The
outputs
the NC
by outputting
thebe
tool
usingCentre
a suitable
text
notewrapped
that if a toolpath
Code Wizard
source
fileco-ordinates
is altered manually
it cannot
centre
position
at
the
wrapped
level
of
the
specified
entities.
subsequently updated by the Wizard without losing the manual changes.
MM 17= 1 , Compensation = Pathtrace
This document contains information to help you produce a customised Code Generator parameter source
file specifically
Tool
Centre path
for aatparticular
Unwrapped:
controller.
The unwrapped
In practice,toolpath
a previously
outputs
tried
the
and
NCtested
co-ordinates
text file by
for outputting
a similar CNC
the
controller
tool
centrewould
position
be edited
of the unwrapped
to produce a
specified
customised
entities.
source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
MM 17= 2 , Compensation = Pathtrace
Tool Reverse offset at depth: The wrapped toolpath outputs the NC co-ordinates by offsetting the tool
centre position by the radius of the tool back towards the geometry boundary at the specified depth of the
cycle.
MM 17= 0 , Compensation = Controller
Tool Reverse
offset
at Wrap
level: The
wrapped
toolpath
outputs the NC co-ordinates by offsetting the
Copyright
1988-2005
Pathtrace
Engineering
Systems.
All rights
reserved.
tool centre position by the radius of the tool back towards the geometry boundary at the wrapped level of the
selected entities.
MM 17= 1 , Compensation = Controller
Tool Reverse offset Unwrapped: The unwrapped toolpath outputs the NC co-ordinates by offsetting the
tool centre position by the radius of the tool back towards the geometry boundary of the selected entities.
MM 17= 2 , Compensation = Controller
20
21
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
*...|16
|17|18|19|20
Generator
or "Machine
Tool" file from a man-readable source text file containing all the appropriate
MM=...,1.5,1
,-1,1to ,0
setEdgeCAM
to -1 removes
parameters
and logic required
convert(MPR
the raw
dataany
intolimitations)
usable CNC code.
Source
text
files may
be created
viasame
the interactive
facilities
of the
Wizard
may be written
The MPR
should
be entered
in the
units as set
in switch
1 ofCode
the MM
line. or
If non-default
unitsdirectly
are used
using
a
suitable
text
editor.
Please
note
that
if
a
Code
Wizard
source
file
is
altered
manually
it
cannot be
in a part program, the decimal place for the MPR will be moved up or down 1 place accordingly.
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
22
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
23
The spline
Code Generator
output from
Compiler
EdgeCAM
is an
depends
integralon
part
theofmachine
the EdgeCAM
type selected,
suite of as
software.
the spline
It creates
formatsa of
Code
the
Generator
Fanuc,
Heidenhain
or "Machine
andTool"
Siemens
file from
controllers
a man-readable
are different.
source
The text
Fanuc
file controller
containingaccepts
all the appropriate
any NURB spline
parameters
up
to degreeand
3, the
logic
Heidenhain
required tocontroller
convert the
requires
raw EdgeCAM
a cubic polynomial
data into usable
parameterised
CNC code.
over the range [1..0],
and the Siemens controller requires a cubic polynomial paramaterised over the range [0..1]. (It also accepts
NURB splines of degree 2 or 3, but EdgeCAM does not output these for the Siemens controller.)
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
See Also
subsequently updated by the Wizard without losing the manual changes.
Fanuc-Style Spline Output
Heidenhain-Style Spline Output
This document Spline
Siemens-Style
contains
Output
information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
24
25
Switch 27 on the MM line is a default extension for CNC code files (without the dot).
To set an extension of 'TNC' for example:
;
1| 2
| 3
|9|0|1|2|3|4|5|6|7
MM=1,30000,2000,0,0,0,1,39,2,0,20,0,0,0,0,1,0,9999.999,1,0,0,0,0,0,0,0,TNC
This is used if you leave the extension of the CNC code filename unspecified, when generating CNC code.
It takes precedence over the default extension specified using Options menu Preferences Toolpaths
tab Default NC File Extension.
Omit the extension to leave a double comma ('...0,0,,0' for example), if you do not want to set it and you are
adding further switches to the line.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
26
MT=name,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
Position
Information
Range
Module
Turret Name
String
All
Number of stations
Toolchange X position
Value
All
Toolchange Y position
Value
All
Value
Mill+Turn
EdgeCAM Code Generator
Compiler
Guide
5
Toolchange Z position
Value
Mill+Turn
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or
"Machine
file from a man-readable source
text file containing All
all the appropriate
6
Tool
home XTool"
position
Value
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
7
Tool home Y position
Value
All
8
Tool home Z position
Value
Mill+Turn
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
9
Maximum
X value
Value
Allmanually it cannot be
using
a suitable
text editor.
Please note that if a Code Wizard
source file is altered
subsequently updated by the Wizard without losing the manual changes.
10
Maximum Y value
Value
All
11
Maximum Z value
Value
All
This document contains information to help you produce a customised Code Generator parameter source
12 specifically
Minimum
X value controller. In practice, a previously
Value tried and testedAll
file
for a particular
text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
13
Minimum Y value
Value
All
originating from the Code Wizard and its templates.
14
Minimum Z value
Value
All
15
Value
Mill+Turn
16
Value
Mill+Turn
17
Value in Seconds
All
18
Currently only
2 supported
Turn
19
Turn
20
Value
Turn
21
22
Default Spindle Id
0 or 1
Turn
These parameters provide information on a specific turret (one line per turret).
Here are example MT lines:
MT=Upper Turret,10,200,0,300,500,500,1000,-500,-500,-100,2000,1000,10
MT=Lower Turret,10,-200,0,300,-200,0,300,500,500,1000,-500,-500,100,1000,200,5
So, from the example above, the first MT line has the turret name "Upper Turret", 10 stations, and so on.
For machines with multiple turrets on one slide, also see Macro 15 Toolchange.
27
Please note that these lines are alternatives to using Data Arrays for specifying their information.
If Macro 252 - Spindle Control is present this method will be used for spindle and gear definitions. This is
implemented for Advanced Turning.
MS=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17
Position
Information
Values
Type
The
Compiler is an integral 0,1,2,3
part of the EdgeCAM suite of software. It creates a Code
2 Code Generator
ID
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
3
TurretId
(-1=Not Applicable)
parameters
and logic required to convert theValue
raw EdgeCAM
data into usable CNC code.
4
Type
0 (Tool), 1 (Work)
Source
text Max
files may
5
RPMbe created via the interactive
Value facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
6
MaxAngFeed
subsequently
updated by the Wizard withoutValue
losing the manual changes.
7
Direction
0 (CCLW),1 (CLW)
This
document
contains information to help you
8
MirrorOutput
0,1 produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
9
CSSbe
Capable
0 (No), 1source
(Yes) file, or final adjustments made to a file
controller
would
edited to produce a customised
originating
from
the Code Wizard and its templates.
10
Rotation
0 (none),1 (A), 2(B), 3 (C)
11
Default Location X
Value
12
Default Location Y
Value
13
Default Location Z
Value
14
DefaultTurretID
0,1
15
HorsePower
Value
16
DatumToChuckFace
Value
17
RapidRate M/Min
Value
These parameters provide information on a specific spindle (one line per spindle).
Here is an example MS line:
MS=Main,0,-1,1,7500,280,0,0,1,3,0,0,0, 0,20,130
MG=1,2,3,4,5(,2,3,4,5(,2,3,4,5(,etc.)))
Position
Information
Values
Value
Value
Value
Value
M Code
Value
(2,...
These parameters provide information on a set of gears for a spindle (one line per set of gears).
28
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Macros
29
The macro definitions within the Code Generator parameter files follow a standard layout as follows:
%MACRO=[Number]=[Syntax]=[Description]=[Modifier List]=[Option List]
:
: [directives to control and generate CNC output]
:
%ENDM
The
of the %MACRO
line
is mostpart
important
as it controls
theofscreen
menus
which aappear
The format
Code Generator
Compiler
is itself
an integral
of the EdgeCAM
suite
software.
It creates
Code
during
machining.
Generator
or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
See Also
Number
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using
Syntaxa suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
Description
Modifier List
This document contains information to help you produce a customised Code Generator parameter source
Option
List
file specifically
for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Number
30
This is used to direct the Code Generator and machining programs as to what function is being defined.
Relevant macros must be defined within the Code Generator, otherwise the corresponding command
will not be available during an EdgeCAM machining worksession using it.
1-50
Executive macros whose number relates to a predefined list of machining functions (see
relevant module chapters) and may produce cutter motions on the graphics screen, e.g.
The Code Generator
is an integral
of the
EdgeCAM
suite ofwithin
software.
It creates
a Code
toolchange,Compiler
profile, rapid,
feed etc.part
These
macros
are defined
the Code
Generator.
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
51-100
Non
macros
whose number
to adata
predefined
list ofCNC
non-machining
parameters
andexecutive
logic required
to convert
the raw relates
EdgeCAM
into usable
code.
functions.
Others in this group are contained within the Code Generator (for example, START, END,
Source textCLW,
files may
be created
via the
interactive
facilities
of the
Codethe
Wizard
may
CCLW,
SUBSTART,
RESET
and so
on). They
control
start or
and
endbeofwritten
CNC directly
using a suitable
text
editor.
Please
note
that
if
a
Code
Wizard
source
file
is
altered
manually
it cannot
programs and other special requirements such as subroutines. They do not form part
of be
subsequently
updated
by
the
Wizard
without
losing
the
manual
changes.
any menus offered to the user during machining and are referred to by name rather than
number within the Code Generator although they do have numbers which can be
accessed by the NEXTMACRO system variable.
This document contains information to help you produce a customised Code Generator parameter source
101-150
User-defined
macros
which allow
control of
M code type
CNC
special
file
specifically
for a particular
controller.
In practice,
a previously
tried
andoperations
tested textorfile
for a similar CNC
customer
requirements
(for aexample,
probing,
part
changer),
including PDIs.
These
controller would
be edited
to produce
customised
source
file,
or final adjustments
made
to a file
have
no graphical
on the tool path graphics when invoked. User defined
originating macros
from thewill
Code
Wizard
and its effect
templates.
macros become additional commands within EdgeCAM and are automatically merged into
theM-Functions menu, when the machine tool file is selected for a machining sequence.
We advise that M-Functions should use macros from 101 upwards and PDIs should use
macros from 150 downwards.
151-199 Reserved exclusively for use when writing a C Axis Code Generator.
200
Reserved for use in connection with PDIs. Allows PDIs to define tooling.
Note that macros with numbers greater than 200 are not permitted.
Syntax
31
Macros in source files used for PAMS may contain a two letter =??= unique syntax string or combination
syntax string of =??/??/??=.
EdgeCAM Macros do not use this format, and the two-letter string should be replaced with =..=, as shown
here:
=RT= becomes =..=
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Description
32
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Modifier List
33
The modifier list defines which parameters or modifiers are requested when that macro is invoked. The
parameters are numbers which refer to the parameter list defined in the particular machining language file
(see the relevant module chapters for an explanation and example of the machining language file).
For example:
%MACRO=15=..=Toolchange=8,4,7,48,15,
Each modifier number is separated by a comma. The last entry is also followed by a comma.
Certain parameters will always appear in the menus by default, for example the Cycles menu Rough
Profile command has the modifier Canned Cycle, which is a check box. To remove these from the menu,
prefix the parameter number by a negative sign (-).
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "Machine
file from
a man-readable
source
text file Canned
containing
all the
appropriate
For
example,
the macroTool"
line shown
below
would remove
the modifier
Cycle
from
the Rough Turn
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
cycle:
%MACRO=4=..=ROUGH TURN=4,5,7,10,30,31,-21,40, 41,
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
If
the CANNED
modifier
is removed
the menu
of source
any macro,
mustmanually
redirect processing
using
a suitableCYCLE
text editor.
Please
note that from
if a Code
Wizard
file isyou
altered
it cannot be
through
"%NOCYCLE".
The
system
variable
PATHTRACE
automatically
returns
the
value of 1, but only
subsequently updated by the Wizard without losing the manual changes.
after regenerating the menu file and regenerating the machining instructions.
Any modifier displayed in a EdgeCAM machining command can be removed in this way (use the number in
This
document
information
to helpinyou
a customised
parameter
source
the first
column contains
to the right
of the modifier
the produce
ptmach.cmd
file). This Code
is veryGenerator
useful where
some complex
file
specifically
for
a
particular
controller.
In
practice,
a
previously
tried
and
tested
text
file
for
a
similar
CNC
EdgeCAM functionality is not required.
controller would be edited to produce a customised source file, or final adjustments made to a file
A
good example
is the
threading
which can be greatly simplified for many applications.
originating
from the
Code
Wizardcommand,
and its templates.
EdgeCAM may refuse to execute a command if certain essential modifiers are removed. Also, you can
get inconsistent results if you removed modifiers from generic commands such as Profile, Areaclear and
Crosshatch (Lace).
See Also
Assigning Values to Specific System Variables
Setting Default Modifier Values
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
In this example the value of the MOVE ARC command 2POINT modifier will be set up in variable number
176, FIELD1.
A better use of this feature is to obtain variable information from PDI-defined commands.
Do not re-assign system variables, used by the current machining session, with inappropriate data.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
See Also
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
System Variables by Number
System Variables by Name
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
34
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
35
Option List
36
If the option list part of the %MACRO definition is present, an appropriate text list box will be available within
the command.
For example:
%MACRO=104=..=Coolant==Flood/Off
This example adds 'Coolant' to the M-Functions menu. If the command is selected, a drop down list box
containing the options Flood and Off is displayed:
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
Within the user-defined macro, the value is assigned to the system variable SUBFUNCT.
subsequently updated by the Wizard without losing the manual changes.
Also note the two consecutive equals signs in this definition '=='. This is because the optional modifier's
numbers are not required for this user-defined macro.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
37
Format Table
38
When numeric variables (either system- or user-defined) are output as part of a line of CNC code, the post
must be instructed to format the number in terms of the letter address, leading zeros, trailing zeros etc., for
both millimetre and inch programs.
When a numeric variable is to be output as CNC code, a format table number is associated with it and the
numeric value associated with that variable name will be formatted as the line definition.
The first line after the %FORMAT is numbered zero, the next line is 1, and so on until the %ENDF
statement.
Y MOVE
I,3,4,128,4,3,128,
I MOVE
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
J,3,4,128,4,3,128,
3
J MOVE
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
R,3,4,128,4,3,128,
4
R MOVE
subsequently
updated by the Wizard without
losing the
manual changes.
G,2,0,1,2,0,1,
GCODE
N,5,0,0,5,0,0,
BLOCK
NUMBER
This
document contains information to6help you produce
a customised
Code Generator parameter source
file%ENDF
specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
The table must start with the line '%FORMAT' and the lines following must be in the order shown. Each line
in the table must contain seven entries followed by commas. Each entry has the following function:
Order
Line
Function
Significant Digits
Decimal Places
Control Code
Significant Digits
Decimal Places
Control Code
The control code is crucial to controlling the format of a number in a CNC program. The code is made up by
adding together the control values from this table:
Control Value
Control Function
39
EdgeCAM
Code
Generator Compiler Guide
No decimal point
must be present
16
32
64
The
Compiler
is anofintegral
part of the EdgeCAM suite of software. It creates a Code
128 Code Generator
Force
'.0' on end
integers
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
256
Force
'+' on front
of positive
numbers
parameters
and logic
required
to convert
the raw
EdgeCAM data into usable CNC code.
512
X,3,3,128,3,3,128
Y,3,3,128,3,3,128
X2.0
2.125
X2.125
.25
X.25
Y2.0
2.125
Y2.125
Copyright 1988-2005 Pathtrace Engineering Systems.
All rights reserved.
I,4,3,64,4,3,64
J,4,2,21,4,2,21
25
Y25.0
I2.
2.125
I2.125
25
I25.
J000200
2.125
J000212
25
J002500
<[#BNUM=7] [#GCODE=6][#XMOVE=0][#YMOVE=1]>
...
%ENDM
This would output the following type of code:
N110 G01X25.352Y-42.1
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
40
41
XSTART
55
NEXTYMOVE
109
YDELTA
163
UMOVE
YSTART
56
XSAFE
110
XREP
164
VMOVE
XCENTRE
57
ZSAFE
111
YREP
165
WMOVE
YCENTRE
58
PITCH
112
PIP
166
PRECISION
RADIUS
XEND
60
OFFSETX
114
YSHEET
168
dummy
EdgeCAM
Code
Generator
Compiler
Guide
OFFSETZ
XSHEET
TOLERANCE
59
113
167
YEND
NEXTMACRO
PASS
SCALE
7
61
115
169
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
XMOVE
PATHTRACE
OFFSET
THICKNESS
8
62 file from
170the appropriate
Generator
or "Machine Tool"
a man-readable116
source text file containing all
parameters
and logic required
convert the raw EdgeCAM
into usable CNC171
code.XYPLANE
YMOVE
LEFTRIGHT
9
63 to STCOMMAND
117 data
ZMOVE
ENCOMMAND
LACECUT
UVPLNAE
10
64
118
172
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
UNIT
XSTARTPOS
ROWPRIORITY
LOWERWIRE
11
65
119
173
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
the Wizard
without losing the120
manual
changes.
XHOMEupdated by 66
ZSTARTPOS
MAXFEED
UPPERWIRE
12
174
YHOME
XENDPOS
MAXRPM
WIREDIAM
13
67
121
175
This document
to help you produce a customised
parameter
source
ZHOME contains information
ZENDPOS
MAXRAPIDCode Generator
FIELD1
14
68
122
176
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
XTOOL
XCURRENTPOS
TXMAX
FIELD2
controller
would be edited69
to produce
a customised source
or final adjustments
to a file
15
123 file,
177made
originating from the Code Wizard and its templates.
YTOOL
ZCURRENTPOS
TYMAX
FIELD3
16
70
124
178
17
ZTOOL
71
TOTALDEPTH
125
TZMAX
179
FIELD4
18
TOOLNUM
72
FEEDTYPE
126
ZTOOL1
180
FIELD5
19
TOOLRAD
73
NEXTSPEED
127
XTOOL1
181
FIELD6
20
TOOLEN
74
NEXTFEED
128
MACHTIME1
182
FIELD7
ZCLEAR
NEXTCOMP
MACHTIME2
21
75
129
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
XYFEED
NEXTCSS
IDLE1
22
76
130
183
FIELD8
184
FIELD9
23
ZFEED
77
DEPTH
131
IDLE2
185
FIELD10
24
SPEED
78
NEXTOOLPOS
132
YMAX
186
FIELD11
25
LAST
79
STARTSUB
133
FPASS
187
FIELD12
26
CIRCLE
80
ENDSUB
134
YSTEP
188
TAPERTYPE1
27
ZDEPTH
81
FEED
135
ORIENTATE
189
TAPERTYPE2
28
FPECK
82
CSS
136
TLXLEN
190
TAPER1
29
DEGR
83
COMP
137
TLYLEN
191
TAPER2
30
DWELL
84
DIRECTION
138
PUNCHMODE
192
NEXTXCENTRE
31
RPLANE
85
NEXTXYFEED
139
ZSHEET
193
NEXTYCENTRE
32
IPLANE
86
NEXTZFEED
140
ZHOME1
194
NEXTRADIUS
33
SUBROUTINE
87
ZMAX
141
XHOME1
195
MACRONAMEOP
34
XSUB
88
XMAX
142
NUMTOOLS1
196
APPEND
35
YSUB
89
NEXTGEAR
143
QUADRANT
197
CMT1
36
ZSUB
90
NEXTXMOVE
144
INDEX
198
CMT2
37
XINC
91
NEXTZMOVE
145
USERVAR1
199
LIBTYPE
38
YINC
92
TOOLCHANGE
146
USERVAR2
200
USERMATRIX
39
ZINC
93
SUBFUNCT
147
USERVAR3
201
CIT1
40
REPEAT
94
dummy
148
USERVAR4
202
CIT2
41
POSITION
95
ZLEVEL
149
USERVAR5
203
NOCYCLE
42
NEXTOOL
43
ZSTART
97
CMOVE
151
XDATUM
205
ROT2
44
ZCENTRE
98
TOTDEPTH
152
PECKRETRACT
206
WRAPRADIUS
RMOVE
YDATUM
ROT1
EdgeCAM
Code
Generator
Compiler
96
150
204Guide
The
Generator Compiler
an integral part of the153
EdgeCAM
suite of software.
ZEND
CONTMATRIX
RTYPEa Code
45 Code
99 is NEXTOOLLEN
207It creates
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
TOOLXSET
CSTART
46
100 to MASK
154 data
parameters
and logic required
convert the raw EdgeCAM
into usable CNC208
code.STYPE
47
TOOLZSET
101
NEXTARC
155
RSTART
209
SYSID
Source
text
TOOLWIDTH
files may be created
DRILLSUB
via the interactive facilities
the Code Wizard or
may be
SILENT
written directly
48
102
156 ofCCENTRE
210
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
TOOLANGLE
NUMTOOLS
RCENTRE
YGAUGE
49
211
subsequently
updated by 103
the Wizard
without losing the157
manual
changes.
50
TURRET
104
SFMOD
158
CEND
212
TRUEARCOP
TOOLUNIT
ANGLE
REND
AMOVE
This
51 document
contains information
105
to help you produce
159a customised
Code Generator
213 parameter
source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
TOOLANGLE1
STEP
NUMBLOCKS
BMOVE
52
160 file,
214made
controller
would be edited106
to produce a customised source
or final adjustments
to a file
originating
from
the
Code
Wizard
and
its
templates.
TOOLANGLE2
STANGLE
NUMCHARS
53
107
161
54
TOOLTYPE
108
XDELTA
162
CAXIS
42
43
AMOVE
213
MASK
100
SPEED
24
XDELTA
108
ANGLE
105
MAXFEED
120
STANGLE
107
XEND
APPEND
196
MAXRAPID
122
STARTSUB
79
XENDPOS
67
BMOVE
214
MAXRPM
121
STCOMMAND
63
XHOME
12
CAXIS
EdgeCAM
Code Generator
Compiler
Guide
NEXTARC
STEP
XHOME1
162
101
106
CCENTRE
156
NEXTCOMP
75
STYPE
208
XINC
141
37
CEND
NEXTCSS
SUBFUNCT
XMAX
158
76
93
88
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
CIRCLE
NEXTFEED
SUBROUTINE
XMOVE
26 Tool" file
74
33
Generator or "Machine
from a man-readable
source text file containing
all the appropriate 8
parameters
and logic
requiredNEXTGEAR
to convert the raw
data into usable
CIT1
SYSID
XREP
201
89 EdgeCAM
209CNC code.
110
CIT2
NEXTMACRO
TAPER1
XSAFE
202
61
190
56
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
CMOVE
NEXTOOL
TAPER2
XSHEET
97
42
191
113
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
updated
without losing
changes. 188
CMT1
NEXTOOLLEN
TAPERTYPE1
XSTART
197by the Wizard
99 the manual
1
CMT2
NEXTOOLPOS
TAPERTYPE2
XSTARTPOS
198
78
189
65
This
document contains information
to help you produceTEXTCASE
a customised Code Generator
COMP
NEXTRADIUS
XSUBparameter source
83
194
34
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
CONTMATRIX
NEXTSPEED
THICKNESS
XTOOL
controller
would be edited
a customised
file, or final adjustments
made to a file 15
153 to produce
73 source
170
originating from the Code Wizard and its templates.
CSS
NEXTXCENTRE 192
TLXLEN
XTOOL1
82
136
127
CSTART
154
NEXTXMOVE
90
TLYLEN
137
XYFEED
22
DEGR
29
NEXTXYFEED
85
TOLERANCE
167
XYPLANE
171
DEPTH
77
NEXTYCENTRE
193
TOOLANGLE
49
YCENTRE
DIRECTION
84
NEXTYMOVE
55
TOOLANGLE1
52
YDATUM
150
DRILLSUB
NEXTZFEED
TOOLANGLE2
102
86
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
dummy
NEXTZMOVE
TOOLCHANGE
168
91
53
YDELTA
109
92
YEND
dummy
94
NOCYCLE
203
TOOLEN
20
YGAUGE
211
DWELL
30
NUMBLOCKS
160
TOOLNUM
18
YHOME
13
ENCOMMAND
64
NUMCHARS
161
TOOLRAD
19
YINC
38
ENDSUB
80
NUMTOOLS
103
TOOLTYPE
54
YMAX
132
FEED
81
NUMTOOLS1
142
TOOLUNIT
51
YMOVE
FEEDTYPE
72
OFFSET
116
TOOLWIDTH
48
YREP
111
FIELD1
176
OFFSETX
60
TOOLXSET
46
YSHEET
114
FIELD10
185
OFFSETZ
59
TOOLZSET
47
YSTART
FIELD11
186
ORIENTATE
135
TOTALDEPTH
71
YSTEP
134
FIELD12
187
PASS
115
TOTDEPTH
98
YSUB
35
FIELD2
177
PATHTRACE
62
TRUEARCOP
212
YTOOL
16
FIELD3
178
PECKRETRACT
152
TURRET
50
ZCENTRE
44
FIELD4
179
PIP
112
TXMAX
123
ZCLEAR
21
FIELD5
180
PITCH
58
TYMAX
124
ZCURRENTPOS
70
FIELD6
181
POSITION
41
TZMAX
FIELD7
182
PRECISION
FIELD8
183
FIELD9
FPASS
FPECK
125
ZDEPTH
27
166
UMOVE
163
ZEND
45
PUNCHMODE
138
UNIT
11
ZENDPOS
68
184
QUADRANT
143
UPPERWIRE
174
ZFEED
23
133
RADIUS
USERMATRIX
200
ZHOME
14
RCENTRE
USERVAR1
ZHOME1
EdgeCAM
Code Generator
Compiler
Guide
28
157
145
140
IDLE1
130
REND
159
USERVAR2
146
ZINC
39
IDLE2
131
REPEAT
40
USERVAR3
147
ZLEVEL
95
The
Code Generator
CompilerRMOVE
is an integral part
software.ZMAX
It creates a Code
INDEX
USERVAR4suite of148
144
96 of the EdgeCAM
87
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
IPLANE
USERVAR5
ZMOVE
32requiredROT1
204EdgeCAM
149CNC code.
10
parameters
and logic
to convert the raw
data into usable
LACECUT
118
ROT2
205
UVPLANE
172
ZSAFE
57
Source
LAST text files may
ROWPRIORITY
via the interactive
VMOVE
of the Code Wizard
ZSHEET
be written directly
25be created
119 facilities
164 or may
139
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
LEFTRIGHT
RPLANE
WIREDIAM
ZSTART
117by the Wizard
31 the manual
43
subsequently
updated
without losing
changes. 175
LIBTYPE
199
RSTART
155
WMOVE
165
ZSTARTPOS
66
LOWERWIRE
RTYPE to help you
ZSUBparameter source
This
document contains
173 information
207
produceWRAPRADIUS
a customised Code
206 Generator
36
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
MACHTIME1
SCALE
XCENTRE
ZTOOL
128 to produce
169 source
3
controller would be edited
a customised
file, or final adjustments
made to a file 17
originating
from the 129
Code Wizard
and its templates.
MACHTIME2
SFMOD
XCURRENTPOS 69
ZTTOL1
104
126
MACRONAMEOP
195
SILENT
210
XDATUM
151
44
If no lead is specified a 90 degree straight lead will be created. The length will be the tool radius multiplied
by the radius compensation factor.
For all other manual linear leads a move at 90 degrees is appended to the lead. The length of this move is
calculated by multiplying the tool radius by the radius cutter compensation factor stored in the code
generator.
The
Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
"Machinecombinations
Tool" file from
text
file containing
the appropriate
For arc andorarc/linear
aa
90man-readable
degree move source
(with the
length
of the toolall
radius
multiplied by the
parameters
and
logic
required
to
convert
the
raw
EdgeCAM
data
into
usable
CNC
code.
radius cutter compensation factor) is appended to the lead.
In all cases these compensation moves are calculated from the nominal offset path to ensure that there is
sufficient
movement
cuttervia
radius
compensation
to beofapplied.
Source text
files mayfor
bethe
created
the interactive
facilities
the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
by the Wizard without losing the manual changes.
End
Point Liftupdated
Out
The end point of the lead out move has been adjusted to prevent the 3D moves that were previously
generated
and to
represent
more closely
theyou
situation
on athe
machine tool.
This document
contains
information
to help
produce
customised
Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller
would be edited to produce a customised source file, or final adjustments made to a file
Code Generators
originating from the Code Wizard and its templates.
In order to take advantage of this new compensation logic you have to use the updated milling templates.
All existing code generators will function as previously. A user update on the template will implement these
changes for Code Wizard based code generators.
Custom posts will need minor changes to benefit from this logic:
45
Multilevel Drilling
46
This section clarifies the role of the Retract option in drilling cycles.
When completing a Hole Cycle dialog you are asked for depth settings of ZLEVEL, RETRACT
DISTANCE, DEPTH and ZCLEAR.
For single level cycles the RETRACT DISTANCE is passed to the Code Generator as a Retract Plane set at
ZLEVEL+RETRACT. If no retract distance is given the Retract Plane defaults to the Clearance Plane
Height.
For Multilevel drilling the ZLEVEL is ignored and a RETRACT distance is passed to the Code Generator. If
a RETRACT distance is not stated it defaults to the ZCLEAR height. The Code Generator will then set up a
Retract plane based on the height of the first point and that Retract Distance. For this reason it is
recommended that in Multilevel Drilling a RETRACT distance should always be entered in the dialog.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
If
any multilevel
cycles are
to file
be used
is suggested that
for best
all hole all
cycles
with the same tool
Generator
or "Machine
Tool"
from ait man-readable
source
text results
file containing
the appropriate
should
be
treated
as
multilevel.
A
combination
of
multilevel
and
single
level
cycles
with
the
parameters and logic required to convert the raw EdgeCAM data into usable CNC code. same tool may
not give the expected NC output.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
As with other Code Generator commands, the use of a colon : character denotes a new command
on the same input line.
The Generator
order of evaluation
and +- follows
the EdgeCAM
usual rule of
( ) then
^ then */Itthen
+- a Code
The Code
Compilerofis(),
an*/integral
part of the
suite
of software.
creates
Generator
or "Machine
from a assign
man-readable
The =
symbol isTool"
used file
to denote
value source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Variables may be assigned as follows:
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using
Simple
a suitable
Assignments
text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
Arithmetic Calculations
Use of Operators
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
47
#BNUM=#START
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
48
Arithmetic Calculations,(variable)=(variable/number)(operator)(variable/number)
Where {operator} is:
+
(plus)
(minus)
/
*
^
(divide)
EdgeCAM
Code Generator Compiler Guide
(multiply)
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
For
example:
Generator
or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
and logic required to convert the
raw EdgeCAM
dataofinto
usable
CNC
#BNUM=#BNUM+10
Assigns
the old value
#BNUM
with
10 code.
added to it
#IVALUE=XCENTRE-XSTART
Assigns the difference between XCENTRE and XSTART
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
#DIAM=2*#RADIUS
Assigns a value 2 times that of #RADIUS
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
updated by the Wizard without losing the manual changes.
#TEST=(#TEST1+#TEST2)*#TEST3-#TEST4
This document
contains information
to help youof
produce
a customised
Code Generator parameter
There
is also a shortened
form for expressions
the form
{num1}={num1}{operator}{num2}
where source
the
file
specifically
operator
is + -/ for
or *,a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
for
examplefrom
#BNUM=#BNUM+#BNUMVAR
May be written as: #BNUM=+#BNUMVAR
originating
the Code Wizard and its templates.
49
sine
COS
cosine
TAN
ATAN
ASIN
tangent
EdgeCAM
Code Generator Compiler Guide
arc tangent
arc sine
ACOS
arc cosine
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "Machine
Tool" file from a man-readable source text file containing all the appropriate
SQR
square root
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
INT
integer value of *
ABS
remove sign
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
Note
trigonometric
angular
arguments
DEGREES.
usingthat
a suitable
text editor.
Please
note thatare
if ainCode
Wizard source file is altered manually it cannot be
subsequently
updated
by
the
Wizard
without
losing
the
manual
changes.
* INT converts real numbers to integers by rounding down.
Thus
74.6 becomes 74 and 74.3 becomes 75. If rounding to nearest is required it can be achieved as follows
This document
contains information to help you produce a customised Code Generator parameter source
#PRECISION=1000
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller
would be edited to produce a customised source file, or final adjustments made to a file
#XMOVE=(#XMOVE*#PRECISION+0.5
originating from the Code Wizard and its templates.
#XMOVE=INT(#XMOVE)
#XMOVE=#XMOVE/#PRECISION
For example, the coding to calculate incremental unsigned arc centres could be:
#IVALUE=XCENTRE-XSTART:#IVALUE=ABS(#IVALUE)
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
#JVALUE=YCENTRE-YSTART:#JVALUE=ABS(#JVALUE)
50
...
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
...or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
@SKIP
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
String
comparisons
areby
space
dependent.
There
should
be no space
after the operator and a space should
subsequently
updated
the Wizard
without
losing
the manual
changes.
be placed after the testing string.
String variables may be defined as in the following example to obtain strings which contain spaces; for
This document contains information to help you produce a customised Code Generator parameter source
example:
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller
would be edited is
to produce
a customised
source file, or final adjustments made to a file
$STRING="This
a string
variable"
originating from the Code Wizard and its templates.
$MESSAGE="***A string message ***"
51
Labels
52
Labels are positional indicators within a macro that define where code generating should continue after a
conditional or unconditional jump.
All labels must start with the character @ and must then be followed by the alphanumeric name of that
label. A label statement must appear on a line of its own.
The jump label destination of %GOTO must be within the macro in which that %GOTO occurred.
Should more than 100 labels be defined in any one macro the compiler error message will be issued:
TOO MANY LABELS
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
An example of a label is:
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
:
Source:text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
%GOTO updated
@JUMP by the Wizard without losing the manual changes.
:
This document contains information to help you produce a customised Code Generator parameter source
:
file specifically
for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
@JUMP
originating from the Code Wizard and its templates.
Directives
53
Directives are the commands available within macros and procedures that allow the manipulation of the
data available within each macro.
See Also
%ASK
%IF
... %THEN
...
The Code
Generator
Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or
"Machine
Tool"
%IF... %THEN ... %ELSE
... file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
%INCLUDE
%OPTIONS
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
%ASK
54
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
updated
by the(or
Wizard
without
losing
the manual
changes.
If no replay string
is entered
Escape
or Abort
selected)
the return
value is set as #FUNNYfor numeric
variables or a null string("") for string variables.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
55
These directives indicate that all data between the %COMMAND and %ENDCOMMAND is to be included
within the EdgeCAM menu structure.
This feature is specifically designed to allow a PDI program (EdgeCAM Development Interface program) to
be integrated within EdgeCAM and to be invoked in an identical manner to any other core EdgeCAM
command.
Here is a typical example allowing a PDI function (a PLANAR CIRCLE POCKET cycle) to be included within
the EdgeCAM menu structure:
%COMMAND
#CYCLES
9 suite of software. It creates a Code
The
Code Generator20
Compiler is an integral part of the1EdgeCAM
Generator
PLANAR or "Machine
2 Tool" file from a man-readable 1source text
2 file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
CIRCLE_POCKET|circpkt
121
26
FEEDRATE
105
16
16
116
DEPTH_PARMS
162a customised
256
169
-2
285
This document contains
information to help you produce
Code Generator
parameter
source
file specifically for a particular
controller.
In
practice,
a
previously
tried
and
tested
text
file
for a similar CNC
CLEARANCE
28
5
28
2
128
controller would be edited to produce a customised source file, or final adjustments made to a file
LEVEL
161
5
168
2
287
originating from the Code Wizard and its templates.
DEPTH
109
%ENDCOMMAND
The above example will access a PDI called circpkt.exe using those modifiers specified within the Code
Generator. This format is consistent with that found within EdgeCAM *.cmd files.
%DEBUG
56
%DEBUG=ON
%DEBUG=OFF
This statement allows debug mode to be switched on and off from within a Code Generator.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
57
This is an unconditional jump which commands the Code Generator to continue code generating at a
position within the macro defined by a jump label.
For example:
%GOTO @DONT-ASK
...
...
...
The Code
Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
@DONT-ASK
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
58
This is a conditional jump which sets up a test condition which can be used to control the subsequent flow
of the Macro or procedure.
Valid tests for the %IF directives are:
=
equal to
EdgeCAM
Code Generator Compiler Guide
not equal to
<>
<
less than
<= or =<
The
is an integral part of the EdgeCAM suite of software. It creates a Code
> Code Generator
greater Compiler
than
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
>= or => and
greater
or equal
to
parameters
logic than
required
to convert
the raw EdgeCAM data into usable CNC code.
For example:
Source
text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
%IF #FRED=2
%THEN
%GOTO
@DONT-ASK
subsequently
updated by
the Wizard
without
losing the manual changes.
%ASK=Enter value for #FRED=#FRED
This document contains information to help you produce a customised Code Generator parameter source
@DONT-ASK
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
or the shortened version (which cannot be used with %ELSE):
originating from the Code Wizard and its templates.
%IF #FRED=2 @DONT-ASK
%ASK=Enter value for #FRED=#FRED
@DONT-ASK
See Also
Controlling the CNC Output Precision
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
The label at which post processing will continue if the conditional test passes must be defined within the
current macro.
More than 100 conditional/unconditional jumps within a macro will cause the compiler error message:
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
"Machine
Tool" file from a man-readable source text file containing all the appropriate
TOOorMANY
JUMPS
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
%GOTO statements increment the jump counter by one.
%IF
%THEN
%ELSE
statements
increment
the jump
counter
Source
text files
may be
created via
the interactive
facilities
ofby
thetwo.
Code Wizard or may be written directly
using
a suitable
editor.
Please
notehas
that
if abeen
Code
Wizardthe
source
file iserror
altered
manually
it cannot be
If
the jump
label text
within
a %IF
directive
not
defined
compiler
message
will be:
subsequently updated by the Wizard without losing the manual changes.
UNDEFINED JUMP DESTINATION IN {line in error}
For
Thisexample,
document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
%IFwould
UNIT=1
%THEN
#GCODE=21
%ELSE source
#GCODE=20
controller
be edited
to produce
a customised
file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Note that more than one assignment or directive can be made on each line by separating the commands by
a colon:
%IF UNIT=1 %THEN #GCODE=21:%CALL=METRIC_SETUP:%ELSE
#GCODE=20:%CALL=INCH_SETUP:%GOTO @SKIP
Multiple %IF...%THEN...%ELSE... statements are allowed:
%IF #CURRENTMACRO=8 %THEN
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
<NUM_STARTS=[FIELD1=27]>
.
.
59
Multiple statements using %ELSEIF must be terminated with the %ENDIF directive.
The tab separation and indentation is vital for the %IF and %ELSEIF statements to work correctly.
%IF statements may NOT be nested.
See Also
Controlling the CNC Output Precision
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
60
%INCLUDE
61
%INCLUDE=filename
This directive allows you to include a secondary text file; this is useful where the same source code is
repeated in many text files. The text file must be in the same directory as the .?xt Code Generator source
file.
The %INCLUDE instruction must not be inside a macro or procedure.
Note that after use of %INCLUDE it may be necessary to program an additional %ENDM either at the end
of
theCode
included
file or Compiler
immediately
after
the %INCLUDE
instruction.suite of software. It creates a Code
The
Generator
is an
integral
part of the EdgeCAM
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
%INCLUDE=txt1.mac
parameters
and logic required to convert the raw EdgeCAM data into usable CNC code.
%ENDM
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
It is permissible to call more than one file from a base file:
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
updated by the Wizard without losing the manual changes.
%INCLUDE=txt1.mac
%INCLUDE=txt2.mac
This document contains information to help you produce a customised Code Generator parameter source
%ENDM for a particular controller. In practice, a previously tried and tested text file for a similar CNC
file specifically
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
%OPTIONS
62
For example:
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file
for #RAPID
a particular
controller.
a previously
tried and
tested text file for a similar CNC
Thespecifically
user variable
is set
up as 1 In
forpractice,
High Feed
and 2 for Rapid
Rate.
controller would be edited to produce a customised source file, or final adjustments made to a file
If
Escape orfrom
Abort
detected
the and
#RAPID
variable is set to #FUNNY.
originating
theisCode
Wizard
its templates.
63
Four directives control the outputting of variables to CNC code. The first three are mutually exclusive.
%ALWAYS-OUTPUT
%OUTPUT-IF-CHANGED restrains the output if the variable value has not changed
EdgeCAM
Code Generator Compiler Guide
from the previous output. It cancels %ALWAYS-OUTPUT
and %DONT-OUTPUT
%DONT-OUTPUT
allows modal inhibition of the output of variables.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
It cancels %ALWAYS-OUTPUT and %OUTPUT-IF-CHANGED
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
to convert
raw EdgeCAM
datathe
intooutput
usableofCNC
code.
%CANCEL and logic required
is a non
modal the
command
that causes
the listed
variables at the next applicable opportunity. The output will
Source text files may be created
via the interactive
facilities
Code Wizard or may be written directly
occur independently
of the
settingofofthe
%OUTPUT-IF-CHANGED,
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
andWizard
so output
will be
forced
the variable
value has or has not changed.
subsequently updated by the
without
losing
theifmanual
changes.
A variable included in the %DONT-OUTPUT statement can still be output in the CNC code if its output line
is preceded by a %CANCEL directive.
This document contains information to help you produce a customised Code Generator parameter source
PRECISION
is for
a system
variable
that sets
accuracy
limit for the
%OUTPUT-IF-CHANGED,
%DONTfile specifically
a particular
controller.
In the
practice,
a previously
tried
and tested text file for a similar
CNC
OUTPUT
and %ALWAYS-OUTPUT
controller would
be edited to producedirectives.
a customised source file, or final adjustments made to a file
originating
thevariable
Code Wizard
and its templates.
The syntax from
for the
is:
PRECISION=0.001
Using this example (0.001), if the last X move was X5.123456 and the next move is X5.12345786, the
%OUTPUT-IF-CHANGED directive would only consider the first 3 decimal places, and the X move would be
suppressed.
See Also
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
Example of %ALWAYS-OUTPUT
Example of %OUTPUT-IF-CHANGED
Example of %DONT-OUTPUT
Controlling the CNC Output Precision
Example of %ALWAYS-OUTPUT
During machining three rapid moves had been defined as:
X2 Y3 Z4,
X2 Y3 Z0,
X6 Y3 Z0
Within the Code Generator the X,Y, and Z are set as follows:
%ALWAYS-OUTPUT=XMOVE,YMOVE,ZMOVE
the CNC
The
Codecode
Generator
would be
Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
... and logic required to convert the raw EdgeCAM data into usable CNC code.
parameters
N130 G00X2.0Y3.0Z4.0
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
N140 G00X2.0Y3.0Z0.0
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
updated by the Wizard without losing the manual changes.
N150 G00X6.0Y3.0Z0.0
...
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
64
Example of %OUTPUT-IF-CHANGED
%OUTPUT-IF-CHANGED=XMOVE,YMOVE,ZMOVE,#GCODE
The CNC code would be:
...
N130 G00X2.0Y3.0Z4.0
N140 Z0.0
N150 X6.0
The Code
...Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
65
Example of %DONT-OUTPUT
%DONT-OUTPUT=YMOVE
The CNC code would be:
...
N130 G00X2.0Z4.0
%CANCEL=#YMOVE
N140 G00Z0.0Y3.0
The Code
Generator
Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
N150
G00X6.0
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
... and logic required to convert the raw EdgeCAM data into usable CNC code.
The directive used most commonly is %OUTPUT-IF-CHANGED and it is usually placed within the START
macro
themay
required
variables.
Sourcewith
textall
files
be created
via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
The %CANCEL directive is used to emulate a controller which has turned off a modal function - for example,
subsequently updated by the Wizard without losing the manual changes.
a toolchange M06 might turn off the coolant, therefore the coolant could be canceled so that it was restated
after the toolchange was complete.
Note
that the %OUTPUT-IF-CHANGED
andyou
%CANCEL
mayCode
only be
used forparameter
numeric variables,
This document
contains information to help
produce directives
a customised
Generator
source
whereas
the %ALWAYS-OUPUT
and %DONT-OUTPUT
directives
may
betested
used for
string CNC
file specifically
for a particular controller.
In practice, a previously
tried
and
textnumeric
file for aorsimilar
variables.
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
66
67
A macro line enclosed by < > is interpreted for conversion to CNC code.
The description of a CNC output line may take more than one line within the macro. If a > is not found within
a macro after a < has been encountered, this will cause the compiler error message:
UNEXPECTED END OF CNC CODE IN {line in error}
which will always appear without any change in the CNC output.
For example <G90>
The
Code
Generator Compiler
is an
integral
part of theby
EdgeCAM
suite of software.
It creates
String
variables
They
must
be surrounded
square brackets.
No formatting
will a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
take
unless
theEdgeCAM
author restricts
the usable
string length
by adding
parameters and logic required
to place
convert
the raw
data into
CNC code.
the number of characters required onto the end of the string
(for example
[$FRED=12])
- thisofwill
justify
the string
to abe written directly
Source text files may be created
via the interactive
facilities
theleft
Code
Wizard
or may
using a suitable text editor. Please
if a Code Wizard source file is altered manually it cannot be
length note
of 12that
characters.
subsequently updated by the Wizard without losing the manual changes.
System or User Defined Each numeric variable must be equated to a line number in the
numeric variables
format table and be surrounded by square brackets. For example,
This document contains information to help you produce a customised Code Generator parameter source
[XMOVE=1]
commands
code generator
to tested
interpret
the
file specifically for a particular
controller. In
practice, athe
previously
tried and
text
filenumeric
for a similar CNC
controller would be edited tovalue
produce
a
customised
source
file,
or
final
adjustments
made
a file
of the system variable XMOVE, formatted as defined in to
line
originating from the Code Wizard and its templates.
1 of the format table, then output to the CNC code.
A numeric variable must always be followed by an = and then a number representing its format reference
number. A number less than zero or greater than the number of lines in the format table will cause the
compiler error:
FORMAT REFERENCE ERROR: {line in error}
Copyright
1988-2005
Engineering
Examples
of CNC Pathtrace
macro lines
are: Systems. All rights reserved.
<[#BNUM=19] G01[XMOVE=0]
[YMOVE=1][ZMOVE=2][XYFEED=7]
[ZFEED=7][#COOL=15]>
Special Characters
68
You may often need to include special characters in CNC code which already have a designated meaning
within EdgeCAM.
To do this, place the ASCII value of the required character between curly brackets { }.
For example:
<[#BNUM=20] (IF P67{60}{62}1 GOTO [#BNUMJUMP=20])>
because the ASCII value of < is 60, and the ASCII value of > is 62
This allows the output of any valid ASCII character (the next sub-section displays all common ASCII values.
ASCII characters 128-255 vary depending on the country).
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
WARNING:
If anrequired
output line
spilling
two lines
hard
coded
parameters
and logic
to convert
theover
raw into
EdgeCAM
datacontains
into usable
CNC
code.spaces, these
spaces may be truncated by the compiler.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
For example:
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
updated by the
Wizard
without...(CR)
losing the manual changes.
<[#BNUM=20]...
(80
spaces)
(40 spaces)... M30>
This document contains information to help you produce a customised Code Generator parameter source
file
for to:
a particular controller. In practice, a previously tried and tested text file for a similar CNC
mayspecifically
be truncated
controller would be edited to produce a customised source file, or final adjustments made to a file
<[#BNUM=20]...
(10 spaces)
...(CR)
originating
from the Code Wizard
and its templates.
(40 spaces)... M30>
This line is therefore best written as:
<[#BNUM=20]... (120 spaces) M30>
ASCII Table
69
SPACE
033
034
"
EdgeCAM
Code Generator Compiler Guide
035
036
The
Code Generator
037
% Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
038
&
parameters
and logic
required to convert the raw EdgeCAM data into usable CNC code.
039
'
047
048
049
050
Copyright
051 1988-20053 Pathtrace Engineering Systems. All rights reserved.
052
053
054
055
056
057
058
059
060
<
061
062
>
063
064
065
066
067
068
069
070
071
70
EdgeCAM
Code Generator Compiler Guide
G
072
073
The
Code Generator
074
J Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
075
K
parameters
and logic
required to convert the raw EdgeCAM data into usable CNC code.
076
Source
077 text files may
M be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
078
N
subsequently
updated
by the Wizard without losing the manual changes.
079
This
080
document contains
P
information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
081
Q edited to produce a customised source file, or final adjustments made to a file
controller
would be
originating
from the
082
R Code Wizard and its templates.
083
084
085
086
087
088
089
090
091
092
093
094
095
096
097
098
099
100
101
102
103
104
105
106
107
108
71
EdgeCAM
Code Generator Compiler Guide
l
109
110
The
Code Generator
111
o Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
112
p
parameters
and logic
required to convert the raw EdgeCAM data into usable CNC code.
113
Source
be created via the interactive facilities of the Code Wizard or may be written directly
114 text files may
r
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
115
s
subsequently
updated
by the Wizard without losing the manual changes.
116
This
117
document contains
u
information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
118
v edited to produce a customised source file, or final adjustments made to a file
controller
would be
originating
from the
119
w Code Wizard and its templates.
120
121
122
123
124
125
126
127
DEL
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
72
73
%DATA
74
You may need to use a logic loop to access a numeric value. The most common example is that of spindle
speed codes on an NC control which need to be output.
%DATA consists of two lists of values that have a fixed sequential relationship. The %DATA statements can
appear anywhere in the text file except within Macros, Procedures or the Format table. They are usually
placed at the top of the file immediately after the variable declarations, and before the %MACHINE
statement.
These values are available within any macro or procedure in the form of an array.
An example of the use of %DATA is:
%DATA1=10,33,45,57,67,87,102,121, ;Speeds
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
%DATA2=1,2,3,4,5,6,7,8,
;Speed codes
Generator
or "Machine Tool" file from a man-readable
source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
...
...
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
...
This document
...
contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
%MACRO=15=TL=Toolchange=8,47,48,
controller
would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
%CALL=SPEED
;Call process to calculate speed code
...
%ENDM
...
Copyright
1988-2005 Pathtrace Engineering Systems. All rights reserved.
...
%PROCEDURE=SPEED
#LOOP=1 @LOOP ;SPEED CODE LOOP
%IF NEXTSPEED=121 %THEN #SPEED=8:%GOTO @ELOOP
%IF DATA1(#LOOP)=NEXTSPEED %THEN %GOTO @ELOOP
#SPEED=DATA2(#LOOP)
#LOOP=#LOOP+1
%GOTO @LOOP
@ELOOP
%ENDM
The value referenced by DATA1(4) (where #LOOP=4) will be 57, and correspondingly DATA2(4) will be 4.
Note that six data arrays are allowed, %DATA1 to %DATA6.
See Also
75
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
If the DATA declaration exceeds one line it may be continued on the following line, for example:
%DATA1=1,2,3,4
,5,6,7,8
The Code
Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
,9,10,
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
required
to convert
the
EdgeCAM
data
usable
CNC
That
is, if theand
firstlogic
character
of the
next line
is raw
a space,
comma
or into
numeric
then
it iscode.
assumed to be part of
the preceding %DATA statement.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
76
77
A one-dimensional array UARRAY1(#) is available and can be used to store and retrieve numerical data.
Syntax
Assign Value
UARRAY1(1)=23.6 or UARRAY1(#COUNTER)=#SPEED
Retrieve Value
#SPEED=UARRAY1(1) or #SPEED= UARRAY1(#COUNTER)
The
Codepossible
Generator
Compiler
is an
integral
the EdgeCAM
suite
of software.
It creates
a Code
It is also
to read
from or
write
to the part
Drill of
array,
but if a Hole
cycle
is used the
stored values
will be
Generator
or
"Machine
Tool"
file
from
a
man-readable
source
text
file
containing
all
the
appropriate
lost.
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
SUBFUNCT
78
Within macros the system variable SUBFUNCT may be set by EdgeCAM to known values so that decisions
can be made within the macro based upon a number of methods.
See Also
Multi Selection Choice
Accessing Tool Used Data
Accessing CPL Data
Accessing Retrospective Manipulation Commands
Accessing Cutting Conditions
Controlling Cutter Compensation in Milling and Wire EDM
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
79
SUBFUNCT is used to obtain the result from the selection choice of a Code Generator-defined macro.
In this case SUBFUNCT is set to 1, 2 or 3 for Coolant Mist, Flood and Off respectively:
%MACRO=104=..=Coolant==Mist/Flood/Off
More than three options may be specified, except for the Compensation macro, where the maximum is four
in turning and three in milling.
The macro name (in this case Coolant) should be a maximum of 25 characters long.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
%MACRO=15=..=TOOLCHANGE=8,47,48,
%LOAD=SUBFUNCT
...
The Code
...Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
and logic
to convert
the raw
datausing
into usable
CNC code.
The data available
for required
the current
tool selected
is EdgeCAM
now available
the standard
system variables.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
80
81
SUBFUNCT is used in conjunction with %GETCPL to obtain positional and rotational information about a
CPL.
For example:
%MACRO=43=..=INDEX PALLET=57,
%GETCPL=SUBFUNCT
...
This will make available via system variables the relevant data about the current CPL.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
...
%IF SUBFUNCT=3 %THEN %CALL=MIRROR_RESET
The Code
...Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
... and logic required to convert the raw EdgeCAM data into usable CNC code.
parameters
%ENDM
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
82
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Copyright
1988-2005
Pathtrace
Systems. Alldid
rights
A value of
0 implies
that theEngineering
toolpath generated
notreserved.
match any of the possible canned cycles. In this
83
#BNUM=...
84
<[...][...][...]>
#XLAST=XMOVE
@FACE
%IF ZMOVE=#ZLAST @END
#BNUM=...
<[...][...][...]>
#ZLAST=ZMOVE
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "Machine Tool" file from a man-readable source text file containing all the appropriate
@END
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
%ENDM
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
SUBFUNCT
0 = Not a lead move
1 = Lead in move
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
85
...
#FUNNY=9989999000000
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
...or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
...
Source%ENDM
text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
It
is also necessary
to declare
#FUNNY
in thelosing
declaration
table.changes.
subsequently
updated
by the Wizard
without
the manual
For example, to enable a Block Delete character '/' at the beginning of CNC lines via a user defined macro:
This document
contains information to help you produce a customised Code Generator parameter source
...
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller
would be edited to produce a customised source file, or final adjustments made to a file
N0100X10Y10
originating from the Code Wizard and its templates.
(BLOCK DELETE ON)
/N0110X15Y25
(BLOCK DELETE OFF)
N0120X50Y30
...
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
%MACRO=148=..=Block delete==Off/On
%IF SUBFUNCT=2 %THEN #DELETE=0 %ELSE #DELETE=#FUNNY
%ENDM
Each CNC output line will begin:
<[#DELETE=23][#BNUM=20]....>
The entry in the format table will control the output of '/' followed by no value:
/,0,0,0,0,0,0, 23 BLOCK DELETE
86
%LOAD
87
%LOAD={variable}
This is designed to allow the 'loading' of tooling information at any point within any Macro or Procedure. The
{variable} allows incrementing of a counter so that the information for all tools used during the last work
session can be examined.
For example:
...
#HEADER=1
@RELOAD
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "Machine Tool" file from a man-readable source text file containing all the appropriate
%LOAD=#HEADER
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
#BNUM=+#BNUMVAR: <[#BNUM=20][POSITION=10]>
Source#HEADER=#HEADER+1
text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
%IF #HEADER < NUMTOOLS %THEN %GOTO @RELOAD
subsequently updated by the Wizard without losing the manual changes.
...
This will
document
contains
to help you
a customised
Codefor
Generator
This
load the
system information
variable POSITION
withproduce
the turret
number entered
each toolparameter
used. Thissource
is
file
specifically
for a particular
controller.
practice,
a previously
tried
tested information
text file for aused
similar
usually
set up within
the START
macro toIndisplay
a complete
list of
all and
the tooling
for CNC
each
controller
machiningwould
file. be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
%LOAD is also used at Toolchange to load the information required for the CNC output:
%MACRO=15=..=Toolchange=8,47,48,15,
...
#TOOLINFO=SUBFUNCT: #TOOLINFO=#TOOLINFO+1
; access next tool and hold
Copyright
1988-2005 Pathtrace Engineering
Systems. All rights reserved.
%LOAD=#TOOLINFO:
#NEXTOOL=POSITION
Note that the content of these variables is dependent on the Code Generator file content.
88
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
%GETCPL
89
%GETCPL={variable}
This directive is designed to allow access to co-ordinate and rotational information attached to a CPL at any
point within any macro or procedure. The {variable} allows incrementing a counter so that information about
all CPLs used can be extracted. By setting %GETCPL = SUBFUNCT the current information is loaded.
List of variables affected:
GROUPDESCRIPTION
= CPL name
STYPE
= Coord shift type ABS = 1 INC = 0
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
from a man-readable
source text file containing all the appropriate
ROT1 or "Machine Tool" file
= Primary
angle
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
ROT2
= Secondary angle
XSUB*
= Absolute X datum origin
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using
a suitable text editor. Please
note that
if a Code
YSUB*
= Absolute
Y datum
originWizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
ZSUB*
= Absolute Z datum origin
SYSID
= Unique coord system identifier
This document contains information to help you produce a customised Code Generator parameter source
Index direction
fileDIRECTION
specifically for a particular=controller.
In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
SUBFUNCT
= Current CPL pointer ( used with %GETCPL )
originating from the Code Wizard and its templates.
SFMOD
= Defines rotary axis, 1=X axis, 2=Y axis, 3=Z axis
* The system variables XSUB, YSUB and ZSUB (not #XSUB etc) contain the current position from world
origin, in current coordinates.
For example:
#POINTER=0
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
@AGAIN
#POINTER=#POINTER+1
%GETCPL=#POINTER
%IF SYSID=#FUNNY @BREAKOUT
<[GROUPDESCRIPTION=10] [XSUB=0] [YSUB=1] [ZSUB=2] [ROT1=27] [ROT2=9]
[SYSID=22]>
%GOTO @AGAIN
@BREAKOUT
This example will loop through all selected CPLs and output their relevant X, Y and Z values (where
reference to the format table is suitable for debug).
Once all the selected CPLs have been processed, the system variable SYSID is set to #FUNNY and the
loop is terminated.
%MACRO=43=..=Index=57,
%IF MASK=1 %THEN #BNUMVAR=0 %ELSE #BNUMVAR=#BNUMINC
%GETCPL=SUBFUNCT
#AMOVE=ROT1
#BMOVE=ROT2
<[#AMOVE=32][#BMOVE=33]>
; Load current CPL information so as
; to output new index position
...
...
%MACRO=48=DS=DATUM SHIFT
%GETCPL=SUBFUNCT
...
...
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
90
%PROCEDURE=HOLD
#XHOLD=#XMOVE:#YHOLD=#YMOVE:#ZHOLD=#ZMOVE
%ENDM
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "Machine
filefrom
fromwithin
a man-readable
source
file containing
all the
appropriate
A PROCEDURE
can beTool"
called
any other macro
or text
procedure,
the syntax
being
as follows:
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
%MACRO=...
Source...
text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
... updated by the Wizard without losing the manual changes.
subsequently
%CALL=HOLD
This document
contains information to help you produce a customised Code Generator parameter source
...
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller
would be edited to produce a customised source file, or final adjustments made to a file
%ENDM
originating from the Code Wizard and its templates.
A macro cannot be called from within a macro or procedure.
91
Array Expansions
92
Data within EdgeCAM machining is sometimes held in the form of an array. This data may be accessed by
setting up a loop to interrogate the array.
An example is the XY co-ordinates of a drill pattern:
XPOINT(#)
YPOINT(#)
#LOOP=#LOOP+1
%GOTO @LOOP
@ENDLOOP
#BNUM=+#BNUMVAR:#GCODE=80
<[#DELETE=24][#BNUM=20] [#GCODE=19]>
%CALL=HOLD ;STORE CURRENT AXIS POSITION
%ENDM
EdgeCAM
XPOINT() = XCode
co-ordinateGenerator Compiler Guide
YPOINT() = Y co-ordinate
ZPOINT() = ZLEVEL (Multi-level only) or #FUNNY
Turning
Rotary Radial
XPOINT() = Z co-ordinate
YPOINT() = Angular position (C)
ZPOINT() = Not used
Planar Radial
XPOINT() = Z co-ordinate
YPOINT() = Y co-ordinate
ZPOINT() = Not used
Planar/
Rotary Axial
XPOINT() = X co-ordinate
YPOINT() = Y co-ordinate
ZPOINT() = ZLEVEL (Multi-level only) or #FUNNY
MZDEPTH()= Z drilling depth
MRPLANE()= Retract plane
When axially machining, the co-ordinates are always Cartesian for both rotary and planar modes.
Multi-level drilling is available in axial and B-axis orientation where supported by the Code Generator file.
93
%NOCYCLE
94
The statement is used to force longhand output of CNC. The command can force output of the following
types of code:
Generation of rapid, feed, clockwise and counterclockwise moves instead of controller canned cycles.
The expansion of retrospective operations to full CNC code instead of utilising controller canned
cycles
The executive modifier 'Canned Cycle' sets the value of the system variable PATHTRACE, the selection of
'Pathtrace' or 'Controller' will result in 1 or 0 respectively.
The variable PATHTRACE can be tested to conditionally execute the command %NOCYCLE.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
The action of %NOCYCLE is to exit the macro definition, immediately passing the axis moves to the Feed,
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
Rapid and Circle macros (CLW, CCLW).
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
For example:
Source%MACRO=32=TR=Translate=43,44,45,14,26,37,21,
text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
*
subsequently
updated by the Wizard without losing the manual changes.
%IF PATHTRACE=Y %THEN %NOCYCLE ; redirect through Rapid, Feed
This document
to help you produce a customised Code Generator parameter source
* ; andcontains
CLW, information
CCLW macros
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller
* would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
*
%IF MASK=1 %THEN ...
#XSUB=...
#YSUB=...
#BNUM=+#BNUMVAR:<[...] [...]>
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
See Also
System Variable NOCYCLE
%NOCYCLE has no function within the Wire Erosion module. See Wire Notes for explanation of
equivalent functionality.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
95
%SUBROUTINE
96
The statement defines the output position of controller subroutines. A controller subroutine is defined as a
sequence of blocks customising repeated machining cycles that can be called from a main program.
The macro Code Generator supports the output of subroutines in all the machining modules.
Nested controller subroutines are fully supported within the EdgeCAM Code Generator, and therefore care
should be taken to ensure that the controller is also capable of nesting.
If nested subroutines occur and are not supported by the controller, you may want to add tests to the Code
Generator to output error messages.
A typical test is as follows:
The
Code
Generator
Compiler is an integral#NESTED=0
part of the EdgeCAM suite of software. It creates a Code
(In start
macro
)
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
#NESTED=#NESTED+1
(In macros SUBSTART
and CYCLSUB)
parameters
and logic required
to convert the
raw EdgeCAM data into usable CNC code.
%IF #NESTED > 1 %THEN <ERROR:NESTING OF SUBS
NOT POSSIBLE
- USE
PATHTRACE
Source text files may be created via the interactive
facilities ofON
theTHIS
Code CONTROL
Wizard or may
be written
directly CYCLES>
using
a suitable
text editor. Please note that#NESTED
if a Code =Wizard
source-1file is altered manually it cannot be
(In macro
SUBEND)
#NESTED
subsequently updated by the Wizard without losing the manual changes.
(#NESTED will always return the current level of subroutine nesting if used in this way).
This document contains information to help you produce a customised Code Generator parameter source
%SUBROUTINE
not appear
more than
once and
must only be
defined
withintext
thefile
macros
listed
file specifically formay
a particular
controller.
In practice,
a previously
tried
and tested
for a as
similar
CNC
below.
Thewould
position
of %SUBROUTINE
within the source
governs
output position
controller
controller
be edited
to produce a customised
sourcefile
file,
or finalthe
adjustments
madeof
tothe
a file
subroutines.
originating from the Code Wizard and its templates.
The following rules apply to the relevant positional definitions:
%MACRO=START
...
...
%SUBROUTINE
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
...
...
%ENDM
Controller subroutines output as the start of the CNC code:
%MACRO=END
...
...
%SUBROUTINE
...
...
%ENDM
Controller subroutines output as the end of the CNC code.
No occurrence of %SUBROUTINE. The subroutine will be output as the subroutines occur in the machining
file and nesting of subroutines will not be accepted by the controller.
EdgeCAM User Guide
97
See Also
MASK
Macro Definitions Related to Controller Subroutines
Controller Subroutine Calls by Block Number
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
SUBEND should contain the CNC code which defines the controller subroutine terminating blocks.
%MACRO=SUBCALL
SUBCALL
should contain
the CNC
which
controller
subroutine
call Itblocks.
The Code Generator
Compiler
is ancode
integral
partdefines
of the the
EdgeCAM
suite
of software.
creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
%MACRO=CYCLSUB
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
CYCLSUB is called when subroutines can be output during drilling, tapping, reaming and boring. The macro
definition should contain the following CNC code:
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
1. Controller
subroutine
start
definition
subsequently
updated
by the
Wizard
without losing the manual changes.
98
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
99
Generator
or "Machine
Tool"show
file from
a man-readable
text file containing
all the
appropriate
Note that the
graphics often
an apparent
dogleg source
when resolved
rapids are not
used.
This intermediate
parameters
and
logic
required
to
convert
the
raw
EdgeCAM
data
into
usable
CNC
code.
points does not exist on the NC data - it is purely for visualisation purposes - and will not be used as a start
point.
Some
in this area
have
been removed
from
EdgeCAM.
This means
in somedirectly
cases
Sourceprevious
text fileschanges
may be created
via the
interactive
facilities
of the
Code Wizard
or maythat
be written
the
graphical
representation
will
change,
compared
to
previous
versions,
to
more
closely
represent
what
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
happens
on the
machine
subsequently
updated
by tool.
the Wizard without losing the manual changes.
Good practice
This document contains information to help you produce a customised Code Generator parameter source
For
safety reasons,
should always
start and
finish at a
safeand
clearance
height.
If this
practice
is
file specifically
for a subroutines
particular controller.
In practice,
a previously
tried
tested text
file for
a similar
CNC
followed then
thebe
link
moves
between asubroutines
be expected
to also
be at themade
safe height.
controller
would
edited
to produce
customisedcan
source
file, or final
adjustments
to a fileThe
subroutine from
should
include and
the liftout
move at the end of a cut.
originating
thealways
Code Wizard
its templates.
A specific move to a point near to the required start of the subroutine before defining the subroutine is
recommended. This is generally preferable to making a move direct from, say, toolchange and relying on
the 2D rapid's dogleg to be the start point. If the machine tool movements are not exactly as represented on
screen then this will minimise the discrepancy.
Code Generators
Some additional system variables have been added to the Code Generator to pass the subroutine start
point.
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
In macros TRANSLATE and RESET, the variables XEND, YEND, ZEND now represent the end of
any approach move and thus the start of the subroutine.
In macros SUBSTART and SUBCALL, the existing variables NEXTXMOVE, NEXTYMOVE,
NEXTZMOVE can be used.
The TRANSLATE Macro (No. 32) should now use XEND etc. as subroutine start point instead of
XSUB etc. Rapid approach moves to this point should be output.
The SUBSTART Macro (No. 55 ) should use NEXTXMOVE etc. as a "HOLD" point for calculation of
incremental moves.
The SUBCALL Macro (No. ) should include a rapid approach move to NEXTXMOVE etc.
Existing code generator files will continue to work as before since no existing variables have been changed.
It may be, however, that their actions are not correctly represented on screen by EdgeCAM graphics.
The Code Wizard templates for milling and turning have been updated to match the graphics. Template
based code generators should be updated to the version 7.00 templates to take advantage of these
changes.
The templates have also been updated to make the switch between incremental and absolute subroutines
easier. The logic within the template will now determine whether to use the Rapid or Translate code
constructors and G90/91 blocks will only be output by subroutine start and end if they are required. This last
change is within the default sequence of the code constructors. It will not be applied automatically to
100
updated CGD files but will be available for newly created files.
It should always be remembered that the exact action of a machine tool when using controller cycles is
beyond the control of EdgeCAM. It is the user's responsibility to ensure that his code generators are
correctly configured and that the on-screen representation closely matches the actions of his controllers.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
101
MASK
102
The MASK command is used to control output of data to the NC file. Setting it to 0 or 1 allows or prevents
output during processing:
MASK = 0
MASK = 1
MASK is used in the processing of the machining data file to CNC output code which utilises controller
subroutine calls. Examining MASK allows for the maintaining of block numbers and system variables during
multiple pass processing.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
"Machine
Tool"
file from
a man-readable
source
text file containing all the appropriate
EG.or%IF
MASK=1
%THEN
#BNUMVAR=0
%ELSE
#BNUMVAR=10
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
See Also
Source Usage
text files
be created via the interactive facilities of the Code Wizard or may be written directly
Simple
of may
MASK
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
Complex Usage of MASK
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
103
Subroutine Definition
L2
Punch Component
L3
Pause
L4
Axis movement
L5
End of Definition
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "Machine Tool" file from a man-readable source text file containing all the appropriate
L6
...
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
L7
...
L8
Start of main code
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
L9 a suitable
Axis movement
using
text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
L10
Call Subroutine - 20 times
L11
End of code
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
The
example
willbe
reduce
code source
required,
but
simulate
within the
Pathtrace
controller
would
editedthe
to amount
produceofa output
customised
file,
orto
final
adjustments
made
to a file system
the full graphical
axes
movement
is required
to be output.
originating
from the
Code
Wizard and
its templates.
Therefore the graphics display will be as below:
Previous axis movement
...
O1 Axis movement
O2 Punch Component
O3
Axes movement
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
O4 Punch Component
O5 Axis movement
etc....
O36 Punch and move 17 times more ...
O37 ...
O38 End of Code
As can be seen in the example, the length of code generated would be of greatly differing lengths, and so
by the same definition the block numbers would also be different.
MASK and multi-processing of the machining file overcomes the block numbering problem. To explain
MASK in the outputting of L1 - L11 using the machining input data 1 - 038, MASK will be set to 0 to output
the subroutine definition, and to 1 to simulate the main CNC code.
The code is then processed again with MASK set to 1 during the subroutine definition and calls, but toggling
to 0 to output the main CNC code.
Therefore, by testing the value of MASK, the block number sequence can be maintained correctly.
104
The first complex use of MASK is when the controller subroutines are to be output at the start or end of the
CNC code.
The output of the main CNC code and the subroutines is governed by the %SUBROUTINE statement.
The machining data file will be scanned to obtain all the subroutine definitions, and output, if required, with
MASK set to 0. The data file is then scanned again with MASK set to 1 in the main CNC code, but toggling
MASK to 0 when calling the subroutines.
The second complex use of MASK is when subroutines call other subroutines.
The data file is scanned to output the subroutine, MASK set to 0, and as the call to the next subroutine
occurs MASK toggles to 1. After the completion of the subroutine MASK is toggled back to 0 and the calling
subroutine
definition isCompiler
completed.
The
Code Generator
is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Subroutine at start
Subroutine at end
1st Pass
2nd Pass
1st Pass
2nd Pass
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
Main Code
MASK=1
MASK=0
MASK=1
using
a suitable text
editor. Please MASK=0
note that if a Code Wizard source
file is altered manually
it cannot be
subsequently updated by the Wizard without losing the manual changes.
Subroutine
MASK=0
MASK=1
MASK=1
MASK=0
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
Main Code
MASK=1
MASK=0
MASK=1
controller
would be
edited to produce
a customised source file, orMASK=0
final adjustments made
to a file
originating from the Code Wizard and its templates.
Processing
The data file is totally rescanned to output the lower subroutine with MASK set to 1 where output has been
made, and toggled to give output as required.
See Also
%SUBROUTINE
Copyright 1988-2005 Pathtrace Engineering Systems. All rights reserved.
Circle Programming
105
As circular interpolation which ranges over one or more quadrant is not available on all machine tool control
systems, the statement CIRCLE is available to output either full circle or quadrant programming.
Variable CIRCLE can be assigned the values:
1
CIRCLE=1
CIRCLE=0
quadrant programming
EdgeCAM
Code Generator Compiler Guide
full circle programming
The statement should be placed in the START macro, but can be altered at any time if output needs to be
switched between single and multi quadrant output.
A circular move of 360 is therefore processed by either calling the circular macros once or four times as
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
appropriate to the CIRCLE definition.
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameterscan
EdgeCAM
andalso
logicoutput
required
plane
to switching
convert the
arcs
rawinEdgeCAM
both the ZX
data
and
into
ZYusable
planes.
CNC
Thecode.
system variable
TRUEARCOP may be set to control output between true arc co-ordinates and fixed XYZ co-ordinates. The
differences in the system variables as set up are illustrated in the table below. If plane switched arcs are not
Source textthe
supported,
filesarcs
mayare
bebroken
createddown
via the
intointeractive
linear movements.
facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
TRUEARCOP
(Milling default)
1 (Turning
default) Code Generator parameter source
This document contains0information
to help you produce
a customised
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
XYARCS
XSTART,
YSTART,
originating
from the Code
Wizard and
its templates. XSTART, YSTART,
XCENTRE, YCENTRE,
XCENTRE, YCENTRE,
XEND, YEND
XEND, YEND
ZXARCS
ZSTART, XSTART,
ZCENTRE, XCENTRE,
ZEND, XEND
ZYARCS
ZSTART, YSTART,
ZCENTRE, YCENTRE,
ZEND, YEND
The system variable XYPLANE is set as 0, 1 and 2 for XY, ZX and ZY respectively when processing arcs.
See also:
Arc Bulge when using Radius NC Output
Explanation
EdgeCAM Code
0 = BulgeGenerator
correction enabled Compiler Guide
NOBULGECORRECTION
A rounding error
of 0.0005mm
can cause the
arc to bulge by
up to 0.317mm
on a 50mm
radius.
The opposite effect can also occur where the end point
is further away than the arc radius. In this case the
controller appears to still try and cut the arc, but we
suspect this causes the arc to be too shallow. The
rounding by EdgeCAM is mathematically correct and
the error is inherent in the method used by the G2/G3 R
construction of arcs and limit of 3 decimal places. The
error is most commonly seen on circular Bosses or
pockets, which have a tapered wall. As the arc radius
changes size down the wall, the rounding varies slightly
the effect can be easily seen at some levels as a dig
inwards or a bulge.
This type of error can occur in 2D, contour or the Profiling cycle. The error is more noticeable when
machining a with contour wall or 3D shape as the amount of error changes down the part, as shown in this
side view of NC toolpath files containing Arcs:
106
107
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
PRECISION=0.001
Variable Value
*
PRECISION=0.00001
N20 X20.0 Z10.0
(XMOVE=20.0)
(XMOVE=20.0001)
In this example, the X value has been output twice because the %OUTPUT-IF-CHANGED directive
considers the change in the X value to be different, but the output value appears the same because the
format table has rounded the value down to three decimal places (for the sake of the example).
*PRECISION=0.001
N20 X20.0 Z10.0
(XMOVE=20.0)
N30 Z0.0
(XMOVE=20.0001)
In this example, the X value has been suppressed because the %OUTPUT-IF-CHANGED directive
considers the change in the X value to be the same, because the difference is less than the PRECISION.
Example of using %IF
108
#XHOLD=20:#XMOVE=20.0001
%IF #XMOVE=#XHOLD @SKIP
109
If PRECISION has been set to 0.01, the statement above would pass the test (and GOTO the skip label) as
the difference between the values is less than the PRECISION. If PRECISION=0.00001, the statement
would fail and the GOTO would be ignored.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Debugging
110
The system variable MACRONAMEOP can be set so the name of each macro processed is output to the
CNC file. The statement MACRONAMEOP = [value] is normally included within the start macro.
Valid settings are:
0 = No debug output
2 = Macro names output only if MASK=0 (that is, CNC output turned on).
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Silent Output
111
The system variable SILENT can be set to inhibit output of CNC code to the screen. This will increase the
speed of code generating. A status message is displayed every 100 lines of output if silent output mode is
selected.
Valid settings are:
0 = Output to screen
1 = Inhibit output
The following lines included within the start macro. These allow this mode to be selected interactively when
generating CNC code. SILENT defaults to 0.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "Machine Tool" file from a man-readable source text file containing all the appropriate
%OPTIONS=SILENTMODE^ON^OFF=SILENT
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
%IF $SILENT=Y %THEN SILENT=1
$SILENT
must
declared
in a %DECLARE
statement.
Source text
filesbe
may
be created
via the interactive
facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Textcase
112
The system variable TEXTCASE provides the option of formatting the output so that comments, file name
and any ASCII text characters will be output as uppercase text. This is useful as some machines must have
all text as uppercase characters, otherwise the machine ignores the character.
Valid settings are:
1 = Will convert all text string to uppercase.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Matrix Processing
113
The matrix operation provides a method of producing a series of identical components using one of the
following methods:
Longhand Code
Testing the system variable PATHTRACE (modifier 21) can direct processing through the RAPID, FEED,
CLW and CCLW macros.
The
Code Generator
Compiler
is anto
integral
of the
EdgeCAM
suite
of software.
It creates
a Code
PATHTRACE=1
can be
interpreted
mean part
the user
has
requested
to generate
longhand
code.
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Subroutines and Datum Shifts
The testing of the system variable PATHTRACE can cause processing to be directed through the
Source text files
may be created via the interactive facilities of the Code Wizard or may be written directly
manipulative
macros.
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
Controller
(0) -updated
generate
subroutines.
subsequently
bycontroller
the Wizard
without losing the manual changes.
Pathtrace (1) - generate longhand code.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
%Output
114
%OUTPUT controls the output of separate CNC output files (a tooling setup sheet and a main body
program). These files have the same prefix, the - character as a delimiter, and the assigned value of
$NAME as a suffix.
To enable the creation of the two files, you must specify the following macro commands in the START
macro:
%MACRO=START
Truncated Filename
testcode-setup.nc
testco-s.nc
testcode-1.nc
testco-1.nc
testcode-2.nc
testco-2.nc
testcode-header.nc
testco-h.nc
Leader
115
where
####
is the number
of null
characters
required
be output. suite of software. It creates a Code
The Code
Generator
Compiler
is an
integral part
of thetoEdgeCAM
Generator
or
"Machine
Tool"
file
from
a
man-readable
source
text
containing
all thethe
appropriate
It should be noted that it is also possible to insert the statement
in file
an output
file using
Editor.
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Milling Modifiers
116
This table shows the system variable set up for each of the modifiers that may be included in the Code
Generator macro definition line.
Number
Heading
System Variables
Name
GROUPDESCRIPTION
5
6
EdgeCAM
Code
Generator Compiler Guide
Feedrate
XYFEED
Plunge feed
ZFEED
7
Speed
SPEED
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
8
Tool No.
TOOLNUM
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
andDepth
logic required to convert
the raw EdgeCAM data into usable CNC code.
9
ZDEPTH
10
Cut increment
DEPTH
Source
may be created via theOFFSET
interactive facilities of the Code Wizard or may be written directly
12 text filesOffset
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
13
Side by the Wizard without
LEFTRIGHT
subsequently
updated
losing the manual changes.
14
From
STCOMMAND
This 15
document contains
help you produce a customised Code Generator parameter source
Commentinformation to USERDEFINEDSTRING
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
16 would%Stepover
controller
be edited to produce aSTEP
customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
21
Subroutines
PATHTRACE
23
Degression
DEGR
24
Angle
ANGLE
25
Radius
RADIUS
26
To
ENCOMMAND
27
Time
DWELL
28
Clear
ZCLEAR
29
Retract
RPLANE
37
Matrix/Repeats
REPEAT
38
X repeats
XREP
39
Y repeats
YREP
40
Direction/Priority
ROWPRIORITY
41
Lace Cut
LACECUT
43
{X} increment/length
XINC
44
{Y} increment/length
YINC
45
{Z} increment/length
ZINC
51
Quadrant
QUADRANT
57
Angle
INDEX
59
Move type
FIELD2
60
Distance
FIELD1
63 - 66
- Not defined -
67
USERVAR1
68
USERVAR2
69
USERVAR3
70
USERVAR4
71
USERVAR5
72 - 81
EdgeCAM
- Not defined - Code Generator Compiler Guide
82
Define layout
USERMATRIX
200
The 201
Code Generator
Compiler
is an integral
part of the EdgeCAM suite of software. It creates a Code
Multidepth
in drill
ZDEPTH()
Generator or "Machine
Tool"
file
from
a
man-readable
source text file containing all the appropriate
cycles
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
117
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
The flow diagram also applies to the chipbreak, tap, ream and bore macros.
See Also
System Variable - DRILLSUB
Procedure - LOOPEXPAND
Using MASK in Milling
118
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
119
Procedure - LOOPEXPAND
A call to the user-defined LOOPEXPAND procedure will expand the number of points to be machined. The
following macro definitions ordinarily contain a LOOPEXPAND call:
DRILL CYCLE
TAP CYCLE
BORE CYCLE
CHIPBREAK CYCLE
CYCLESUB
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
120
121
The actual output of CNC code is affected by the MASK system variable.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
122
In the following macro definitions, the recommended syntax should be taken to mean the following:
%MACRO=[macro number]=..=[Description]=[Modifier List...]
For example:
%MACRO=1=..=RAPID=1,2,3,
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator
or "Machine
from a man-readable
source
filetool
containing
all the appropriate
These variables
are setTool"
up byfile
a system
that looks ahead
to thetext
next
movement:
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
NEXTSPEED
Next spindle speed selected.
NEXTXYFEED
Next XY feedrate
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
NEXTZFEED
Next ZPlease
feedrate
using
a suitable text editor.
note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
NEXTCOMP
1 = No compensation
2 = Left compensation
This document contains information to help you produce a customised Code Generator parameter source
3 = Rightcontroller.
compensation
file specifically for a particular
In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
NEXTXMOVE
Next X axis movement
originating from the Code Wizard and its templates.
NEXTYMOVE
Next Y axis movement
NEXTZMOVE
Toolchange X position
YTOOL
Toolchange Y position
ZTOOL
Toolchange Z position
XHOME
Toolhome X position
YHOME
Toolhome Y position
ZHOME
Toolhome Z position
TXMAX
TYMAX
TZMAX
IPLANE
Initial plane
MAXFEED
Maximum feedrate
MAXSPEED
Maximum speed
MAXRPM
NUMTOOLS
MACHTIME1
Machining time
During %NOCYCLE processing (through RAPID, FEED, CLW and CCLW macros) the following additional
EdgeCAM User Guide
123
NEXTARC
0 = Nextmove is linear
1 = Nextmove is counterclockwise
2 = Nextmove is clockwise
3 = End of %NOCYCLE processing
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
124
1 - MOVE RAPID
37 - THREAD MILLING
2 - MOVE FEED
40 - MOVE HOME
3 - MOVE ARC
41 - MOVE TOOLCHANGE
4 - FACEMILL CYCLE
5 - PROFILE CYCLE
6 - AREACLEAR CYCLE
The
of theANGULAR
EdgeCAM suite of software. It creates a Code
7 - Code
SLOTGenerator
CYCLE Compiler is an integral
45 part
- MOVE
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
8 - CROSSHATCH
46 -raw
MOVE
RELATIVE
parameters
and logic CYCLE
required to convert the
EdgeCAM
data2into usable CNC code.
9 - DRILL CYCLE
47 - MOVE CONSTRAINED
10 - CHIPBREAK
48 - DATUM
SHIFT
Source
text files mayCYCLE
be created via the interactive
facilities
of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
11 - REAM CYCLE
49 - RESET ROTARY DATUM
subsequently updated by the Wizard without losing the manual changes.
12 - BORE CYCLE
51 - START
13 -document
TAP CYCLE
53 you
- CLW
This
contains information to help
produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
14 - MOVE RELATIVE
54 - CCLW
controller would be edited to produce a customised source file, or final adjustments made to a file
originating
from the Code Wizard and its templates.
15 - TOOLCHANGE
55 - SUBSTART
21 - FEED TYPE
56 - SUBEND
22 - DWELL
58 - END
29 - RADIUSCOMP
59 - SUBCALL
30 - MATRIX MODE ON
60 - RESET
61 - CYCLSUB
Copyright
1988-2005 Pathtrace Engineering Systems.
All rights reserved.
32 - TRANSLATE
69 - ANGCLW
33 - ROTATE
70 - ANGCCLW
34 - MIRROR
71 - ATTRIBUTE
35 - PECK
72 - SPLINES
36 - TECHNOLOGY
Turning Modifiers
125
Number
Heading
System Variables
Name
GROUPDESCRIPTION
Feedrate
FEED
Plunge feed
ZFEED
Tool Number
TOOLNUM
6
7
8
EdgeCAM
Code
Generator Compiler Guide
Speed
SPEED
9
Total Depth
TOTALDEPTH
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
10
Cut Increment
DEPTH
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
12
andPitch
logic required to convertPITCH
the raw EdgeCAM data into usable CNC code.
13
CSS
CSS
Source
14 text filesFrom
may be created via the STCOMMAND
interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
15
Comment
USERDEFINEDSTRING
subsequently updated by the Wizard without losing the manual changes.
17
Override
FIELD1
21
Canned Cycle
PATHTRACE
This document contains information to help you produce a customised Code Generator parameter source
file specifically
23
for
Xinc
a particular controller.YINC
In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
24
Drive
RMOVE
originating from the Code Wizard and its templates.
25
Cut
CMOVE
26
End #
ENCOMMAND
27
Time
DWELL
28
Lead angle
TOOLANGLE1
29
Trail angle
TOOLANGLE2
30
Z Offset
OFFSETZ
31
X Offset
OFFSETX
43
Z mirror
STCOMMAND
44
Z lead
ENCOMMAND
45
Z Increment
XINC
49
L/R
LEFTRIGHT
50
Offset
OFFSET
62
Tolerance
TOLERANCE
63
Finish Depth
TOTDEPTH
64
Offset
OFFSET
65
L/R
LEFTRIGHT
66
Step
STEP
67
USERVAR1
68
USERVAR2
69
USERVAR3
70
USERVAR4
71
USERVAR5
73
Degression
DEGR
74
Angle
ANGLE
75
Radius
RADIUS
76
Clear
ZCLEAR
77
Retract
RPLANE
Xinc
XINC
XH Angle
ANGLE
78
79
81
EdgeCAM
Code
Generator Compiler Guide
Yinc
YINC
82
Retract
PECKRETRACT
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
126
PASS
127
The system variable PASS is the turret processing pointer. PASS is assigned the following values:
PASS = 1 = Upper turret processing
PASS = 2 = Lower turret processing
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
TURRET
128
The system variable TURRET is used to output the tooling data for the upper and lower turrets.
TURRET = 0 = Upper turret data
TURRET = 1 = Lower turret data
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
File Output
129
If parameter 5 in the appropriate machine format ('mm') line in the machine tool macro is set to:
0
Processing will output to a single file as follows: upper turret to first sync code,
lower turret to first sync code, upper turret to next sync code, lower turret to next
sync code and so on until all CNC code has been output.
Two tapes will be produced, one for each turret. If the name supplied for the
CNC file is TEST, the CNC files produced will be named TEST-1.NC and
TEST-2.NC
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
2
The file for the lower turret will be merged with the upper turret file at the
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
and logic required
synchronisation
points. to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
4 Axis Synchronisation
130
The SYNCHRONISE TURRETS macro causes either turret to wait until the other turret has completed its
operations. When the SYNCHRONISE TURRETS command is issued, a 'wait code' is sent to both turrets.
The command can be issued at any point within machining and is not turret dependent. It may also be
applied as a retrospective command.
The effect of the SYNCHRONISE command is that both turrets will start to perform their operations
simultaneously. Normally one turret will finish before the other and will read the SYNCHRONISE command.
This instructs the turret to wait until the second turret also reads the SYNCHRONISE command, at which
point both turrets are started again.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
Axis Output
131
UPPER TURRET
LOWER TURRET
Toolchange
Toolchange
Rapid
Rapid
EdgeCAM CodeWaiting
Generator Compiler Guide
Rough Turn
SYNCHRONISATION
Rapid Home
Profile
The
Code Generator Compiler is an integral
Toolchange
... part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
Rapid
... raw EdgeCAM data into usable CNC code.
parameters
and logic required to convert the
Waiting
...
...
...
Source
text files may be created via the interactive
facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
...
Feed
subsequently updated by the Wizard without losing the manual changes.
SYNCHRONISATION
Threading
Rapid
Home a customised Code Generator parameter source
This
document contains information to help
you produce
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
...
End of operations
controller would be edited to produce a customised source file, or final adjustments made to a file
originating
from the Code Wizard and its templates.
...
Rapid Home
End of operations
132
In the following macro definitions, the recommended syntax should be taken to mean the following:
%MACRO=[macro number]=..=[Description]=[variables...]
For example:
%MACRO=1=..=Rapid=1,2,
At all times the following variables are available (items marked with a * only apply to 4 axis lathe
The
Code Generator
Compiler
an aintegral
part
the EdgeCAM
of software. It creates a Code
configurations.
Macros
marked iswith
* should
beofremoved
from 2 suite
axis configurations):
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
NEXTMACRO
macro
to be processed.
parameters
and logic Next
required
to convert
the raw EdgeCAM data into usable CNC code.
These variables are set up by a system that looks ahead to the next tool movement:
Source
text files may Next
be created
the interactive
NEXTSPEED
spindlevia
speed
selected. facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
NEXTXYFEED
used
XY feedrate
subsequently
updatedNext
by the
Wizard
without losing the manual changes.
NEXTZFEED
NEXTCOMP
1 =information
No compensation
This
document contains
to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
2 = Left compensation
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code
Wizard
and its templates.
3 = Right
compensation
NEXTXMOVE
NEXTZMOVE
*XTOOL1
Copyright
Systems. Allposition
rights reserved.
ZTOOL 1988-2005 Pathtrace
UpperEngineering
turret Z toolchange
*ZTOOL1
XHOME
*XHOME1
ZHOME
*ZHOME1
TXMAX
TZMAX
IPLANE
Initial plane
MAXFEED
Maximum Feedrate
MAXSPEED
MAXRPM
NUMTOOLS
MACHTIME1
Machining time
NUMTOOLS
*NUMTOOLS1
MACHTIME1
*MACHTIME2
MAXFEED
MAXRAPID
MAXRPM
EdgeCAM
Code
Generator Compiler Guide
Maximum RPM
-as %MACHINE
PASS
0 = Upper turret
0 = Nextmove is linear
1 =information
Nextmove is
This document contains
tocounterclockwise
help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
2 = Nextmove is clockwise
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code
Wizard
and its templates.
3 = End
of %NOCYCLE
processing
If the nextmove is an arc move,
NEXTXCENTRE
NEXTYCENTRE
NEXTZCENTRE
133
24 - SELECT PRIORITY
25 - MIRROR TURN CYCLE
26 - MIRROR ROUGH TURN CYCLE
27 - BALANCED TURN CYCLE
28 - BALANCED ROUGH TURN CYCLE
29 - RADIUSCOMP
32 - TRANSLATE
36 - TECHNOLOGY
40 - MOVE HOME
41 - MOVE TOOLCHANGE
51 - START
53 - CLW
54 - CCLW
55 - SUBSTART
56 - SUBEND
58 - END
134
59 - SUBCALL
135
60 - RESET
61 - CYCLSUB
71 - ATTRIBUTE
251 - SPINDLE SELECTION
252 - SPINDLE CONTROL
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
136
137
The C/Y Axis extension does not support Mirror, Translate or Rotate milling type operations, and therefore
the definitions should not be included in the text source file.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
CAXIS
138
The CAXIS system variable is assigned a value which relates to the type of machining currently active:
0 = Static (Milling or Turning) Tool
1 = Axial/Reverse Axial, Driven (0 or 180)
2 = Radial/Reverse Radial, Driven (90 or 270)
3 = Other Orientation (B AXIS), Driven
0 = Normal Turning
1 = Axial Machining
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
2
= Radial or
Machining
Generator
"Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
The following macro definitions assign a value to CAXIS (therefore the variable should not be assigned by
the user):
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note
%MACRO=43=AX/RD=Axial/Radial
C-axis
thatmachining=
if a Code Wizard
(And
source
193) file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
%MACRO=45=..=Move Angular=5,6,7,
%MACRO=253=..=Lathe Index=..
This document contains information to help you produce a customised Code Generator parameter source
%MACRO=165=..=Tool Change=..
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating
These
values
from
arethe
maintained
Code Wizard
while
and
processing
its templates.
for reference by the code generator file.
CAXIS can be tested and conditional actions can be executed.
Y Axis
139
EdgeCAM is switched between Y Axis and C Axis milling by the use of the SELECT MILL MODE macro.
This sets up SUBFUNCT as 0 for C Axis and 1 for Y Axis milling (the default condition is C Axis). A user
variable should be set to flag that status in other macros.
For example:
%MACRO=44=..=SELECT MILL MODE...etc.
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
%CXCYCLE
140
This statement is used to force output of axial motion in terms of C Axis motion and the radial length, the
polar co-ordinate system.
%CXCYCLE is used to calculate axial movements for controllers that do not support the Cartesian coordinate system, therefore the output must be expressed in the polar co-ordinate system.
%CXCYCLE action is similar the %NOCYCLE command but redirection is effected through the macro
CX.OUTPUT (macro number 66).
The macro definition CX.OUTPUT must be written in the text source file to enable the redirection to occur.
Example:
%MACRO=164=..=4,64,65,59,60,7,5,62,
The Code
Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
%IF CAXIS=1 %THEN %CXCYCLE %ELSE %NOCYCLE
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
%ENDM
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
In
the above example,
redirection
to the
macro
definition
CX.OUTPUT
will only occur when set to Axial
subsequently
updated by
the Wizard
without
losing
the manual
changes.
mode.
It is also important to understand the consequence of %NOCYCLE when encountered in C/Y Axis mode.
This document
information
to 1help
produce
a customised
CodetoGenerator
parameter
source
Redirection
will contains
occur through
macros
andyou
2, and
it is therefore
necessary
test the system
variable
file
specifically
for 1a and
particular
controller.
a previously
tried
tested
text file for a similar CNC
CAXIS
in macros
2 which
must callInapractice,
user-defined
procedure
to and
effect
axis output.
controller would be edited to produce a customised source file, or final adjustments made to a file
If
the Codefrom
Generator
does
not require
originating
the Code
Wizard
and its%CXCYCLE,
templates. it can be disabled in switch 20 of the MM line for faster
processing (see MM Line).
Controller compensation is available in Radial and Axial modes.
not supported when using CXCYCLE in Axial Turning.
ROT1 Rotary angle (same as CMOVE but is available for compatibility with rotary milling)
Arc Motion
The
Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
CSTART
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
RSTART
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
CCENTRE
RCENTRE
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using
CENDa suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
REND
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
141
142
In the following macro definitions, the recommended syntax should be taken to mean the following:
%MACRO=[macro number]=..=[long description]=[variables...]
For example:
%MACRO=1=..=RAPID=1,2,3,
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
143
38 - ROTARY ROTATE
45 - MOVE ANGULAR
EdgeCAM Code163
Generator
Compiler Guide
- TAP CYCLE
54 - CCLW
165 - TOOLCHANGE
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
66 - CX.OUTPUT
166 - SELECT
TURRET
Generator
or "Machine Tool" file from a man-readable
source
text file containing all the appropriate
parameters
and
logic
required
to
convert
the
raw
EdgeCAM
data
into usable CNC code.
69 - ANGCLW
172 - DWELL
70 - ANGCCLW
182 - TRANSLATE
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
151 - MOVE RAPID
186 - TECHNOLOGY
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
losing
the manual
152 - MOVEupdated
FEED by the Wizard without
190
- MOVE
HOME changes.
153 - MOVE ARC
191 - MOVE TOOLCHANGE
This document contains information to help you produce a customised Code Generator parameter source
155 - PROFILE CYCLE
193 - TURNING AXIAL OR RADIAL
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
MODE
controller would be edited to produce a customised source file, or final adjustments made to a file
originating
from the Code
Wizard and its templates.
156 - AREACLEAR
CYCLE
196 - MOVE RELATIVE 2
157 - SLOT CYCLE
Wire Notes
144
Output for wire erosion machines is different to that of either Milling and Turning. Pathtrace have developed
a method to access data, which is used in EDGEWIRE.WXT. What follows is a description of this technique,
and we recommend that it is used in all EdgeCAM Wire Code Generators.
Four axis CNC output is performed through two macros, Macro 17, Machine Design and Macro 26, Cut
Glue Stop.
Information about the upper and lower profiles is made available in the XPOINT(), YPOINT(), ZPOINT()
array. All data required for both cycle output and expanded output (that is, point to point links for XYUV
output) is contained within this array. This array is composed of the three variables and is of variable length.
For each pair of entities being linked (upper and lower), the X, Y ,ZPOINT() array is filled with:
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
1. Header
block. Tool" file from a man-readable source text file containing all the appropriate
Generator
or "Machine
parameters
logic
2. Block and
for the
XYrequired
entity. to convert the raw EdgeCAM data into usable CNC code.
145
The first block of data is a header block. The external procedure GETHEADER reads this and sets up these
user variables:
Procedure: GETHEADER
Index
XPOINT()
YPOINT()
ZPOINT()
#UVENDBEAR
#STARTLEAD
#ENDLEAD
EdgeCAM Code#XYENDBEAR
Generator Compiler
Guide
#XYSTARTBEAR
#UVSTARTBEAR
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
End bearing of UV element
Start lead angle
End lead angle
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
and logic required to convert the
raw EdgeCAM data into usable
CNC code.
3
#STARTSIDE
#ENDSIDE
#XYUVPAIRS
Number of xyuv pairs for long
handor
output
Source text files may be created via the interactive facilities of the Code Wizard
may be written directly
using
a suitable
text editor. Please note that#UVELEMENT
if a Code Wizard source file is #TYPE
altered manually it cannot be
4
#XYELEMENT
subsequently updated by the Wizard without losing the manual changes.
Element type on XY profile, see Element type on UV profile,
Element type couple
below
see below
See below
This document contains information to help you produce a customised Code Generator parameter source
5 specifically
#XYNEXTSTARTBEAR
Not used
file
for a particular controller. In #UVNEXTSTARTBEAR
practice, a previously tried and tested
text file for a similar CNC
controller Start
wouldbearing
be edited
to
produce
a
customised
source
file,
or
final
adjustments
made to a file
of next XY element End bearing of next UV
originating from the Code Wizard and its templates.
element
6
#XYNEXTELEMENT
#UVNEXTELEMENT
#NEXTTYPE
EdgeCAM Wire Erosion can effectively link any two of four entity types to each other, giving a possible
sixteen combinations, for example a Line can be linked to a Point.
Copyright
Pathtrace
Engineering
Systems.
All rights (not
reserved.
The four 1988-2005
entities are
POINT,
LINE, ARC,
and CONIC
arc). The user defined variable #TYPE is set up
#TYPE
XY
UV
Line
16
Point
32
Arc
64
Conic
128
146
The external procedure GETHEADER checks both #XYELEMENT and #UVELEMENT, then calls a
procedure for each type. These external procedures are:
Procedure : XYLINE
Index
1
XPOINT()
YPOINT()
ZPOINT()
X start of line
Y start of line
Z start of line
EdgeCAM Code
Generator Compiler
Guide
#XSTART
#YSTART
#ZSTART
2
#XEND
#YEND
#ZEND
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
X "Machine
end of lineTool" file from Y
of line
X end
of line all the appropriate
Generator or
a end
man-readable
source text file
containing
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Procedure : UVLINE
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
Index
XPOINT()
YPOINT()
ZPOINT()
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently
1
updated by the Wizard without
losing the manual changes.
#USTART
#VSTART
#WSTART
U start of line
V start of line
W start of line
This
document
contains information to#VEND
help you produce a customised
Code Generator parameter source
2
#UEND
#WEND
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
U endbeofedited
line to produce V
end of line source file, or final
W end
of line
controller would
a customised
adjustments
made to a file
originating from the Code Wizard and its templates.
Procedure : XYARC
Index
XPOINT()
YPOINT()
ZPOINT()
#XCENTRE
#YCENTRE
#XYRADIUS
X centre of arc
Y centre of arc
Radius
#XEND
#YEND
Not used
Copyright 1988-2005
Pathtrace
rights reserved.
X end of
arc Engineering Systems.
Y end ofAll
arc
XYARCSTARTANGLE
#XYARCENDANGLE
#XYELLIPENDARC
Procedure : UVARC
Index
XPOINT()
YPOINT()
ZPOINT()
#UCENTRE
#VCENTRE
#UVRADIUS
U centre of arc
V centre of arc
Radius
#UEND
#VEND
Not used
U end of arc
V end of arc
UVARCSTARTANGLE
#UVARCENDANGLE
#UVELLIPENDARC
Procedure : XYPOINT
147
Index
XPOINT()
YPOINT()
ZPOINT()
#XPOINT
#YPOINT
#ZPOINT
X point
Y point
Z point
Procedure : UVPOINT
Index
XPOINT()
YPOINT()
ZPOINT()
#UPOINT
#VPOINT
#WPOINT
#XSTART
#YSTART
#XCORNER
#YCORNER
%PROCEDURE = WIRE_VECTOR
This procedure calculates the IJK vectors of the wire.
Values returned are:
#IVECTOR = X
#JVECTOR = Y
#KVECTOR = Z
(The resultant is a unit vector.)
%CALL = WIRE_VECTOR
The vectors are calculated from #XEND #YEND Z U V W
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Ensure
thatorthese
variables
set before calling
thistext
procedure.
Generator
"Machine
Tool"are
filecorrectly
from a man-readable
source
file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
148
Procedure : GETPAIR
Index
XPOINT()
YPOINT()
ZPOINT()
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
1
#XEND
#YEND
#ZEND
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
and logic required to convert #VEND
the raw EdgeCAM data into usable
CNC code.
2
#UEND
#WEND
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
149
150
In the following macro definitions, the recommended syntax should be taken to mean the following:
%MACRO=[macro number]=..=[Description]=[variables...]
For example:
%MACRO=17=..=Machine=5,12,21,24,25,
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
151
1 - MOVE RAPID
33 - ROTATE
2 - MOVE FEED
34 - MIRROR
3 - MOVE ARC
40 - MOVE HOME
5 - 2D PROFILE
51 - START
EdgeCAM Code
Generator Compiler Guide
53 - CLW
6 - 2D DESTRUCT
15 - MACHINING CONDITIONS
54 - CCLW
17 - MACHINE DESIGN
55 - SUBSTART
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
22 - DWELL
56 - SUBENDsource text file containing all the appropriate
Generator
or "Machine Tool" file from a man-readable
parameters
and logic required
the- raw
26 - CUT SUPPORT
TAG to convert 58
ENDEdgeCAM data into usable CNC code.
29 - COMPENSATION
59 - SUBCALL
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
32 - TRANSLATE
60 - RESET
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
This option is applicable to the Code Generator Compiler only, and will be greyed out if you do not have a
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
licence.
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters
and
requiredapplication.
to convert the raw EdgeCAM data into usable CNC code.
Exit- Returns
to logic
the previous
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
152
The Code Generator Compiler is an integral part of the EdgeCAM suite of software. It creates a Code
Generator or "Machine Tool" file from a man-readable source text file containing all the appropriate
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
This document contains information to help you produce a customised Code Generator parameter source
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
153
Remove Unused Variables- Instructs the compiler to remove any duplicate or unused variables from the
source file (*.?xt)
Quick Compile- Forces a quicker compilation by displaying the minimum amount of feedback in the
viewing window.
The
Code
Generator
Compiler
is an integral
partGenerator
of the EdgeCAM
suite ofoption
software.
It creates
a Code
Specify
Output
Filename
- Selecting
this Code
Compiler-only
displays
a dialog
box
Generator
or
"Machine
Tool"
file
from
a
man-readable
source
text
file
containing
all
the
appropriate
similar to this after you click on the Compile button:
parameters and logic required to convert the raw EdgeCAM data into usable CNC code.
Source text files may be created via the interactive facilities of the Code Wizard or may be written directly
using a suitable text editor. Please note that if a Code Wizard source file is altered manually it cannot be
subsequently updated by the Wizard without losing the manual changes.
Enter a different name for the compiled Code Generator file. If this option is not selected, the source
This document
to help you produce a customised Code Generator parameter source
filename
will becontains
used by information
default.
file specifically for a particular controller. In practice, a previously tried and tested text file for a similar CNC
controller would be edited to produce a customised source file, or final adjustments made to a file
originating from the Code Wizard and its templates.
154
Copyright
155