Code Generator Compiler
Code Generator Compiler
Code Generator Compiler
*.mxt
2-axis Turning
*.2xt
4-axis Turning
*.4xt
*.cxt
Wire Erosion
*.wxt
The %MACHINE statement should be consistent with the extension to make recognition of the type of file
easier.
For example:
%MACHINE=MILL=...
NNCNC01.MXT compiles as
NNCNC01.MCP
%MACHINE=LATHE=...
NNCNC01.2XT compiles as
NNCNC01.TCP
%MACHINE=LATHE=...
NNCNC01.4XT compiles as
NNCNC01.TCP
%MACHINE=LATHE=...
NNCNC01.CXT compiles as
NNCNC01.TCP
%MACHINE=UVWIRE=...
NNCNC01.WXT compiles as
NNCNC01.WCP
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 semicolon.
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.
See Also
Numeric Variables
String Variables
Numeric Variables
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
Requested from the user during code generating (using %ASK).
String Variables
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:
Variable has not been declared in {line of file in error}
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:
'Invalid declaration in {line in error}'
10
Information
Range
Module
Units
0 = Inches
1 = Millimetres
All
Value
All
Value
Mill+Turn
Value in Degrees/minute
Turn
Two tapes
0 = No
1 = Yes
Turn
Rapid 3D
0 = No
1 = Yes
Mill+Turn
0 = Resolved
1 = Unresolved
Mill+Turn
Compatibility
See Compatibility
Mill
Axes of Rotation
10
Plane Switching
0 = XY
1 = XY, ZX
2 = XY, ZY
3 = XY, ZX, ZY
Mill
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
Mill+Turn
19
0 = Disabled
1 = Enabled
Mill+Turn
11
20
CX Interpolation
0 = Disabled
1 = Enabled
Turn
See CX Interpolation
21
0 = Disabled
1 = NURB (Fanuc)
2 = Spline (Heidenhain)
3 = Siemens 840D
Mill
Helical arcs
27
28
0=no
1=yes
(Not yet in use)
Mill
29
0=no
1=yes
(Not yet in use)
Mill
30
Pivot Point
Mill
31
5 axis cycle
Mill+Turn
32
Version
1 = EC10.5 style
Mill only
33
0=Not inverse
1=Inverse
Mill+Turn
34
0=no
Mill+Turn
1=yes (Sw 31 must be set "2" for
IJK)
35
0=round
1=sharp
36
Multi-plane nutated
0=Orthogonally aligned
1=Machine axis aligned
37
0=CPL Coordinates
1=Machine Coordinates
All
12
38
0=no
1=yes
39
0=no
1=yes
40
0=no
1=yes
13
Bit
Meaning
Visit the Reset macro once the Mirror macro has finished. (Milling only)
This reverses the tool side in cases where a single 45-degree line is being profiled.
(Turning only)
16
Enable true NEXTMOVE look ahead within the Toolchange Macro. (Turning and
Milling)
See Note below.
32
Note
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.
14
PRIMARY
SECONDARY (FREE)
A AXIS
B AXIS
2 ( DEFAULT)
16
C AXIS
32
For example, a machine tool which has a fixed axis primary A and a free axis secondary B would give:
System variable MACHTYPE = 1(A) + 16(B) = 17
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
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
15
16
Primary
Secondary (fixed)
A axis
64
B axis
2 (default)
128
C axis
256
17
18
19
20
*...|16 |17|18|19|20
MM=...,1.5,1 ,0 ,1 ,0 (MPR set to zero will convert all arcs to feed moves)
*...|16 |17|18|19|20
MM=...,1.5,1 ,-1,1 ,0 (MPR set to -1 removes any limitations)
The MPR should be entered in the same units as set in switch 1 of the MM line. If non-default units are used in
a part program, the decimal place for the MPR will be moved up or down 1 place accordingly.
21
22
23
8 |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, leaving 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.
24
Information
Range
Module
Turret Name
String
All
Number of stations
Value
Mill+Turn
Toolchange X position
Value
All
Toolchange Y position
Value
All
Toolchange Z position
Value
Mill+Turn
Value
All
Value
All
Value
Mill+Turn
Maximum X value
Value
All
10
Maximum Y value
Value
All
11
Maximum Z value
Value
All
12
Minimum X value
Value
All
13
Minimum Y value
Value
All
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
23
Value
Turn
24
Value
Turn
25
Value
Turn
26
Value
Turn
27
Tool Set X
Value
Mill+Turn
28
Tool Set Y
Value
Mill+Turn
25
29
Tool Set Z
Value
Mill+Turn
30
Turret type
0=Indexing
1=ATC
Turn
31
Value
Mill+Turn
32
0=about tip
1=about pivot point
Turn
33
Move Index
Reserved - leave
blank
NA
34
Reserved - leave
blank
NA
35
B axis capabilities
0= interpolates
1=indexing only
Turn
36
0= no
1= yes
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.
26
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
ID
0,1,2,3
TurretId
Type
0 (Tool), 1 (Work)
Max RPM
Value
MaxAngFeed
Value
Direction
0 (CCLW),1 (CLW)
MirrorOutput
0,1
CSS Capable
0 (No), 1 (Yes)
10
Rotation
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.)))
27
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).
Here is an example MG line:
MG=2,28,5000,5000,41,5001,7500,7500,42
28
Macros
The macro definitions within the Code Generator parameter files follow a standard layout as follows:
%MACRO=[Number]=..=[Description]=[Modifier List]=[Option List]
:
: [directives to control and generate CNC output]
:
%ENDM
The format of the %MACRO line itself is most important as it controls the screen menus which appear during
machining.
Note that the '=..=' portion of the first line must be included - it is a relic of an earlier product (PAMS).
29
Number
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.
toolchange, profile, rapid, feed etc. These macros are defined within the Code Generator.
51-100
101-150 User-defined macros which allow control of M code type CNC operations or special
customer requirements (for example, probing, part changer), including PDIs. These
macros will have no graphical effect on the tool path graphics when invoked. User defined
macros become additional commands within Edgecam and are automatically merged into
the M-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.
30
Description
This is a test string that describes the function of the macro.
This string is automatically merged into the Edgecam's Manufacture mode M-Functions menu for user defined
macros, numbers 101 to 151.
Code Generators can support non-English language descriptions. For these macros, the descriptions should
not be longer than 25 characters.
31
Modifier List
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 (-).
For example, the macro line shown below would remove the modifier Canned Cycle from the Rough Turn cycle:
%MACRO=4=..=ROUGH TURN=4,5,7,10,30,31,-21,40, 41,
If the CANNED CYCLE modifier is removed from the menu of any macro, you must redirect processing through
"%NOCYCLE". The system variable PATHTRACE automatically returns the value of 1, but only after
regenerating the menu file and regenerating the machining instructions.
Any modifier displayed in a Edgecam machining command can be removed in this way. This is very useful
where some complex Edgecam functionality is not required.
A good example is the threading command, which can be greatly simplified for many applications.
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
32
33
34
Option List
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:
Within the user-defined macro, the value is assigned to the system variable SUBFUNCT.
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.
35
36
#BNUM=#START
37
Arithmetic Calculations,(variable)=(variable/number)(operator)(variable/number)
Where {operator} is:
+
(plus)
(minus)
(divide)
(multiply)
For example:
#BNUM=#BNUM+10
#IVALUE=XCENTRE-XSTART
#DIAM=2*#RADIUS
#TEST=(#TEST1+#TEST2)*#TEST3-#TEST4
There is also a shortened form for expressions of the form {num1}={num1}{operator}{num2} where the operator
is + -/ or *,
for example #BNUM=#BNUM+#BNUMVAR May be written as: #BNUM=+#BNUMVAR
38
sine
COS
cosine
TAN
tangent
ATAN
arc tangent
ASIN
arc sine
ACOS
arc cosine
SQR
square root
INT
integer value of *
ABS
remove sign
For example, the coding to calculate incremental unsigned arc centres could be:
#IVALUE=XCENTRE-XSTART:#IVALUE=ABS(#IVALUE)
#JVALUE=YCENTRE-YSTART:#JVALUE=ABS(#JVALUE)
Multiple operator functions and parentheses ( ) may be used; for example:
#TEST=(ABS(#TEST1))/2
39
40
Labels
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.
The same label name can occur in different macros.
Should more than 100 labels be defined in any one macro the compiler error message will be issued:
TOO MANY LABELS
An example of a label is:
:
:
%GOTO @JUMP
:
:
@JUMP
41
Directives
Directives are the commands available within macros and procedures that allow the manipulation of the data
available within each macro.
See Also
%ASK
%COMMAND... %ENDCOMMAND (Integrating PDIs)
%DEBUG
%GOTO \{jump label\}
%IF ... %THEN ...
%IF... %THEN ... %ELSE ...
%INCLUDE
%OPTIONS
42
%ASK
%ASK={promptstring}={user defined variable name}
This is a statement that prompts the user to answer a question during code generating and the reply is then
stored as a variable. The variable may be either numeric or character string.
For example:
%ASK=Enter program label=$LABEL; string assignment
%ASK=Enter program ID number=#NUMBER ;numeric assignment
If no replay string is entered (or Escape or Abort selected) the return value is set as #FUNNY for numeric
variables or a null string("") for string variables.
43
20
PLANAR
CIRCLE_POCKET|circpkt
121
26
FEEDRATE
105
PLUNGE_FEED
106
SPEED
107
%_STEPOVER
16
16
116
DEPTH_PARMS
162
256
169
-2
285
CLEARANCE
28
28
128
LEVEL
161
168
287
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.
44
%DEBUG
%DEBUG=ON
%DEBUG=OFF
This statement allows debug mode to be switched on and off from within a Code Generator.
45
46
equal to
<>
not equal to
<
less than
<= or =<
>
greater than
>= or =>
For example:
%IF #FRED=2 %THEN %GOTO @DONT-ASK
%ASK=Enter value for #FRED=#FRED
@DONT-ASK
or the shortened version (which cannot be used with %ELSE):
%IF #FRED=2 @DONT-ASK
%ASK=Enter value for #FRED=#FRED
@DONT-ASK
See Also
Controlling the CNC Output Precision
47
48
See Also
Controlling the CNC Output Precision
49
%INCLUDE
%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.
%INCLUDE files may not be nested.
Note that after use of %INCLUDE it may be necessary to program an additional %ENDM either at the end of
the included file or immediately after the %INCLUDE instruction.
%INCLUDE=txt1.mac
%ENDM
It is permissible to call more than one file from a base file:
%INCLUDE=txt1.mac
%INCLUDE=txt2.mac
%ENDM
50
%OPTIONS
%OPTIONS={Prompt string^Option1^Option2...}={user-defined var}
This is similar to %ASK but displays an option list for the user to select from. The prompt string contains the
title of the option box, and selectable options are separated by "^".
The user variable is set up as the option number selected.
For example:
%OPTIONS=Select Rapid Rate^HighFeed^RapidRate=#RAPID
This statement would cause the following option box to be displayed at the time of starting the Code Generator
for CNC output.
The user variable #RAPID is set up as 1 for High Feed and 2 for Rapid Rate.
If Escape or Abort is detected the #RAPID variable is set to #FUNNY .
51
% O U T P U T-IFCHANGED
% D O N T-OUTPUT
%CANCEL
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.
PRECISION is a system variable that sets the accuracy limit for the %OUTPUT-IF-CHANGED, %DONTOUTPUT and %ALWAYS-OUTPUT directives.
The syntax for the variable 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
Example of %ALWAYS-OUTPUT
Example of %OUTPUT-IF-CHANGED
Example of %DONT-OUTPUT
Controlling the CNC Output Precision
52
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 code would be
...
N130 G00X2.0Y3.0Z4.0
N140 G00X2.0Y3.0Z0.0
N150 G00X6.0Y3.0Z0.0
...
53
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
...
54
Example of %DONT-OUTPUT
%DONT-OUTPUT=YMOVE
The CNC code would be:
...
N130 G00X2.0Z4.0
%CANCEL=#YMOVE
N140 G00Z0.0Y3.0
N150 G00X6.0
...
The directive used most commonly is %OUTPUT-IF-CHANGED and it is usually placed within the START
macro with all the required variables.
The %CANCEL directive is used to emulate a controller which has turned off a modal function - for example, 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 and %CANCEL directives may only be used for numeric variables,
whereas the %ALWAYS-OUPUT and %DONT-OUTPUT directives may be used for numeric or string variables.
55
which will always appear without any change in the CNC output.
For example <G90>
String variables
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}
Examples of CNC macro lines are:
<[#BNUM=19] G01[XMOVE=0]
;Notethatthisline
[YMOVE=1][ZMOVE=2][XYFEED=7]
[ZFEED=7][#COOL=15]>
;createdover3textlines
56
Special Characters
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).
WARNING: If an output line spilling over into two lines contains hard coded spaces, these spaces
may be truncated by the compiler.
For example:
<[#BNUM=20]... (80 spaces) ...(CR)
(40 spaces)... M30>
may be truncated to:
<[#BNUM=20]... (10 spaces) ...(CR)
(40 spaces)... M30>
This line is therefore best written as:
<[#BNUM=20]... (120 spaces) M30>
57
ASCII Table
ASCII Value ASCII Character
032
SPACE
033
034
"
035
036
037
038
&
039
'
040
041
042
043
044
045
046
047
048
049
050
051
052
053
054
055
056
057
058
059
060
<
061
062
>
58
063
064
065
066
067
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
093
094
095
096
59
097
098
099
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
DEL
60
61
If the output is directed to a disk which does not support long file names then:
Bracket left side-Rev3.nc, becomes
Bracket .nc
Bracke-1.nc
Bracke-2 .nc...
Up to 99 files may be created.
62
%DATA
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
%DATA2=1,2,3,4,5,6,7,8, ;Speed codes
...
...
...
...
%MACRO=15=TL=Toolchange=8,47,48,
%CALL=SPEED ;Call process to calculate speed code
...
%ENDM
...
...
%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
Limitations and Requirements
63
64
65
SUBFUNCT
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
66
67
68
69
70
A value of 0 implies that the toolpath generated did not match any of the possible canned cycles. In this case
%NOCYCLE should be used.
For example:
%MACRO=3=..=Simple turning cycle=1,2,5,7,10,21,
%IF MASK=1...
%IF SUBFUNCT=0 %THEN %NOCYCLE ;not a valid cutting condition so
;expand using FE, RA and CIRCLE
%IF PATHTRACE=1 %THEN %NOCYCLE;expand using FE, RE and CIRCLE
%IF SUBFUNCT=2 @FACE
%IF SUBFUNCT=4 @FACE
%IF SUBFUNCT=6 @FACE
%IF SUBFUNCT=8 @FACE
@TURN
71
72
SUBFUNCT
0 = Not a lead move
1 = Lead in move
2 = Lead out move
73
74
%LOAD
%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
%LOAD=#HEADER
#BNUM=+#BNUMVAR: <[#BNUM=20][POSITION=10]>
#HEADER=#HEADER+1
%IF #HEADER < NUMTOOLS %THEN %GOTO @RELOAD
...
This will load the system variable POSITION with the turret number entered for each tool used. This is usually
set up within the START macro to display a complete list of all the tooling information used for each machining
file.
%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
%LOAD=#TOOLINFO: #NEXTOOL=POSITION
%IF SUBFUNCT=NUMTOOLS %THEN #TOOLINFO=1
; reload first tool for preselect if on last toolchange
%LOAD=#TOOLINFO: #NEXTOOL=POSITION
; reload current tooling values
%LOAD=SUBFUNCT
...
%ENDM
SUBFUNCT at Toolchange is always set to the correct value to allow access to the current tooling information.
Therefore the logic above will load the next tool's turret position for pre-selection and then reload the current
information.
When %LOAD is used the user variables defined for the toolchange macro will also be set with the values
given in Edgecam.
USERVAR1 to USERVAR5
Note that the content of these variables is dependent on the Code Generator file content.
75
%GETCPL
%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:
INDEX
GROUPDESCRIPTION
= CPL name
STYPE
ROT1
= Primary angle
ROT2
= Secondary angle
XSUB*
YSUB*
ZSUB*
SYSID
DIRECTION
= Index direction
SUBFUNCT
SFMOD
* The system variables XSUB, YSUB and ZSUB (not #XSUB etc) contain the current position from world origin,
in current coordinates.
For example:
#POINTER=0
@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
76
#BMOVE=ROT2
<[#AMOVE=32][#BMOVE=33]>
; Load current CPL information so as
; to output new index position
...
...
%MACRO=48=DS=DATUM SHIFT
%GETCPL=SUBFUNCT
...
...
77
78
Array Expansions
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(#)
where # is a numeric variable. It operates as follows:
XPOINT(1) holds the X co-ordinate of the first hole, YPOINT(1) holds the Y co-ordinate of the first hole in the
drill pattern.
Turn profiles are also held in the XPOINT(), YPOINT() array. A third element, RADIUS(), is also set up, and this
will be non-zero if this point refers to an arc centre. The radius value is signed (+'ve is counterclockwise and 've is clockwise).
UV Wire Profiles and Thread Milling information also use this array. See the relevant machining discipline
section for more information.
When you need to output the pattern co-ordinates, increment through the array and output the values held
within the array. The expansion is terminated by testing a System Variable LAST which is set to the number of
co-ordinates in the pattern.
For example:
%PROCEDURE=LOOPEXPAND
#LOOP=2 ;DRILL REST FROM COORD TWO
@LOOP
%IF #LOOP>LAST %THEN %GOTO @ENDLOOP
#BNUM=+#BNUMVAR: #XMOVE=XPOINT(#LOOP): #YMOVE=YPOINT(#LOOP)
<[#DELETE=24][#BNUM=20] [#XMOVE=0][#YMOVE=1]>
#LOOP=#LOOP+1
%GOTO @LOOP
@ENDLOOP
#BNUM=+#BNUMVAR:#GCODE=80
<[#DELETE=24][#BNUM=20] [#GCODE=19]>
%CALL=HOLD ;STORE CURRENT AXIS POSITION
%ENDM
79
XPOINT() = X co-ordinate
YPOINT() = Y co-ordinate
ZPOINT() = ZLEVEL (Multi-level only) or #FUNNY
MZDEPTH()= Z drilling depth
MRPLANE()= Retract plane
Rotary Radial
Rotary Axial
XPOINT() = X co-ordinate
YPOINT() = Y co-ordinate
ZPOINT() = Not used
MZDEPTH()= Z drilling depth
MRPLANE()= Retract plane
When axially machining, the co-ordinates are always Cartesian for both rotary and planar modes.
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
80
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.
81
%NOCYCLE
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 action of %NOCYCLE is to exit the macro definition, immediately passing the axis moves to the Feed,
Rapid and Circle macros (CLW, CCLW).
For example:
%MACRO=32=TR=Translate=43,44,45,14,26,37,21,
*
%IF PATHTRACE=Y %THEN %NOCYCLE ; redirect through Rapid, Feed
* ; and CLW, CCLW macros
*
*
%IF MASK=1 %THEN ...
#XSUB=...
#YSUB=...
#BNUM=+#BNUMVAR:<[...] [...]>
#BNUM=+#BNUMVAR: <[...] [...]>
#BNUM=+#BNUMVAR:<[...] [...]>
%ENDM
See Also
System Variable NOCYCLE
82
%NOCYCLE has no function within the Wire Erosion module. See Wire Notes for explanation of
equivalent functionality.
83
%SUBROUTINE
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:
(In start macro )
#NESTED=0
#NESTED=#NESTED+1
%IF #NESTED > 1 %THEN <ERROR:NESTING OF SUBS
NOT POSSIBLE ON THIS CONTROL -USE PATHTRACE CYCLES>
#NESTED = #NESTED -1
(#NESTED will always return the current level of subroutine nesting if used in this way).
%SUBROUTINE may not appear more than once and must only be defined within the macros as listed below.
The position of %SUBROUTINE within the source file governs the output position of the controller subroutines.
The following rules apply to the relevant positional definitions:
%MACRO=START
...
...
%SUBROUTINE
...
...
%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.
See Also
84
MASK
Macro Definitions Related to Controller Subroutines
Controller Subroutine Calls by Block Number
85
86
87
88
MASK
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
prevents output
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.
EG. %IF MASK=1 %THEN #BNUMVAR=0 %ELSE #BNUMVAR=10
See Also
Simple Usage of MASK
Complex Usage of MASK
89
Subroutine Definition
L2
Punch Component
L3
Pause
L4
Axis movement
L5
End of Definition
L6
...
L7
...
L8
L9
Axis movement
L10
L11
End of code
The example will reduce the amount of output code required, but for full simulation the full graphical axes
movement is required to be output.
Therefore the graphics display will be as below:
Previous axis movement
...
O1 Axis movement
O2 Punch Component
O3 Axes movement
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.
90
Subroutine at start
Subroutine at end
1st Pass
2nd Pass
1st Pass
2nd Pass
Main Code
MASK=1
MASK=0
MASK=0
MASK=1
Subroutine
MASK=0
MASK=1
MASK=1
MASK=0
Main Code
MASK=1
MASK=0
MASK=0
MASK=1
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
91
Circle Programming
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
quadrant programming
CIRCLE=0
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
appropriate to the CIRCLE definition.
Edgecam can also output plane switching arcs in both the ZX and ZY planes. The 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
supported, the arcs are broken down into linear movements.
TRUEARCOP
XYARCS
0 (Milling default)
1 (Turning default)
XSTART, YSTART,
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
92
Explanation
NOBULGECORRECTION
RESOLUTION
Specify the resolution of the Controller. This used for the bulge
calculation error check.
The system variable should be set in the START macro.
%MACRO=START
NOBULGECORRECTION=0
; 0=Bulge correction On
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:
93
94
PRECISION=0.0001
UNIT=1 (metric)
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
#XHOLD=20:#XMOVE=20.0001
%IF #XMOVE=#XHOLD @SKIP
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.
95
Debugging
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
1 = All macro executions output to CNC file.
2 = Macro names output only if MASK=0 (that is, CNC output turned on).
96
Silent Output
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.
%OPTIONS=SILENTMODE^ON^OFF=SILENT
%IF $SILENT=Y %THEN SILENT=1
$SILENT must be declared in a %DECLARE statement.
97
Textcase
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.
2 = Will convert all text strings to lowercase.
Note that word letter addresses output from Format Table are not converted. If NC code is written as text
strings in output blocks (or Code Wizard code constructors) those strings will be converted by TEXTCASE.
Any other value for TEXTCASE will result in the text being left unchanged.
98
Matrix Processing
The matrix operation provides a method of producing a series of identical components using one of the
following methods:
99
%Output
%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
... ; output filename="TEST"
APPEND=1 ; enable suffix file creation
$NAME=SETUP ; assign 'SETUP' as suffix to $NAME
%OUTPUT=$NAME ; output to secondary file
... ; direct output to a CNC file
... ; called TEST-SET'
...
...
%OUTPUT=STANDARD ; direct output to standard TEST
... ; filename
...
You can redirect the output at any time by assigning %OUTPUT as either STANDARD or $NAME.
The suffix assignment must only be made once.
Where the files are directed to a disk which cannot support long file names (for example, Novell 3.1) Edgecam
abbreviates the name to fit, by using the first six characters and then adding a dash plus the first character of
the $NAME.
Here are some examples:
Long Filename
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
100
Leader
LEADER is NOT a system variable.
The use of LEADER is to output a length of null characters within the output file. The RS232 software interprets
this command during a RS232 communication session.
The statement is a CNC output command therefore the syntax should be as below:
%MACRO=...
...
<LEADER=####>
...
%ENDM
where #### is the number of null characters required to be output.
It should be noted that it is also possible to insert the statement in an output file using the Editor.
101
102
Format Table
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.
An example format table follows:
%FORMAT ;Inch MM
Comments
X,3,4,128,4,3,128,0
X MOVE
Y,3,4,128,4,3,128,
Y MOVE
I,3,4,128,4,3,128,
I MOVE
J,3,4,128,4,3,128,
J MOVE
R,3,4,128,4,3,128,
R MOVE
G,2,0,1,2,0,1,
GCODE
N,5,0,0,5,0,0,
BLOCK NUMBER
%ENDF
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
103
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
16
32
64
128
256
512
1024
2048
Format Table
Number
CNC Code
X,3,3,128,3,3,128
X2.0
2.125
X2.125
.25
X.25
Y2.0
2.125
Y2.125
25
Y25.0
I2.
2.125
I2.125
25
I25.
J000200
2.125
J000212
25
J002500
Y,3,3,128,3,3,128
I,4,3,64,4,3,64
J,4,2,21,4,2,21
104
105
2YSTART
5RADIUS
9YMOVE
13YHOME
16YTOOL
19TOOLRAD
22XYFEED
25LAST
29DEGR
32IPLANE
35YSUB
39ZINC
43ZSTART
46TOOLXSET
49TOOLANGLE
52TOOLANGLE1
55NEXTYMOVE
58PITCH
61NEXTMACRO
64ENCOMMAND
67XENDPOS
70 ZCURRENTPOS
73NEXTSPEED
76NEXTCSS
79STARTSUB
82CSS
86NEXTZFEED
89NEXTGEAR
92TOOLCHANGE
95ZLEVEL
98TOTDEPTH
101NEXTARC
104SFMOD
107STANGLE
110XREP
114YSHEET
117LEFTRIGHT
120MAXFEED
123TXMAX
126ZTOOL1
129MACHTIME2
132YMAX
135ORIENTATE
138PUNCHMODE
141XHOME1
144INDEX
147USERVAR3
150YDATUM
153CONTMATRIX
156CCENTRE
159REND
162CAXIS
165WMOVE
168dummy
3XCENTRE
6XEND
7YEND
10ZMOVE
11UNIT
14ZHOME
17ZTOOL
20TOOLEN
23ZFEED
26CIRCLE
27ZDEPTH
30DWELL
33SUBROUTINE
36ZSUB
37XINC
40REPEAT
41POSITION
44ZCENTRE
47TOOLZSET
50TURRET
53TOOLANGLE2
56XSAFE
59OFFSETZ
62PATHTRACE
65XSTARTPOS
68ZENDPOS
71 TOTALDEPTH
74NEXTFEED
77DEPTH
80ENDSUB
83COMP
84DIRECTION
87ZMAX
90NEXTXMOVE
93SUBFUNCT
96RMOVE
99NEXTOOLLEN
102DRILLSUB
105ANGLE
108XDELTA
111YREP
112PIP
115PASS
118LACECUT
121MAXRPM
124TYMAX
127XTOOL1
130IDLE1
133FPASS
136TLXLEN
139ZSHEET
142NUMTOOLS1
145USERVAR1
148USERVAR4
151XDATUM
154CSTART
157RCENTRE
160NUMBLOCKS
163UMOVE
166PRECISION
169SCALE
106
170THICKNESS
171XYPLANE
172UVPLANE
173LOWERWIRE
174UPPERWIRE
175WIREDIAM
176FIELD1
177FIELD2
178FIELD3
179FIELD4
180FIELD5
181FIELD6
182FIELD7
183FIELD8
184FIELD9
185FIELD10
186FIELD11
187FIELD12
188TAPERTYPE1
189TAPERTYPE2
190TAPER1
191TAPER2
192NEXTXCENTRE
193NEXTYCENTRE
194NEXTRADIUS
195MACRONAMEOP
196APPEND
197CMT1
198CMT2
199LIBTYPE
200USERMATRIX
201CIT1
202CIT2
203NOCYCLE
204ROT1
205ROT2
206WRAPRADIUS
207RTYPE
208STYPE
209SYSID
210SILENT
211YGAUGE
212TRUEARCOP
213AMOVE
214BMOVE
215 OUTPUTTOL
216 MAINTAININDEX
217 TOOLOFFSET
218GEAR
219STARTANGLE
220ENDANGLE
221INCANGLE
222SPINDLEID1
223SPINDLEID2
224INDEXID
225SPINDLE
226GEARMAXRPM
227 GEARMINRPM
228 GEARUSERMAXRPM
229 NUMGEARS
230BAXIS
231PRIORITY
232PARTLENGTH
233 MAINPARTSTICKOUT
234 sUBPARTSTICKOUT
235 MAINDATUMTOCHUCKFACE
236 SUBDATUMTOCHUCKFACE
237 MCSUBDATUMX
238 MCSUBDATUMY
239 MCSUBDATUMZ
240DOCKGRIPZ
241MAINSAFEZ
242SUBSAFEZ
243STRATEGY
244USERVAR6
245USERVAR7
246USERVAR8
247USERVAR9
248USERVAR10
249USERVAR11
250USERVAR12
251TEXTCASE
252ZAPPROACH
253XAPPROACH
254XSUBTURN
255YSUBTURN
256ZSUBTURN
257FLUTELENGTH
258PRIORITYMAIN
259PRIORITYSUB
260MILLMODE
261YEAR
262MONTH
263DAY
264 NUMBEROFTURNS
265 GEARCODE
266 SPINDLEUPPER
267 SPINDLELOWER
268 SUBOUTPUTPASS
269 TSTOREUSER1
270 TSTOREUSER2
271 THROUGHCOOLANT
272 ROTSUB
273 XBPIVOTLENGTH
274 ZBPIVOTLENGTH
275 XSCRATCH
276YSCRATCH
277ZSCRATCH
278REACH
279 NOBULGECORRECTION
280 RESOLUTION
281 CORNERRAD
282XCPL
283YCPL
284ZCPL
285INORMAL
286JNORMAL
287KNORMAL
288FIVEAXIS
289WORKDATUMID
290MCOORD
291EULER1
292EULER2
293EULER3
294CPLPLANE
295PIVOT
296GROUPNUMBER
297 IDNUMBER
298 TURRETBANGLE
299 ATCSPINANGLE
107
ANGLE105
APPEND196
BAXIS230
BMOVE214
CCENTRE156
CEND158
CIT1201
CIT2202
CMT1197
CMT2198
CONTMATRIX153
CORNERRAD281
CSS82
CSTART154
DEGR29
DEPTH77
DOCKGRIPZ240
DRILLSUB102
dummy168
DWELL30
ENDANGLE220
ENDSUB80
EULER2292
EULER3293
FEEDTYPE72
FIELD1176
FIELD11186
FIELD12187
FIELD3178
FIELD4179
FIELD6181
FIELD7182
FIELD9184
FIVEAXIS288
FPASS133
FPECK28
GEARCODE265
GEARMAXRPM226
GEARUSERMAXRPM 228
IDLE1130
IDLE2131
INCANGLE221
INDEX144
INORMAL285
IPLANE32
KNORMAL287
LACECUT118
LEFTRIGHT117
LIBTYPE199
MACHTIME1128
MACHTIME2129
MAINDATUMTOCHUCKFACE 235
MAINSAFEZ 241
MAINTAININDEX 216
MAXFEED120
MAXRAPID122
MCOORD290
MCSUBDATUMX237
MCSUBDATUMZ 239
MILLMODE 260
NEXTARC101
NEXTCOMP75
NEXTFEED74
NEXTGEAR89
NEXTOOL42
NEXTOOLLEN99
NEXTRADIUS194
NEXTSPEED73
NEXTXMOVE90
NEXTXYFEED85
NEXTYMOVE55
NEXTZFEED86
NOBULGECORRECTION 279
NOCYCLE 203
NUMBLOCKS 160
NUMCHARS 161
NUMTOOLS103
NUMTOOLS1142
OFFSETX60
OFFSETZ59
OUTPUTTOL215
PARTLENGTH232
PATHTRACE62
PECKRETRACT152
PITCH58
PIVOT295
PRECISION166
PRIORITY231
PRIORITYSUB 259
PUNCHMODE 138
RADIUS5
RCENTRE157
REND159
REPEAT40
RMOVE96
ROT1204
ROTSUB272
ROWPRIORITY119
RSTART155
RTYPE207
SFMOD104
SILENT210
SPINDLE225
SPINDLEID1222
SPINDLELOWER 267
SPINDLEUPPER 266
108
STANGLE107
STCOMMAND63
STYPE 208
SUBOUTPUTPASS 268
SUBSAFEZ242
TAPER2191
TEXTCASE 251
TLXLEN136
TOOLANGLE49
TOOLCHANGE92
TOOLOFFSET217
TOOLUNIT51
TOOLZSET47
TRUEARCOP 212
TURRET50
TZMAX125
UPPERWIRE174
USERVAR10248
USERVAR2146
USERVAR5149
USERVAR8246
VMOVE164
WORKDATUMID 289
XBPIVOTLENGTH273
XCURRENTPOS69
XEND6
XHOME1141
XMOVE8
XSCRATCH275
XSTARTPOS65
XTOOL15
XYPLANE171
YDATUM150
YEND7
YINC38
YREP111
YSTART2
YSUBTURN255
ZBPIVOTLENGTH274
ZCPL284
ZEND45
ZHOME14
ZLEVEL95
ZSAFE57
ZSTART43
ZSUBTURN256
STARTANGLE219
STARTSUB79
STEP106
STRATEGY243
SUBDATUMTOCHUCKFACE 236
SUBFUNCT 93
sUBPARTSTICKOUT 234
SUBROUTINE 33
SYSID209
TAPER1190
TAPERTYPE1188
TAPERTYPE2189
THICKNESS 170
THROUGHCOOLANT 271
TLYLEN137
TOLERANCE167
TOOLANGLE152
TOOLANGLE253
TOOLEN20
TOOLNUM18
TOOLRAD19
TOOLTYPE54
TOOLWIDTH48
TOOLXSET46
TOTALDEPTH71
TOTDEPTH98
TSTOREUSER1 269
TSTOREUSER2 270
TXMAX123
TYMAX124
UMOVE163
UNIT11
USERMATRIX200
USERVAR1145
USERVAR11249
USERVAR12250
USERVAR3147
USERVAR4148
USERVAR6244
USERVAR7245
USERVAR9247
UVPLANE172
WIREDIAM175
WMOVE165
WRAPRADIUS 206
XAPPROACH 253
XCENTRE3
XCPL282
XDATUM151
XDELTA108
XENDPOS67
XHOME12
XINC37
XMAX88
XREP110
XSAFE56
XSHEET113
XSTART1
XSUB34
XSUBTURN254
XTOOL1127
XYFEED22
YCENTRE4
YCPL283
YDELTA109
YEAR261
YGAUGE211
YHOME13
YMAX132
YMOVE9
YSCRATCH276
YSHEET114
YSTEP134
YSUB35
YTOOL16
ZAPPROACH252
ZCENTRE44
ZCLEAR21
ZCURRENTPOS70
ZDEPTH27
ZENDPOS68
ZFEED23
ZHOME1140
ZINC39
ZMAX87
ZMOVE10
ZSCRATCH277
ZSHEET139
ZSTARTPOS66
ZSUB36
ZTOOL17
ZTOOL1126
109
110
111
Multilevel Drilling
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.
If any multilevel cycles are to be used it is suggested that for best results all hole cycles with the same tool
should be treated as multilevel. A combination of multilevel and single level cycles with the same tool may not
give the expected NC output.
112
Milling Modifiers
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
Feedrate
XYFEED
Plunge feed
ZFEED
Speed
SPEED
Tool No.
TOOLNUM
Depth
ZDEPTH
10
Cut increment
DEPTH
12
Offset
OFFSET
13
Side
LEFTRIGHT
14
From
STCOMMAND
15
Comment
USERDEFINEDSTRING
16
%Stepover
STEP
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
113
59
Move type
FIELD2
60
Distance
FIELD1
63 - 66
- Not defined -
67
USERVAR1
68
USERVAR2
69
USERVAR3
70
USERVAR4
71
USERVAR5
72 - 81
- Not defined -
82
Define layout
200
201
Multidepth in drill
cycles
USERMATRIX
ZDEPTH()
114
The flow diagram also applies to the chipbreak, tap, ream and bore macros.
See Also
System Variable - DRILLSUB
Procedure - LOOPEXPAND
Using MASK in Milling
115
116
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
117
118
119
1 - MOVE RAPID
Recommended Syntax
%MACRO=1=..=Move Rapid =1,2,3,
System Variables Modified
AMOVE
BMOVE
CMOVE
RMOVE
ROT1
Angular position
WRAPRADIUS
XMOVE
X Axis Motion
YMOVE
Y Axis Motion
ZMOVE
Z Axis Motion
120
2 - MOVE FEED
Recommended Syntax
%MACRO=2=..=Move Feed=1,2,3,5,6,7,
System Variables Modified
AMOVE
BMOVE
CMOVE
FEED
Feedrate*
FIELD 12
RMOVE
ROT1
Angular position
SPEED
Spindle Speed
SUBFUNCT
WRAPRADIUS
XMOVE
X Axis Motion
XYFEED
Feedrate in XY Plane
YMOVE
Y Axis Motion
ZFEED
Feedrate in Z Axis
ZMOVE
Z Axis Motion
121
3 - MOVE ARC
Recommended Syntax
%MACRO=3=..=Move Arc=1,2,5,7,
System Variables Modified System Variable Description
SPEED
Spindle Speed
XYFEED
Feedrate in XY Plane
122
4 - FACEMILL CYCLE
Recommended Syntax
%MACRO=4=..=Facemill Cycle=1,2,9,5,7,
System Variables Modified
FEED
SPEED
Spindle Speed
X DELTA
Incremental X Distance
XEND
X Finish Position
XSTART
X Start Position
XYFEED
Feedrate in XY Plane
Y DELTA
Incremental Y Distance
YEND
Y Finish Position
YSTART
Y Start Position
ZDEPTH
Z Height of Cut
ZFEED
Feedrate in Z Axis
123
5 - PROFILE CYCLE
Recommended Syntax
%MACRO=5=..=Profile Cycle=4,5,6,7,9,12,13,21,22,24,25,
System Variables Modified
ANGLE
Angle of Lead In
FEED
LEFTRIGHT
Offset Direction
OFFSET
Offset Value
PATHTRACE
SPEED
Spindle Speed
XYFEED
XY Plane Feed
ZDEPTH
Z Height of Cut
ZFEED
Z Axis Feed
124
6 - AREACLEAR CYCLE
Recommended Syntax
%MACRO=6=..=Areaclear Cycle=4,5,6,7,9,12,16,22,24,
System Variables Modified
FEED
OFFSET
Offset Value
SPEED
Spindle Speed
STEP
XYFEED
XY Plane Feed
ZFEED
Z Axis Feedrate
125
7 - SLOT CYCLE
Recommended Syntax
%MACRO=7=..=Slot Cycle=4,5,6,7,9,
System Variables Modified
FEED
SPEED
Spindle Speed
XYFEED
XY Plane Feed
ZDEPTH
Z Height of Cut
ZFEED
Z Axis Feed
126
8 - CROSSHATCH CYCLE
Recommended Syntax
%MACRO=8=..=Crosshatch Cycle=4,5,6,7,9,12,16,49,
System Variables Modified
FEED
OFFSET
Offset Value
SPEED
Spindle Speed
STEP
XYFEED
XY Plane Feed
ZDEPTH
Z Height of Cut
ZFEED
Z Axis Feed
127
9 - DRILL CYCLE
Recommended Syntax
%MACRO=9=..=Drill Cycle=4,6,7,9,10,21,23,27,29,28,50,53|176,200,201,
System Variables Modified
DEGR
Degression Value
DEPTH
Depth of Peck
DRILLSUB
Subroutine Indicator
0 = Longhand Code
1 = Subroutines Present
DWELL
Dwell in Seconds
FEED
Feedrate
LAST
Number of Points
MRPLANE(#)
MZDEPTH(#)
PATHTRACE
RPLANE
Retraction Plane
SPEED
Spindle Speed
XPOINT(#)
X Axis Position*
YPOINT(#)
Y Axis Position*
ZCLEAR
Z Clearance Plane
ZDEPTH
ZFEED
Z Axis Feed
ZLEVEL
ZPOINT(#)
ZSAFE
Safe Distance
128
10 - CHIPBREAK CYCLE
Recommended Syntax
%MACRO=10=..=Chipbreak Cycle=4,6,7,9,10,21,23,29,28,50,53|176,200,201,
System Variables Modified
DEGR
Degression Value
DEPTH
Depth of Peck
DRILLSUB
Subroutine Indicator
0 = Longhand Code
1 = Subroutines Present
DWELL
Dwell in Seconds
FEED
Feedrate
MRPLANE (#)
MZDEPTH (#)
PATHTRACE
RPLANE
Retraction Plane
SPEED
Spindle Speed
XEND
X End Position
XPOINT(#)
X Axis Position*
XSTART
X Start Position
YEND
Y End Position
YPOINT(#)
Y Axis Position*
YSTART
Y Start Position
ZCLEAR
Z Clearance Plane
ZDEPTH
ZFEED
Z Axis Feed
ZLEVEL
ZPOINT(#)
129
11 - REAM CYCLE
Recommended Syntax
%MACRO=11=..=Ream Cycle=4,6,7,9,21,27,29,28,50,53|176,200,201,
System Variables Modified
DWELL
Dwell in Seconds
DRILLSUB
Subroutine Indicator
0 = Longhand Code
1 = Subroutines Present
FEED
Feedrate
LAST
Number of Points
MRPLANE (#)
MZDEPTH (#)
PATHTRACE
RPLANE
Retraction Plane
SPEED
Spindle Speed
XEND
X End Position
XPOINT(#)
X Axis Position*
XSTART
X Start Position
YEND
Y End Position
YPOINT(#)
Y Axis Position*
YSTART
Y Start Position
ZCLEAR
Z Clearance Plane
ZDEPTH
ZFEED
Z Axis Feed
ZLEVEL
ZPOINT(#)
130
13 - TAP CYCLE
Recommended Syntax
%MACRO=13=..=Tap Cycle=4,6,7,9,21,27,29,28,200,201,
System Variables Modified
DWELL
Dwell in Seconds
DRILLSUB
Subroutine Indicator
0 = Longhand Code
1 = Subroutines Present
FEED
Feedrate
LAST
Number of Points
MRPLANE(#)
MZDEPTH(#)
PATHTRACE
RPLANE
Retraction Plane
SPEED
Spindle Speed
XEND
X End Position
XPOINT(#)
X Axis Position*
XSTART
X Start Position
YEND
Y End Position
YPOINT(#)
Y Axis Position*
YSTART
Y Start Position
ZCLEAR
Z Clearance Plane
ZDEPTH
ZFEED
Z Axis Feed
ZLEVEL
ZPOINT(#)
131
14 - MOVE RELATIVE
Recommended Syntax
%MACRO=14=..=Move Relative=4,9,12,13,60,59,7,5,
System Variables Modified
FIELD1
Distance
FIELD2
Move type:
1 = Feed
2 = Rapid
LEFTRIGHT
Offset Direction
OFFSET
Offset Value
SPEED
Spindle Speed
XYFEED
XY Plane Feed
132
15 - TOOLCHANGE
Recommended Syntax
%MACRO=15=..=Toolchange=8,12,47,48,57,61,15,
These system variables are available following a %LOAD call for the current tool number. The current tool
number is the value of SUBFUNCT.
System Variables Modified
CMT1
CSS
CORNERRAD
DIRECTION
FEEDTYPE
FLUTELENGTH
Flute Length
GEAR
Gear
GROUP
GROUPSTRING
GROUPNUMBER
ID
IDSTRING
IDNUMBER
MAINTAININDEX
MAXRPM
POSITION
Turret Number
QUADRANT
STRTSTOREUSER1
133
STRTSTOREUSER2
SUBFUNCT
THROUGHCOOLANT
TOOLDESCRIPTION
Toolname
TOOLEN
TOOLNUM
TOOLOFFSET
TOOLRAD
Tool Radius
TOOLTYPE
TOOLZSET
Z Gauge Length
TSTOREUSER1
TSTOREUSER2
USERDEFINEDSTRING
Comment
Note that the user defined system variable Q69 is usually used for the tool length offset register number.
The ToolStore has been developed to make use of this and where a TLO value is entered it will be passed
through as USERVAR3.
Tool Offset is now the system variable TOOLOFFSET. The modifier 12 must be defined on the macro line
to display and use this new system variable to retain compatibility with existing posts. This method of setting
tool offset replaces the use of user vars.
134
21 - FEED TYPE
Recommended Syntax
%MACRO=21=..=Feed Type
System Variables Modified
SUBFUNCT
135
22 - DWELL
Recommended Syntax
%MACRO=22=..=Dwell=27,
System Variables Modified System Variable Description
DWELL
Dwell in Seconds
136
29 - RADIUSCOMP
Recommended Syntax
%MACRO=29=..=Radiuscomp=
System Variables Modified
SUBFUNCT
Assigned as Selected
Value
1 = No compensation
2 = Compensation Left
3 = Compensation Right
137
30 - MATRIX MODE ON
Recommended Syntax
%MACRO=30=..=Matrix Mode On=43,44,38,39,40,41,21,82,
System Variables Modified
LACECUT
Lacecut
1 = Yes
0 = No
ROWPRIORITY
USERMATRIX
XINC
Incremental X Move
XREP
YINC
Incremental Y Move
YREP
138
139
32 - TRANSLATE
Recommended Syntax
%MACRO=32=..=Translate=43,44,45,14,26,37,21,
System Variables Modified
PATHTRACE
REPEAT
Number of Repeats
SUBROUTINE
Subroutine Number
XINC
X Translation Value
XSUB
YINC
Y Translation Value
YSUB
ZINC
Z Translation Value
ZSUB
XEND
YEND
ZEND
ANGLE
Angular rotation
PATHTRACE
REPEAT
Number of repeats
SUBROUTINE
Subroutine number
140
33 - ROTATE
Recommended Syntax
%MACRO=33=..=Rotate=1,2,14,26,24,37,21,
System Variables Modified
ANGLE
Angle of Rotation
PATHTRACE
REPEAT
Number of Repeats
SUBROUTINE
Subroutine Number
XCENTRE
X Coord of Rotation
XSUB
YCENTRE
Y Coord of Rotation
YSUB
141
34 - MIRROR
Recommended Syntax
%MACRO=34=..=Mirror=1,2,14,26,21,
System Variables Modified
PATHTRACE
SUBROUTINE
Subroutine Number
XEND
XSTART
XSUB
YEND
YSTART
YSUB
142
35 - PECK
Recommended Syntax
%MACRO=35=..=Peck=14,26,45,9,29,21,58,
System Variables Modified
PATHTRACE
PECKRETRACT
Retraction Flag
REPEAT
Number of Repeats
RPLANE
SUBROUTINE
Subroutine Number
XSUB
YSUB
ZINC
Z Translation Value
ZSUB
143
36 - TECHNOLOGY
Recommended Syntax
%MACRO=36=..=Technology=
144
37 - THREAD MILLING
Note that this information also applies to Macro 187 - the CY turning version.
Recommended Syntax
%MACRO=37=..=Thread Mill=7,
Field 1
Clearance
Field 2
Retract
Field 3
Diameter
Field 4
Level
Field 5
Depth of Thread
Field 6
Pitch
This macro will either set up the data array for machines which are capable of helical interpolation, or direct the
output through %NOCYCLE. If the user selects 'canned cycle' processing takes place using the array
described below, otherwise output is via RAPID and FEED macros.
Pathtrace
0 = Helical interpolation
1 = Pathtrace expansion to linear moves (use NOCYCLE
command)
For machines which are capable of helical interpolation the following applies:
The System variable XPOINT(#) must be tested for the type of movement being output.
LAST
XPOINT(#)
0 = Rapid
1 = Feed
2 = Clockwise direction arc
3 = Counterclockwise direction arc
4 = Clockwise direction helical arc
5 = Counterclockwise direction helical arc
145
Rapid
Feed
CLW
CCLW
Helical CLW
Helical CCLW
Element
XPOINT(#)
YPOINT(#)
RADIUS(#)
Feedrate
X Destination
Y Destination
Z Destination
Feedrate
X Destination
Y Destination
Z Destination
Feedrate
X Centre
Y Centre
Radius
X Destination
Y Destination
Not used
Feedrate
X Centre
Y Centre
Radius
X Destination
Y Destination
Not used
Feedrate
X Centre
Y Centre
Not used
X Destination
Y Destination
Z Destination
Start Radius
End Radius
Not used
Feedrate
X Centre
Y Centre
Not used
X Destination
Y Destination
Z Destination
Start Radius
End Radius
Not used
Field 1
Clearance
Field 2
Retract
Field 3
Diameter
Field 4
Level
Field 5
Depth of Thread
Field 6
Pitch
146
40 - MOVE HOME
Recommended Syntax
%MACRO=40=..=Move Home=
System Variables Modified System Variable Description
FIELD1
FIELD2
FIELD3
FIELD4
147
41 - MOVE TOOLCHANGE
Recommended Syntax
%MACRO=41=..=Move Toolchange=
System Variables Modified System Variable Description
FIELD1
FIELD2
FIELD3
FIELD4
Axis priority
0 = No priority
1 = X move first
2 = Y move first
3 = Z move first
148
149
43 - INDEX PALLET
Recommended Syntax
%MACRO=43=..=Index=57,
System Variables Modified
DIRECTION
Index direction of secondary axis (or primary axis if only one axis)
0 = Shortest
1 = Clockwise
2 = Anticlockwise
GROUPDESCRIPTION
CPL name
INDEX
PIVOT
ROT1
Primary angle
ROT2
Secondary angle
SFMOD
STYPE
150
1 = Absolute
SUBFUNCT
SYSID
The tool tip position after the index, in current CPL coordinates
151
Assigned as Selected
0 = Rotary, Z X & C interpolation
1 = Planar, Z X & Y interpolation
152
45 - MOVE ANGULAR
Recommended Syntax
%MACRO=45=..=Move Angular=5,6,7,59,
Re-direction MUST occur using the %NOCYCLE command.
System Variables Modified System Variable Description
AMOVE
BMOVE
CMOVE
FEED
RMOVE
ROT1
Angular position
SPEED
WRAPRADIUS
ZFEED
153
46 - MOVE RELATIVE 2
Recommended Syntax
%MACRO=46=..=Move Relative 2=4,59,7,5,
System Variables Modified System Variable Description
FIELD2
Move type:
1 = Feed
0 = Rapid
SPEED
XYFEED
154
47 - MOVE CONSTRAINED
Recommended Syntax
%MACRO=47=..=Move Constrained=4,59,7,5,
System Variables Modified System Variable Description
FIELD2
Move type:
1 = Feed
0 = Rapid
SPEED
XYFEED
155
48 - DATUM SHIFT
This can only be accessed when MILL MODE=Planar.
Recommended Syntax
%MACRO=48=..=DATUM SHIFT
System Variables Modified System Variable Description
These system variables are available following a %GETCPL each with the index number, SUBFUNCT.
GROUPDESCRIPTION
CPL name
STYPE
SUBFUNCT
SYSID
XINC(1)
XSUB(2)
YINC(1)
YSUB(2)
ZINC(1)
ZSUB(2)
(1) The system variables XINC, YINC and ZINC (not #XINC etc) contain the current CPL position in Initial CPL
coordinates.
(2) The system variables XSUB, YSUB and ZSUB (not #XSUB etc) contain the current position from world
origin, in current coordinates.
156
ROT2
Either ROT1 or ROT2 will be updated with the new angular position obtained from this command.
157
12 - BORE CYCLE
Recommended Syntax
%MACRO=12=..=Bore Cycle=4,6,7,9,21,29,28,50,53|176,200,201,
System Variables Modified
DWELL
Dwell in Seconds
DRILLSUB
Subroutine Indicator
0 = Longhand Code
1 = Subroutines Present
FEED
Feedrate
LAST
Number of Points
MRPLANE (#)
MZDEPTH (#)
PATHTRACE
RPLANE
Retraction Plane
SPEED
Spindle Speed
XEND
X End Position
XPOINT(#)
X Axis Position*
XSTART
X Start Position
YEND
Y End Position
YPOINT(#)
Y Axis Position*
YSTART
Y Start Position
ZCLEAR
Z Clearance Plane
ZDEPTH
ZFEED
Z Axis Feed
ZLEVEL
ZPOINT(#)
158
51 - START
Recommended Syntax
%MACRO=51=..=START System Macro
System Variables
Modified
NUMTOOLS
UNIT
0 = Inches
1 = Millimetres
JOBDESC
JOBCOM
JOBFAM
JOBMACH
JOBCUST
JOBPROG
JOBMATL
JOBREV
APPEND = #
CIRCLE = 1 or 0
CUSTOMERNAME
SERVERCODE
DATE
String variable containing date at code generation time, using the format MM/DD/YY
UKDATE
String variable containing date at code generation time, using the format DD/MM/YY
DAY.MONTH.YEAR
Numeric variables that allow you to format the date according to your requirements
ENDSUB = 0
MACHINENAME
MACHTIME1
MACRONAMEOP=0
MACRONAMEOP=1
MILLMODE
0=Rotary, 1=Planar
MACRONAMEOP=2
NUMBLOCKS = #
NUMCHARS = #
159
PARTNAME
PRECISION
SEQUENCENAME
STARTSUB = 0
TIME
160
53 - CLW
Recommended Syntax
%MACRO=53=..=CLW System Macro
System Variables Modified System Variable Description
ENDANGLE
The end angle of the arc (always positive and less than
STARTANGLE)
FIELD 12
INCANGLE
LEFTRIGHT
RADIUS
Radius of Arc
STARTANGLE
SUBFUNCT
XCENTRE
XEND
XSTART
XYPLANE
YCENTRE
YEND
YSTART
161
54 - CCLW
Recommended Syntax
%MACRO=54=..=CCLW System Macro
System Variables
Modified
ENDANGLE
The end angle of the arc (always positive and greater than
STARTANGLE)
FIELD 12
INCANGLE
LEFTRIGHT
STARTANGLE
Starting angle of the arc (always positive and less than ENDANGLE)
RADIUS
Radius of Arc
SUBFUNCT
XCENTRE
XEND
XSTART
XYPLANE
YCENTRE
YEND
YSTART
162
55 - SUBSTART
Recommended Syntax
%MACRO=55=..=SUBSTART System Macro
System Variables Modified System Variable Description
SUBROUTINE
Subroutine Number
Edgecam regards the start of subroutines as the END of the first move after the label. In this macro the
coordinates of this move are stored in NEXTXMOVE, NEXTYMOVE, NEXTZMOVE. It is from this point that
incremental moves in a subroutine should be calculated.
163
56 - SUBEND
Recommended Syntax
%MACRO=56=..=SUBEND System Macro
System Variables Modified System Variable Description
SUBROUTINE
Subroutine Number
164
58 - END
Recommended Syntax
%MACRO=58=..=END System Macro
System Variables Modified
JOBDESC
JOBCOM
JOBFAM
JOBMACH
JOBCUST
JOBPROG
JOBMATL
JOBREV
165
59 - SUBCALL
Recommended Syntax
%MACRO=59=..=SUBCALL System Macro
System Variables Modified System Variable Description
SUBROUTINE
Subroutine Number
Edgecam regards the start of subroutines as the END of the first move after the label. In this macro the
coordinates of the move are stored in NEXTXMOVE, NEXTYMOVE, NEXTZMOVE and any positioning block
should be to that point except in the case of hole cycle position subroutines.
166
60 - RESET
Recommended Syntax
%MACRO=60=..=RESET System Macro
System Variables Modified System Variable Description
PATHTRACE
0 = Controller Subroutines
1 = Subroutines expanded within Edgecam
SUBFUNCT
1 = Translate
2 = Rotate
3 = Mirror
167
61 - CYCLSUB
Recommended Syntax
%MACRO=61=..=CYCLSUB System Macro
168
69 - ANGCLW
Recommended Syntax
%MACRO=69=..=ANGCLW
This macro handles the output of radially machined arcs in rotary mode.
System Variables Modified System Variable Description
CIRCLE
0=Multi-quadrant arcs
1=Single-quadrant arcs
Radius of Arc
Angular position
WRAPRADIUS
XEND
XSTART / XCENTRE
X Arc Coords
YEND
Y Arc End
YSTART / YCENTRE
Y Arc Coords
ZEND
Z Arc End
ZSTART / ZCENTRE
Z Arc Coords
*The arc co-ordinate variables that are set up will be dependent upon the axis configuration, but CSTART /
CCENTRE /CEND always represent the angular position irrespective of machine configuration.
Note: this macro will only be visited if wrapped geometry is machined at the depth at which the original
geometry was wrapped, or switch 17 on the MM line has been set to 1 (see Rotary Output Mode)
169
70 - ANGCCLW
Recommended Syntax
%MACRO=70=..=ANGCCLW
This macro handles the output of radially machined arcs in rotary mode.
System Variables Modified System Variable Description
CIRCLE
0=Multi-quadrant arcs
1=Single-quadrant arcs
Radius of Arc
Angular position
WRAPRADIUS
XEND
XSTART / XCENTRE
X Arc Coords
YEND
Y Arc End
YSTART / YCENTRE
Y Arc Coords
ZEND
Z Arc End
ZSTART / ZCENTRE
Z Arc Coords
*The arc co-ordinate variables that are set up will be dependent upon the axis configuration, but CSTART /
CCENTRE /CEND always represent the angular position irrespective of machine configuration.
Note: this macro will only be visited if wrapped geometry is machined at the depth at which the original
geometry was wrapped, or switch 17 on the MM line has been set to 1 (see Rotary Output Mode)
170
71 - ATTRIBUTE
Recommended Syntax
%MACRO=71=..=ATTRIBUTE System Macro
System Variables Modified System Variable Description
SUBFUNCT
Attribute type:
3 = True position
(Edgecam 5 Axis extension only)
2 = Secondary feed rate
(XYFEED is also set up in MILL)
(FEED is set up in TURN)
171
72 - SPLINES
Recommended Syntax
%MACRO=SPLINES
Output
Fanuc (output type = NURB)
Heidenhain (output type = cubic polynomial spline)
Siemens (output type = cubic polynomial spline)
The actual output type is specified in the machine details line, position 21.
172
These variables are set up by a system that looks ahead to the next tool movement:
NEXTSPEED
NEXTXYFEED
Next XY feedrate
NEXTZFEED
Next Z feedrate
NEXTCOMP
1 = No compensation
2 = Left compensation
3 = Right compensation
NEXTXMOVE
NEXTYMOVE
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
variables are available:
Edgecam User Guide
173
During %NOCYCLE processing (through RAPID, FEED, CLW and CCLW macros) the following additional
variables are available:
NEXTARC
0 = Nextmove is linear
1 = Nextmove is counterclockwise
2 = Nextmove is clockwise
3 = End of %NOCYCLE processing
NEXTZCENTRE
174
Turning Modifiers
Number
Heading
System Variables
Name
GROUPDESCRIPTION
Feedrate
FEED
Plunge feed
ZFEED
Speed
SPEED
Tool Number
TOOLNUM
Total Depth
TOTALDEPTH
10
Cut Increment
DEPTH
12
Pitch
PITCH
13
CSS
CSS
14
From
STCOMMAND
15
Comment
USERDEFINEDSTRING
17
Override
FIELD1
21
Canned Cycle
PATHTRACE
23
Xinc
YINC
24
Drive
RMOVE
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
175
69
USERVAR3
70
USERVAR4
71
USERVAR5
73
Degression
DEGR
74
Angle
ANGLE
75
Radius
RADIUS
76
Clear
ZCLEAR
77
Retract
RPLANE
78
Xinc
XINC
79
Yinc
YINC
81
XH Angle
ANGLE
82
Retract
PECKRETRACT
176
PASS
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
177
TURRET
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
178
File Output
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 file for the lower turret will be merged with the upper turret file at the
synchronisation points.
179
4 Axis Synchronisation
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.
180
Axis Output
UPPER TURRET
LOWER TURRET
Toolchange
Toolchange
Rapid
Rapid
Rough Turn
Waiting
SYNCHRONISATION
Rapid Home
Profile
Toolchange
...
Rapid
...
Waiting
...
...
...
...
Feed
SYNCHRONISATION
Threading
Rapid Home
...
End of operations
...
Rapid Home
End of operations
181
These variables are set up by a system that looks ahead to the next tool movement:
NEXTSPEED
NEXTXYFEED
NEXTZFEED
NEXTCOMP
1 = No compensation
2 = Left compensation
3 = Right compensation
NEXTXMOVE
NEXTZMOVE
*XTOOL1
ZTOOL
*ZTOOL1
XHOME
*XHOME1
ZHOME
*ZHOME1
TXMAX
TZMAX
IPLANE
Initial plane
MAXFEED
Maximum Feedrate
MAXSPEED
MAXRPM
NUMTOOLS
MACHTIME1
Machining time
182
NUMTOOLS
*NUMTOOLS1
MACHTIME1
*MACHTIME2
MAXFEED
MAXRAPID
MAXRPM
PASS
TURRET
0 = Upper turret
1 = Lower turret
0 = Nextmove is linear
1 = Nextmove is counterclockwise
2 = Nextmove is clockwise
3 = End of %NOCYCLE processing
NEXTYCENTRE
NEXTZCENTRE
183
184
1 - MOVE RAPID
Recommended Syntax
%MACRO=1=..=Move Rapid=1,2,
System Variables Modified System Variable Description
XMOVE
X Axis Motion
ZMOVE
Z Axis Motion
185
2 - MOVE FEED
Recommended Syntax
%MACRO=2=..=Move Feed=1,2,5,7,
System Variables
Modified
FEED
Feedrate
FIELD 12
SPEED
Spindle Speed
SUBFUNCT
XMOVE
X Axis Motion
ZMOVE
Z Axis Motion
186
Degression
DEPTH
Depth of Cut
FEED
Feedrate
FIELD2
Link Type
FIELD7
Z Start Position
FIELD8
X Start Position
FIELD11
PATHTRACE
SPEED
Spindle Speed
SUBFUNCT
XEND
ZEND
187
DEPTH
Depth of Cut
ENDSUB
FEED
Feedrate
FIELD2
Link Type
1 = Rapid
2 = Feed
FIELD7
FIELD8
FIELD9
Billet selection:
0 = Start point specified by current tool position
1 = Billet specified by digitised position
(co-ordinates held in fields 7 & 8)
2 = Geometric or toolpath billet selected
FIELD10
Corner Type
0 = Round corners
1 = Square corners
FIELD11
FIELD12
OFFSETX
OFFSETZ
PATHTRACE
SPEED
Spindle Speed
STARTSUB
SUBFUNCT
Drive Condition
SUBROUTINE
188
XEND
XSTART
ZEND
ZSTART
Important Note
For the Retract and Approach angles to work correctly, you must use a suitably modified Code Generator file.
The line (in the Code Generator source file) containing the Rough Turn macro must be modified as follows:
%MACRO=4=RT=Rough turn area clearance=5,7,10,30,31,21,40,41,135
189
FEED
Feedrate
FIELD1
Lead in Angle
FIELD2
Lead in Radius
FIELD3
Lead in Length
FIELD4
FIELD5
FIELD6
FIELD7
FIELD8
FIELD9
FIELD10
Corner Type:
0 = Round corners
1 = Square corners
OFFSETX
OFFSETZ
PATHTRACE
SPEED
Spindle Speed
STARTSUB
SUBROUTINE
XEND
XSTART
ZEND
ZSTART
190
DEPTH
Depth of Cut
FEED
Feedrate
FIELD1
Grooving Strategy
1 = Sequential
2 = Centre Sequential
3 = Centre Alternate
FIELD2
Link Type
1 = Rapid
2 = Feed
FIELD7
FIELD8
FIELD9
Billet selection:
0 = Start point specified by current tool position
1 = Billet specified by digitised position
(co-ordinates held in fields 7 & 8)
2 = Geometric or toolpath billet selected
FIELD10
Corner Type :
0 = Round corners
1 = Square corners
FIELD12
OFFSETX
OFFSETZ
PATHTRACE
SPEED
Spindle Speed
SUBROUTINE
XEND
XSTART
ZEND
ZSTART
191
Feedrate
FIELD7
FIELD8
FIELD9
FIELD10
Corner Type
0 = Round corners
1 = Square corners
FIELD12
Finish At
1 = Return to cycle start
OFFSETX
OFFSETZ
SPEED
Spindle Speed
SUBROUTINE
XEND
XSTART
ZEND
ZSTART
192
8 - THREAD CYCLE
Recommended Syntax
%MACRO=8=..=Thread Cycle=4,12,7,9,10,21,
System Variables Modified System Variable Description
ANGLE
Approach Angle
Note: If the above is equal to #FUNNY, then the angles are equivalent
to the tool angles.
DEGR
Degression
DEPTH
Depth of Cut
FIELD1
FIELD2
Start Depth
FIELD3
Final Increment
FIELD4
Spring Depth
FIELD5
Link Type
0 = Chase both
1 = Chase in
2 = Chase out
3 = No feed moves in or out
FIELD6
Number of passes
FIELD12
Finish At
1 = Return to cycle start
FPASS
Spring Cuts
PATHTRACE
PITCH
Pitch of Thread
SPEED
Spindle Speed
STANGLE
Retract Angle
Note: If the above is equal to #FUNNY, then the angles are equivalent
to the tool angles.
TOTALDEPTH
XCURRENTPOS
XEND
XSTART
ZCURRENTPOS
193
ZEND
ZSTART
194
9 - DRILL CYCLE
Recommended Syntax
%MACRO=9=..=Drill Cycle=1,10,5,7,21,50,53|176,200,201,
System Variables Modified System Variable Description
DEGR
Degression
DEPTH
DWELL
Dwell time
FEED
Feedrate
MRPLANE(#)
MZDEPTH(#)
PATHTRACE
RPLANE
R-plane
SPEED
Spindle Speed
XCURRENTPOS
ZCLEAR
2nd clear
ZCURRENTPOS
ZEND
ZFEED
Feedrate
ZLEVEL
ZSAFE
Safe distance
195
10 - TAP CYCLE
Recommended Syntax
%MACRO=10=..=Tap Cycle=1,7,12,27,21,200,201,
System Variables Modified System Variable Description
DWELL
Dwell time
FEED
Feedrate
MRPLANE(#)
MZDEPTH(#)
PATHTRACE
PITCH
Thread Pitch
RPLANE
R-plane
SPEED
Spindle Speed
XCURRENTPOS
ZCLEAR
2nd clear
ZCURRENTPOS
ZEND
ZFEED
ZLEVEL
ZSAFE
Safe distance
196
Depth of Cut
ENDSUB
FEED
Feedrate
FIELD7
FIELD8
FIELD9
FIELD12
OFFSETX
OFFSETZ
PATHTRACE
STARTSUB
SUBROUTINE
XEND
XSTART
ZEND
ZSTART
197
12 - TOOL DATUM
Recommended Syntax
%MACRO=12=..=Tool Datum
System Variables Modified System Variable Description
SUBFUNCT
1 = Primary
2 = Secondary
3 = Orthogonal
Note that the user defined system variable Q69 is usually used for the tool length offset register number.
The ToolStore has been developed to make use of this and where a TLO value is entered it will be passed
through as USERVAR3.
198
14 - MOVE RELATIVE
Recommended Syntax
%MACRO=14=..=Move Relative=4,50,49,60,59,7,5,
System Variables Modified System Variable Description
FEED
Feedrate
SPEED
Spindle Speed
199
15 - TOOLCHANGE
Recommended Syntax
%MACRO=15=..=Toolchange=8,12,15,47,48,16,
These system variables are available following a %LOAD call for the current tool number.
The current tool number is the value of SUBFUNCT.
System Variables Modified
ATCSPINANGLE
Reverse unchecked = 0
Reverse checked = 180
CMT1
CMT2
CSS
FIELD1
DIRECTION
FEEDTYPE
GEAR
Gear
GROUP
GROUPSTRING
GROUPNUMBER
ID
IDSTRING
IDNUMBER
LIBTYPE
Set up as follows:
0 = Fixed tooling
1 = Driven Tooling
200
MAXRPM
POSITION
Turret Number
STRTSTOREUSER1
STRTSTOREUSER2
SUBFUNCT
THROUGHCOOLANT
TOOLANGLE1
Angle 1
TOOLANGLE2
Angle 2
TOOLDESCRIPTION
TOOLLIBRARY
TOOLNUM
Tooling definition
0 = Tooling defined within TOOLCHANGE command
1 = Tooling selected from the Cutting Tools database
2 = Tooling selected from Assemblies database
3 = Tooling selected from the active Kit.
TOOLOFFSET
TOOLRAD
TOOLTYPE
201
TOOLUNIT
TOOLWIDTH
Width of Tool
TOOLXSET
TOOLZSET
TSTOREUSER1
TSTOREUSER2
USERDEFINEDSTRING
XBPIVOTLENGTH,
ZBPIVOTLENGTH
YGAUGE
XSCRATCH, YSCRATCH,
ZSCRATCH
Note that Tool Offset is now the system variable TOOLOFFSET. The modifier 12 must be defined on the macro
line to display and use this new system variable to retain compatibility with existing posts. This method of
setting tool offset replaces the use of user vars.
Note that the user defined system variable Q69 is usually used for the tool length offset register number. The
ToolStore has been developed to make use of this and where a TLO value is entered it will be passed through
as USERVAR3.
For machines with two turrets on one slide the separation must be set in the MT line and the modifier 237/176
202
203
16 - SELECT TURRET
Recommended Syntax
%MACRO=16=..=Select Turret
Note that this is a 4 Axis Turning Macro.
System Variables Modified System Variable Description
TURRET
Turret Number
0 = Upper turret
1 = Lower turret
204
17 - CUT DIRECTIONS
Recommended Syntax
%MACRO=17=..=Cut Directions=24,25,17,
System Variables Modified System Variable Description
FIELD1
Override
0 = No
1 = Yes
TOOLANGLE1
Lead angle
TOOLANGLE2
Trail angle
205
18 - CLEARANCE ANGLES
Recommended Syntax
%MACRO=18=..=Clearance Angles=28,29,17,
System Variables Modified System Variable Description
CMOVE
Overpass
FIELD1
Override
0 = No
1 = Yes
RMOVE
Drive angle
206
19 - SAFE DISTANCE
Recommended Syntax
%MACRO=19=..=Safe Distance=1,2,3,
System Variables Modified System Variable Description
XSAFE
X Safe Distance
ZSAFE
Z Safe Distance
207
20 - SURFACE SPEED
Recommended Syntax
%MACRO=20=..=Surface Speed=13,
System Variables Modified System Variable Description
CSS
1 = CSS
0 = RPM
208
21 - FEED TYPE
Recommended Syntax
%MACRO=21=..=Feed Type
System Variables Modified System Variable Description
SUBFUNCT
209
22 - DWELL
Recommended Syntax
%MACRO=22=..=Dwell=27,
System Variables Modified
DWELL
Dwell in Seconds
210
23 - SYNCHRONISE TURRETS
Recommended Syntax
%MACRO=23=..=Synchronise Turrets=15,40,
Note that this is a 4 Axis Turning Macro. It sets up turret priority and a comment for each synchronisation
point.
System Variables
Modified
PRIORITY
PRIORITYMAIN
PRIORITYSUB
211
24 - SELECT PRIORITY
Recommended Syntax
%MACRO=24=..=Select Priority
Note that this is a 4 Axis Turning Macro.
System Variables Modified System Variable
SUBFUNCT
212
Depth of Cut
FEED
Feedrate
FIELD2
Link Type:
1 = Rapid move
2 = Feed move
FIELD7
FIELD8
FIELD9
FIELD10
Corner Type
0 = Round corners
1 = Square corners
SPEED
Spindle Speed
STCOMMAND
SUBFUNCT
XEND
ZEND
213
Depth of Cut
FEED
Feedrate
FIELD2
Link Type:
1 = Rapid move
2 = Feed move
FIELD7
FIELD8
FIELD9
Billet selection:
0 = Start point specified by current tool position
1 = Billet specified by digitised position
(co-ordinates held in fields 7 & 8)
2 = Geometric or toolpath billet selected
FIELD10
Corner Type
0 = Round corners
1 = Square corners
NEXTXMOVE
NEXTZMOVE
OFFSETX
OFFSETZ
SPEED
Spindle Speed
STCOMMAND
SUBFUNCT
Drive Condition
XEND
XSTART
ZEND
ZSTART
214
Depth of Cut
ENCOMMAND
Z Lead Value
FEED
Feedrate
FIELD2
Link Type:
1 = Rapid move
2 = Feed move
FIELD7
FIELD8
FIELD9
Billet selection:
0 = Start point specified by current tool position
1 = Billet specified by digitised position
(co-ordinates held in fields 7 & 8)
2 = Geometric or toolpath billet selected
FIELD10
Corner Type
0 = Round corners
1 = Square corners
SPEED
Spindle Speed
SUBFUNCT
XEND
ZEND
ZMOVE
Z Axis Motion
215
Depth of Cut
ENCOMMAND
Z Lead Value
FEED
Feedrate
FIELD2
Link Type:
1 = Rapid move
2 = Feed move
FIELD7
FIELD8
FIELD9
Billet selection:
0 = Start point specified by current tool position
1 = Billet specified by digitised position
(co-ordinates held in fields 7 & 8)
2 = Geometric or toolpath billet selected
FIELD10
Corner Type
0 = Round corners
1 = Square corners
NEXTXMOVE
NEXTZMOVE
OFFSETX
OFFSETZ
SPEED
Spindle Speed
SUBFUNCT
Drive Condition
XEND
XSTART
ZEND
ZSTART
216
29 - RADIUSCOMP
Recommended Syntax
%MACRO=29=..=Compensation
System Variables Modified System Variable Description
SUBFUNCT
1 = Compensation Off
2 = Compensation Left
3 = Compensation Right
4 = Pathcomp
217
32 - TRANSLATE
Recommended Syntax
%MACRO=32=..=Translate=45,23,14,26,37,21,
System Variables Modified System Variable Description
ENDSUB
PATHTRACE
Output Mode
REPEAT
Number Of Repeats
STARTSUB
SUBROUTINE
Subroutine Number
XINC
Z Translation Value
XSUB
YINC
X Translation Value
YSUB
XCURRENTPOS
ZCURRENTPOS
XEND
YEND
218
36 - TECHNOLOGY
Recommended Syntax
%MACRO=36=..=Technology=85,
219
40 - MOVE HOME
Recommended Syntax
%MACRO=40=..=Move Home=
System Variables Modified System Variable Description
FIELD1
FIELD2
FIELD3
FIELD4
Axis priority
0 = No priority
1 = X move first
2 = Y move first (only for Y Axis machines)
3 = Z move first
220
41 - MOVE TOOLCHANGE
Recommended Syntax
%MACRO=41=..=Move Toolchange
System Variables Modified System Variable Description
FIELD1
FIELD2
FIELD3
FIELD4
Axis priority
0 = No priority
1 = X move first
2 = Y move first (only for Y Axis machines)
3 = Z move first
221
51 - START
Recommended Syntax
%MACRO=51=..=START System Macro
System Variables
Modified
UNIT
0 = Inches
1 = Millimetres
JOBDESC
JOBCOM
JOBFAM
JOBMACH
JOBCUST
JOBPROG
JOBMATL
JOBREV
APPEND = #
CIRCLE = 1 or 0
DATE
String variable containing date at code generation time, using the format MM/DD/YY
CUSTOMERNAME
SERVERCODE
UKDATE
String variable containing date at code generation time, using the format DD/MM/YY
DAY.MONTH.YEAR
Numeric variables that allow you to format the date according to your requirements
ENDSUB = 0
MACHINENAME
MILLMODE
0 = Rotary, 1 = Planar
NUMBLOCKS = #
NUMCHARS = #
PARTNAME
SEQUENCENAME
STARTSUB = 0
TIME
XSUB/YSUB/ZSUB
222
There are also variables which indicate how the part is loaded into the spindle, and how the transfer to the SubSpindle takes place. These variables are applicable to Advanced Turn Code Generator files only:
PARTLENGTH
Part Length
MAINPARTSTICKOUT
SUBPARTSTICKOUT
MCSUBDATUMY
MCSUBDATUMZ
DOCKGRIPZ
Grip Position for Sub Spindle transfer (relative to Main Spindle CPL)
MAINSAFEZ
SUBSAFEZ
PRIORITYMAIN
PRIORITYSUB
223
53 - CLW
Recommended Syntax
%MACRO=53=..=CLW System Macro
System Variables
Modified
ENDANGLE
The end angle of the arc (always positive and less than
STARTANGLE)
INCANGLE
STARTANGLE
RADIUS
Radius of Arc
XCENTRE
XEND
XSTART
XYPLANE
YCENTRE
YEND
YSTART
ZCENTRE
ZEND
ZSTART
224
54 - CCLW
Recommended Syntax
%MACRO=54=..=CCLW System Macro
System Variables
Modified
ENDANGLE
The end angle of the arc (always positive and greater than
STARTANGLE)
INCANGLE
STARTANGLE
RADIUS
Radius of Arc
XCENTRE
XEND
XSTART
XYPLANE
YCENTRE
YEND
YSTART
ZCENTRE
ZEND
ZSTART
225
55 - SUBSTART
Recommended Syntax
%MACRO=55=..=SUBSTART System Macro
System Variables Modified System Variable Description
SUBROUTINE
Subroutine Number
Edgecam regards the start of subroutines as the END of the first move after the label. In this macro the
coordinates of this move are stored in NEXTXMOVE, NEXTYMOVE, NEXTZMOVE. It is from this point that
incremental moves in a subroutine should be calculated.
226
56 - SUBEND
Recommended Syntax
%MACRO=56=..=SUBEND System Macro
System Variables Modified System Variable Description
SUBROUTINE
Subroutine Number
227
58 - END
Recommended Syntax
%MACRO=58=..=END System Macro
System Variables Modified
JOBDESC
JOBCOM
JOBFAM
JOBMACH
JOBCUST
JOBPROG
JOBMATL
JOBREV
228
59 - SUBCALL
Recommended Syntax
%MACRO=59=..=SUBCALL System Macro
System Variables Modified System Variable Description
SUBROUTINE
Subroutine Number
Edgecam regards the start of subroutines as the END of the first move after the label. In this macro the
coordinates of the move are stored in NEXTXMOVE, NEXTYMOVE, NEXTZMOVE and any positioning block
should be to that point except in the case of hole cycle position subroutines.
229
60 - RESET
Recommended Syntax
%MACRO=60=..=RESET System Macro
System Variables Modified System Variable Description
PATHTRACE
0 = Controller Subroutines
1 = Subroutines expanded within Edgecam
SUBFUNCT
1 = Translate
2 = Rotate
3 = Mirror
230
61 - CYCLSUB
Recommended Syntax
%MACRO=61=..=CYCLSUB System Macro
231
71 - ATTRIBUTE
Recommended Syntax
%MACRO=71=..=ATTRIBUTE System Macro
System Variables Modified
SUBFUNCT
Attribute type:
2 = True position (Edgecam 5 Axis extension only)
3 = Secondary feed rate
(XYFEED is also set up in MILL)
(FEED is set up in TURN)
232
System Variables
Modified
SPINDLE
INDEXID
GROUPDESCRIPTION
Spindle Name
XINC(1)
YINC
ZINC
XSUB (2)
YSUB
ZSUB
SUBFUNCT
Use the %GETCPL directive with Subfunct to get information relating to the datum of the selected spindle. The
variable SPINDLE gives the ID of the selected spindle - this value can be tested against SPINDLEID1 and
SPINDLEID2 to determine which spindle has been selected.
(1) The system variables XINC, YINC and ZINC (not #XINC etc) contain the current CPL position in Initial CPL
coordinates.
(2) The system variables XSUB, YSUB and ZSUB (not #XSUB etc) contain the current position from world
origin, in current coordinates
233
DIRECTION
Spindle Direction
GEAR
MAXRPM
CSS
A new gear access array GEAR() allows Gear Definition from the %MACHINE statement to be accessed and
will give information for the currently selected spindle (or driven tool).
After use of the instruction #TEMP=GEAR(0) the number of gear ranges defined for the gear range for the
current spindle is available.
NUMGEARS Number of gear ranges defined
For any gear range further variables can then be made available by use of GEAR(NUM) where NUM is the
range number. NUM must be a positive integer between 1 and NUMGEARS inclusive.
GEARMINRPM Minimum RPM available in that gear
GEARMAXRPM Maximum RPM available in that gear
GEARUSERMAXRPM User Maximum RPM
If the GEAR required is specified by the value in GEAR then these last variables can be accessed directly
using #TEMP=GEAR(GEAR).
234
STRATEGY
FEED
SPEED
DWELL
CMOVE
WMOVE
ZAPPROACH
XAPPROACH
DOCKGRIPZ
FIELD1
FIELD2
Generally the will be 3 separate strategies for Docking (Running, Static and Pick & Return for piece parts).
These will usually be arranged through 3 matching code constructors. The actions are code generator
dependant according to the content of the Code Constructors.
Note that the X coordinate will be zero and that only movement in Z is implemented.
If spindle synchronisation is required then this must be included in the code constructor. If the spindle
synchronization has to be coordinated across both turrets as for MoriSeiki (Fanuc) controls then it will be
necessary to add the appropriate instructions to the Edgecam sequences before coding the Docking.
For example:
Back Turret
Front Turret
Turret Synch
Turret Synch
Turret Synch
Turret Synch
Docking
Turret Synch
Turret Synch
235
STRATEGY
FEED
SPEED
DWELL
CMOVE
WMOVE
ZAPPROACH
XAPPROACH
DOCKGRIPZ
FIELD1
FIELD2
Generally the will be 3 separate strategies for Docking (Running, Static and Pick & Return for piece parts).
These will usually be arranged through 3 matching code constructors. The actions are code generator
dependant according to the content of the Code Constructors.
Note that the X coordinate will be zero and that only movement in Z is implemented.
If spindle synchronisation is required then this must be included in the code constructor. If the spindle
synchronization has to be coordinated across both turrets as for MoriSeiki (Fanuc) controls then it will be
necessary to add the appropriate instructions to the Edgecam sequences before coding the Docking.
For example:
Back Turret
Front Turret
Turret Synch
Turret Synch
Turret Synch
Turret Synch
Docking
Turret Synch
Turret Synch
236
FEED
SPEED
Spindle Speed
DWELL
OFFSETZ
Z position adjustment
FIELD2
FIELD1
ZEND
XEND
If the return to Home box has been checked in Edgecam then Field1 will be set to 1 and XEND,ZEND will not
be set.
The X coordinate will be zero and that only movement in Z is implemented.
237
FEED
SPEED
Spindle Speed
DWELL
OFFSETZ
Z position adjustment
FIELD2
FIELD1
ZEND
XEND
If the return to Home box has been checked in Edgecam then Field1 will be set to 1 and XEND,ZEND will not
be set.
The X coordinate will be zero and that only movement in Z is implemented.
238
FEED
SPEED
DWELL
Dwell time
STRATEGY
ZAPPROACH
XAPPROACH
ZSTART
XSTART
ZEND
XEND
The action is code generator dependant but generally the expected result is to rapid move to
XAPPROACH,ZAPPROACH and then feed to contact with the bar at XSTART, ZSTART. The chuck will then
be opened and a feed move made to XEND,ZEND where the chuck will close. The following 3 macros were
previously in the User Defined group and have now been changed to Edgecam executive macros.
239
257 - Chuck
%MACRO=257=..=Chuck=
System Variables
Modified
FIELD 1
240
FIELD 1
FIELD 2
1=Eject Part
241
259 - Tailstock
%MACRO=259=..=Tailstock=
System Variables
Modified
FIELD 1
FIELD 2
1 = Quil
242
System Variable
Modified
FIELD1
FIELD2
ZEND
End position
FEED
SPEED
243
244
245
CAXIS
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
2 = Radial Machining
The following macro definitions assign a value to CAXIS (therefore the variable should not be assigned by the
user):
%MACRO=43=AX/RD=Axial/Radial C-axis machining=
(And 193)
%MACRO=45=..=Move Angular=5,6,7,
%MACRO=253=..=Lathe Index=..
%MACRO=165=..=Tool Change=..
These values are maintained while processing for reference by the code generator file.
CAXIS can be tested and conditional actions can be executed.
246
Y Axis
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.
%IF SUBFUNCT=1 %THEN #YAXIS=1 %ELSE #YAXIS=0
247
%CXCYCLE
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 co-ordinate
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,
%IF CAXIS=1 %THEN %CXCYCLE %ELSE %NOCYCLE
%ENDM
In the above example, redirection to the macro definition CX.OUTPUT will only occur when set to Axial mode.
It is also important to understand the consequence of %NOCYCLE when encountered in C/Y Axis mode.
Redirection will occur through macros 1 and 2, and it is therefore necessary to test the system variable CAXIS
in macros 1 and 2 which must call a user-defined procedure to effect axis output.
If the Code Generator does not require %CXCYCLE, 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.
supported when using CXCYCLE in Axial Turning.
248
Arc Motion
CSTART
RSTART
CCENTRE
RCENTRE
CEND
REND
249
250
251
38 - ROTARY ROTATE
Recommended Syntax
%MACRO=38=..=Rotary Rotate=1,2,14,26,24,37,
Only supports the %NOCYCLE directive.
252
SUBFUNCT
Assigned as Selected
This macro is called following a toolchange between either fixed and driven tooling or between axially and
radially loaded tooling.
253
Assigned as Selected
0 = Rotary, Z X & C interpolation
1 = Planar, Z X & Y interpolation
254
45 - MOVE ANGULAR
Recommended Syntax
%MACRO=45=..=Move Angular=5,6,7,59,
Re-direction MUST occur using the %NOCYCLE command.
System Variables Modified System Variable Description
AMOVE
BMOVE
CMOVE
FEED
RMOVE
ROT1
Angular position
SPEED
ZFEED
255
Rotary axis
ROT1
Both ROT1 and CMOVE will be updated with the new angular position obtained from this command.
256
53 - CLW
Recommended Syntax
%MACRO=53=..=CLW System Macro
System Variables Modified System Variable Description
RADIUS
Radius of Arc
XCENTRE
XEND
XSTART
XYPLANE
ZCENTRE
ZEND
ZSTART
257
54 - CCLW
Recommended Syntax
%MACRO=54=..=CCLW System Macro
System Variables Modified System Variable Description
RADIUS
Radius of Arc
XCENTRE
XEND
XSTART
XYPLANE
ZCENTRE
ZEND
ZSTART
258
66 - CX.OUTPUT
Recommended Syntax
%MACRO=66=..=CX.OUTPUT
System Variables Modified
CMOVE
C Axis Motion
RMOVE
Radial Motion
ROT1
SUBFUNCT
1 = Rapid Motion
2 = Feedrate Linear Motion
3 = Feedrate Arc Motion
259
69 - ANGCLW
Recommended Syntax
%MACRO=69=..=ANGCLW
This macro handles the output of radially machined arcs in rotary mode.
System Variables Modified System Variable Description
CEND
C Arc End
CIRCLE
0=Multi-quadrant arcs
1=Single-quadrant arcs
CSTART / CCENTRE
C Arc Coords
RADIUS
Radius of Arc
Angular position
WRAPRADIUS
XEND
XSTART / XCENTRE
X Arc Coords
ZEND
Z Arc End
ZSTART / ZCENTRE
Z Arc Coords
This macro will only be visited if wrapped geometry is machined at the depth at which the original geometry
was wrapped, or switch 17 on the MM line has been set to 1 (see Rotary Output Mode)
260
70 - ANGCCLW
Recommended Syntax
%MACRO=70=..=ANGCCLW
This macro handles the output of radially machined arcs in rotary mode.
System Variables Modified System Variable Description
CEND
C Arc End
CIRCLE
0=Multi-quadrant arcs
1=Single-quadrant arcs
CSTART / CCENTRE
C Arc Coords
RADIUS
Radius of Arc
Angular position
WRAPRADIUS
XEND
XSTART / XCENTRE
X Arc Coords
ZEND
Z Arc End
ZSTART / ZCENTRE
Z Arc Coords
This macro will only be visited if wrapped geometry is machined at the depth at which the original geometry
was wrapped, or switch 17 on the MM line has been set to 1 (see Rotary Output Mode)
261
262
Z Axis Feedrate
SPEED
Spindle Speed
Redirection must occur by using the %NOCYCLE command. Axis output is then effected by testing the
system variable CAXIS within the FEED macro (2) and finally calling a procedure.
263
Feedrate in XY Plane
SPEED
Spindle Speed
264
Axis Feedrate
SPEED
Spindle Speed
TOTDEPTH
Total Depth
ZFEED
Z Axis Feedrate
265
Axis Feedrate
SPEED
Spindle Speed
TOTDEPTH
Total Depth
ZFEED
Z Axis Feedrate
266
Axis Feedrate
SPEED
Spindle Speed
TOTDEPTH
Total Depth
ZFEED
Z Axis Feedrate
267
Offset Value
SPEED
Spindle Speed
STEP
XYFEED
XY Plane Feed
ZDEPTH
Z Height of Cut
ZFEED
Z Axis Feed
268
Depth of Peck
DRILLSUB
Subroutine indicator
0 = Longhand code
1 = Subroutines present
DWELL
Dwell in Seconds
FEED
Feedrate
LAST
Number of Points
PATHTRACE
RPLANE
Retract Plane
SPEED
Spindle Speed
TOTDEPTH
XPOINT(#)
X Axis Point*
YPOINT(#)
Y Axis Point*
ZCLEAR
Z Clearance Plane
ZFEED
Z Axis Feed
269
Depth of Peck
DRILLSUB
Subroutine indicator
0 = Longhand code
1 = Subroutines present
DWELL
Dwell in Seconds
FEED
Feedrate
LAST
Number of Points
MRPLANE(#)
MZDEPTH(#)
PATHTRACE
RPLANE
Retract Plane
SPEED
Spindle Speed
TOTDEPTH
XPOINT(#)
X Axis Point*
YPOINT(#)
Y Axis Point*
ZCLEAR
Z Clearance Plane
ZFEED
Z Axis Feed
ZLEVEL
270
Subroutine indicator
0 = Longhand code
1 = Subroutines present
LAST
Number of Points
MRPLANE(#)
MZDEPTH(#)
PATHTRACE
RPLANE
Retract Plane
SPEED
Spindle Speed
TOTDEPTH
XPOINT(#)
X Axis Point*
YPOINT(#)
Y Axis Point*
ZCLEAR
Z Clearance Plane
ZFEED
Z Axis Feed
ZLEVEL
271
Subroutine indicator
0 = Longhand code
1 = Subroutines present
FEED
Feedrate
LAST
Number of Points
MRPLANE(#)
MZDEPTH(#)
PATHTRACE
RPLANE
Retract Plane
SPEED
Spindle Speed
TOTDEPTH
XPOINT(#)
X Axis Point*
YPOINT(#)
Y Axis Point*
ZCLEAR
Z Clearance Plane
ZFEED
Z Axis Feed
ZLEVEL
272
Subroutine indicator
0 = Longhand code
1 = Subroutines present
LAST
Number of Points
PATHTRACE
RPLANE
Retract Plane
SPEED
Spindle Speed
TOTDEPTH
XPOINT(#)
X Axis Point*
YPOINT(#)
Y Axis Point*
ZCLEAR
Z Clearance Plane
ZFEED
Z Axis Feed
273
Axis Feedrate
SPEED
Spindle Speed
274
165 - TOOLCHANGE
Recommended Syntax
%MACRO=165=..=Toolchange=8,12,80,48,
These system variables are available following a %LOAD call for the current tool number. The current tool
number is the value of SUBFUNCT.
When indexing with driven tooling, the variables BMOVE and CMOVE give the requested orientation after
toolchange.
System Variables Modified
CMT1
CSS
CORNERRAD
DIRECTION
FEEDTYPE
FLUTELENGTH
Flute Length
GEAR
Gear
GROUP
GROUPSTRING
GROUPNUMBER
ID
IDSTRING
IDNUMBER
MAINTAININDEX
MAXRPM
POSITION
Turret Number
275
STRTSTOREUSER1
STRTSTOREUSER2
SUBFUNCT
THROUGHCOOLANT
TOOLOFFSET
TSTOREUSER1
TSTOREUSER2
TOOLDESCRIPTION
Toolname
TOOLEN
TOOLNUM
TOOLRAD
Tool Radius
TOOLTYPE
The quadrant containing the tool and the permitted tool type
0 = 090 degrees (Thread)
1 = 135 degrees (Thread, Back Turn)
2 = 180 degrees
3 = 225 degrees (Back Bore)
4 = 270 degrees
5 = 315 degrees (Bore)
6 = 000 degrees (Drill)
7 = 045 degrees (Thread, Turn)
TOOLXSET
Y Gauge Length
TOOLZSET
Z Gauge Length
USERDEFINEDSTRING
Comment
XBPIVOTLENGTH,
ZBPIVOTLENGTH
XSCRATCH, YSCRATCH,
ZSCRATCH
Note: Tool Offset is now the system variable TOOLOFFSET. The modifier 12 must be defined on the macro
line to display and use this new system variable to retain compatibility with existing posts. This method of
setting tool offset replaces the use of user vars.
276
Assigned as Selected
1 = Upper turret
2 = Lower Turret
277
172 - DWELL
Recommended Syntax
%MACRO=172=..=Dwell=27,
System Variables Modified System Variable Description
DWELL
Dwell in Seconds
278
182 - TRANSLATE
Recommended Syntax
%MACRO=182=..=Translate=43,44,45,14,26,37,21,
System Variables Modified
PATHTRACE
REPEAT
Number of Repeats
SUBROUTINE
Subroutine Number
XINC
X Translation Value
XSUB
YINC
Y Translation Value
YSUB
ZINC
Z Translation Value
ZSUB
279
186 - TECHNOLOGY
Recommended Syntax
%MACRO=186=..=Technology
280
Field 1
Clearance
Field 2
Retract
Field 3
Diameter
Field 4
Level
Field 5
Depth of Thread
Field 6
Pitch
This macro will either set up the data array for machines which are capable of helical interpolation, or direct the
output through %NOCYCLE. If the user selects 'canned cycle' processing takes place using the array
described below, otherwise output is via RAPID and FEED macros.
Pathtrace
0 = Helical interpolation
1 = Pathtrace expansion to linear moves (use NOCYCLE
command)
For machines which are capable of helical interpolation the following applies:
The System variable XPOINT(#) must be tested for the type of movement being output.
LAST
XPOINT(#)
0 = Rapid
1 = Feed
2 = Clockwise direction arc
3 = Counterclockwise direction arc
4 = Clockwise direction helical arc
5 = Counterclockwise direction helical arc
281
Rapid
Feed
CLW
CCLW
Helical CLW
Helical CCLW
Element
XPOINT(#)
YPOINT(#)
RADIUS(#)
Feedrate
X Destination
Y Destination
Z Destination
Feedrate
X Destination
Y Destination
Z Destination
Feedrate
X Centre
Y Centre
Radius
X Destination
Y Destination
Not used
Feedrate
X Centre
Y Centre
Radius
X Destination
Y Destination
Not used
Feedrate
X Centre
Y Centre
Not used
X Destination
Y Destination
Z Destination
Start Radius
End Radius
Not used
Feedrate
X Centre
Y Centre
Not used
X Destination
Y Destination
Z Destination
Start Radius
End Radius
Not used
Field 1
Clearance
Field 2
Retract
Field 3
Diameter
Field 4
Level
Field 5
Depth of Thread
Field 6
Pitch
282
FIELD1
FIELD2
FIELD3
FIELD4
Axis priority
0 = No priority
1 = X move first
2 = Y move first
3 = Z move first
283
FIELD2
FIELD3
FIELD4
Axis priority
0 = No priority
1 = X move first
2 = Y move first
3 = Z move first
284
SUBFUNCT
Assigned as Selected
285
Move type
1 = Feed
0 = Rapid
SPEED
XYFEED
286
Move type
1 = Feed
0 = Rapid
SPEED
XYFEED
287
SUBFUNCT
BMOVE (ROT1)
Baxis angle
CMOVE (ROT2)
XINC(1)
YINC
ZINC
XSUB (2)
YSUB
ZSUB
XSUBTURN (3)
YSUBTURN
ZSUBTURN
XCPL, YCPL, ZCPL
The B-axis indexing macro uses %GETCPL to get information relating to the new B-axis Datum. The Angles
are setup in ROT1,ROT2 as has historically been the case with %GETCPL - however to make things easier the
variables BMOVE and CMOVE are set up as well (this also applies for CY Milling).
(1) The system variables XINC, YINC and ZINC (not #XINC etc) contain the current CPL position in Initial CPL
coordinates.
(2) The system variables XSUB, YSUB and ZSUB (not #XSUB etc) contain the current position from world
origin, in current coordinates.
(3) The system variables XSUBTURN, YSUBTURN, ZSUBTURN contain the distances from the CPL turn
origin (or currently selected Spindle) to the origin of the new Coordinate system. Any C rotation is discounted,
with so the values are calculated as if the component was rotated to C0.
288
Wire Notes
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:
1.
2.
3.
4.
Header block.
Block for the XY entity.
Block for the UV entity.
Block of expanded data required for longhand output.
The array is loaded from element one through to the value indicated by the system variable LAST.
Guide height values are only applied to longhand output. Code Generators working at guide heights should
have taper mode disabled and 4-axis circular arcs should be converted to linear moves.
289
Procedure: GETHEADER
Index
XPOINT()
YPOINT()
ZPOINT()
#XYSTARTBEAR
#XYENDBEAR
#UVSTARTBEAR
#UVENDBEAR
#STARTLEAD
#ENDLEAD
#STARTSIDE
#ENDSIDE
#XYUVPAIRS
#XYELEMENT
#UVELEMENT
#TYPE
#XYNEXTSTARTBEAR
Not used
#UVNEXTSTARTBEAR
See below
#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.
The four entities are POINT, LINE, ARC, and CONIC (not arc). The user defined variable #TYPE is set up to
identify which type of link is occurring:
#TYPE
XY
UV
Line
16
Point
32
Arc
64
Conic
128
290
When TYPE is checked, an internal procedure to handle this case can be called. Within this procedure, a
check is made to determine whether to use long hand output or cycle output.
291
Procedure : XYLINE
Index
XPOINT()
YPOINT()
ZPOINT()
#XSTART
#YSTART
#ZSTART
X start of line
Y start of line
Z start of line
#XEND
#YEND
#ZEND
X end of line
Y end of line
X end of line
Procedure : UVLINE
Index
XPOINT()
YPOINT()
ZPOINT()
#USTART
#VSTART
#WSTART
U start of line
V start of line
W start of line
#UEND
#VEND
#WEND
U end of line
V end of line
W end of line
Procedure : XYARC
Index
XPOINT()
YPOINT()
ZPOINT()
#XCENTRE
#YCENTRE
#XYRADIUS
X centre of arc
Y centre of arc
Radius
#XEND
#YEND
Not used
X end of arc
Y end of arc
XYARCSTARTANGLE
#XYARCENDANGLE
#XYELLIPENDARC
292
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
Index
XPOINT()
YPOINT()
ZPOINT()
#XPOINT
#YPOINT
#ZPOINT
X point
Y point
Z point
Procedure : UVPOINT
Index
XPOINT()
YPOINT()
ZPOINT()
#UPOINT
#VPOINT
#WPOINT
U point
V point
W point
At this point all applicable user defined variables are now initialised. Therefore in the example under Array
Structure where #TYPE = 33 we would call the procedures XYLINE and UVPOINT.
Other procedures used in WIREDATA.MAC are:
%PROCEDURE = CALC_ARC_CORNER
This calculates the corner point on a blend radius between two lines and the start point of an arc.
293
294
XPOINT()
YPOINT()
ZPOINT()
#XEND
#YEND
#ZEND
#UEND
#VEND
#WEND
All link types which include conics should be forced to be long hand code, using an internal procedure
LONG_HAND. This procedure in turn calls the external procedure GET_PAIR to process the expanded links.
295
296
297
1 - MOVE RAPID
Recommended Syntax
%MACRO=1=..=Rapid Move=
System Variables Modified
XMOVE
X Axis Motion
YMOVE
Y Axis Motion
298
2 - MOVE FEED
Recommended Syntax
%MACRO=2=..=Feed Move=5,
System Variables Modified
FIELD 12
SUBFUNCT
XMOVE
X Axis Motion
XYFEED
XY Axis Feed
YMOVE
Y Axis Motion
299
3 - MOVE ARC
Recommended Syntax
%MACRO=3=..=Circular Feed Move=5,
System Variables Modified
RADIUS
Radius of Arc
XCENTRE
X Centre of Arc
XEND
X Arc End
XSTART
X Arc Start
XYFEED
XY Axis Feed
YCENTRE
Y Centre of Arc
YEND
Y Arc End
YSTART
Y Arc Start
300
5 - 2D PROFILE
Recommended Syntax
%MACRO=5=..=2D Profile=4,5,12,13,21,24,25,
System Variables Modified
NONE
This cycle only supports %NOCYCLE. This means that the wire moves are redirected to the Feed (macro 2),
Rapid (macro 1), CLW (macro 53) and CCLW (macro 54) macros. Provision will have to made within the
redirected macros CLW and CCLW for control of the CNC code.
The syntax for the macro is:
%MACRO=5=..=2D Profile=4,5,12,13,21,24,25,
%NOCYCLE
%ENDM
301
6 - 2D DESTRUCT
Recommended Syntax
%MACRO=6=..=2D Destruct=4,5,12,16,
System Variables Modified
NONE
This cycle only supports %NOCYCLE. This means that the wire moves are redirected to the Feed (macro 2),
Rapid (macro 1), CLW (macro 53) and CCLW(macro 54) macros. Provision will have to made within the
redirected macros CLW and CCLW for control of the CNC code.
The syntax for the macro is:
%MACRO=6=..=2D Destruct=4,5,12,16,
%NOCYCLE
%ENDM
302
15 - MACHINING CONDITIONS
Recommended Syntax
%MACRO=15=..=Machining Conditions=47,170,171,
System Variables Modified
LOWERWIRE
Lower guide
UPPERWIRE
Upper guide
WIREDIAM
Wire Diameter
303
17 - MACHINE DESIGN
Recommended Syntax
%MACRO=17=..=Machine Design=5,12,21,47,101,177,
System Variables Modified
COMP
FIELD1
Lead in Angle
FEILD2
Lead in Radius
FIELD3
Lead in Length
FIELD4
Lead in Angle
FIELD5
Lead in Radius
FIELD6
FIELD7
Stop Size
FIELD8
Constant Cut
FPASS
Number of Passes
LACECUT
Constant cut
LAST
OFFSET
Offset amount
PATHTRACE
Pathtrace Compensation
SUBFUNCT
Design Type
4 = Link Profile
5 = Taper Profile
6 = Transform Profile
TOLERANCE
Tolerance
XPOINT()
XYFEED
XY Axis Feed
YPOINT()
Variable
ZPOINT()
Variable
304
22 - DWELL
Recommended Syntax
%MACRO=22=..=DWELL=27,
System Variables Modified
DWELL
305
COMP
FIELD1
Lead in Angle
FIELD2
Lead in Radius
FIELD3
Lead in Length
FIELD4
Lead in Angle
FIELD5
Lead in Radius
FIELD6
OFFSET
Offset amount
PATHTRACE
Pathtrace Compensation
SUBFUNCT
Design type
4 = Link Profile
5 = Taper Profile
6 = Transformed Profile
TOLERANCE
Tolerance
XYFEED
XY Axis Feed
306
29 - COMPENSATION
Recommended Syntax
%MACRO=29=..=Compensation=
System Variables Modified
COMP
Assigned as selected:
1 = None
2 = Left
3 = Right
307
32 - TRANSLATE
Recommended Syntax
%MACRO=32=..=Translate=43,44,14,26,37,21,
System Variables Modified
PATHTRACE
REPEAT
Number of Repeats
SUBROUTINE
Subroutine Number
XINC
X Translation Value
YINC
Y Translation Value
308
33 - ROTATE
Recommended Syntax
%MACRO=33=..=Rotate=1,2,14,26,24,37,21,
System Variables Modified
ANGLE
Angle of Rotation
PATHTRACE
REPEAT
Number of Repeats
SUBROUTINE
Subroutine Number
XCENTRE
X Coord of Rotation
XSUB
YCENTRE
Y Coord of Rotation
YSUB
309
34 - MIRROR
Recommended Syntax
%MACRO=34=..=Mirror=1,2,14,26,21,
System Variables Modified
PATHTRACE
SUBROUTINE
Subroutine Number
XEND
XSTART
XSUB
YEND
YSTART
YSUB
310
40 - MOVE HOME
Recommended Syntax
%MACRO=40=..=Rapid To Wire Home=
System Variables Modified
XHOME
X Axis Motion
YHOME
Y Axis Motion
311
51 - START
Recommended Syntax
%MACRO=51=..=START System Macro
System Variables
Modified
LOWERWIRE
UNIT
0 = Inches
1 = Millimetres
UPPERWIRE
UVPLANE
XYPLANE
CUSTOMERNAME
SERVERCODE
Pseudo Systems
APPEND = #
CIRCLE = [1/0]
DATE
String variable containing date at code generation time, using the format MM/DD/YY
UKDATE
String variable containing date at code generation time, using the format DD/MM/YY
DAY.MONTH.YEAR
Numeric variables that allow you to format the date according to your requirements
ENDSUB = 0
MACHINENAME
MACRONAMEOP=0
MACRONAMEOP=1
MACRONAMEOP=2
NUMBLOCKS = #
NUMCHARS = #
PARTNAME
SEQUENCENAME
STARTSUB = 0
TIME
312
53 - CLW
Recommended Syntax
%MACRO=53=..=CLW System Macro
FIELD 12
SUBFUNCT
313
54 - CCLW
Recommended Syntax
%MACRO=54=..=CCLW System Macro
FIELD 12
SUBFUNCT
314
55 - SUBSTART
Recommended Syntax
%MACRO=55=..=SUBSTART System Macro
System Variables Modified
SUBROUTINE
Subroutine Number
315
56 - SUBEND
Recommended Syntax
%MACRO=56=..=SUBEND System Macro
System Variables Modified
SUBROUTINE
Subroutine Number
316
58 - END
Recommended Syntax
%MACRO=58=..=END System Macro
317
59 - SUBCALL
Recommended Syntax
%MACRO=59=..=SUBCALL System Macro
System Variables Modified
SUBROUTINE
Subroutine Number
318
60 - RESET
Recommended Syntax
%MACRO=60=..=RESET System Macro
System Variables Modified
PATHTRACE
0 = Controller Subroutines
1 = Subroutines expanded within Edgecam
SUBFUNCT
1 = Translate
2 = Rotate
3 = Mirror
319
This option is applicable to the Code Generator Compiler only, and will be greyed out if you do not have a
licence.
Exit - Returns to the previous application.
320
321
Enter a different name for the compiled Code Generator file. If this option is not selected, the source filename
will be used by default.