Documente Academic
Documente Profesional
Documente Cultură
ELECTRON
Si n ce 1977 H i - Tech
f o r t h e Mach i n e - To o l
CNC
Z32
PROGRAMMING MANUAL
MILLING MACHINES
AND
MACHINING CENTRES APPLICATION
DOCUMENT M96 GB
C6 - 7.6.06
The information contained herein has been carefully checked for accuracy and reliability, however, D. Electron accepts no responsibility
whatsoever for any inaccuracies. D. Electron reserves the right to carry out whatever changes it considers expedient to improve the
performance or reliability of its products.
D. ELECTRON - Via R. Giuliani, 140, 50141 FIRENZE - Tel. (055)412113-411792 - Fax (055)434220
Contents CNC Z32 Programming Manual
CONTENTS
D. ELECTRON i
CNC Z32 Programming Manual Contents
ii
D. ELECTRON
Contents CNC Z32 Programming Manual
D. ELECTRON iii
CNC Z32 Programming Manual Contents
5.3 CONDITIONING...........................................................................................................................................................135
iv
D. ELECTRON
Contents CNC Z32 Programming Manual
7.4 EXAMPLES....................................................................................................................................................................220
D. ELECTRON v
CNC Z32 Programming Manual Contents
vi
D. ELECTRON
Contents CNC Z32 Programming Manual
11.3 TRASLATION............................................................................................................................................................284
11.3.1 Axes movements and traslation ............................................................................................................................284
D. ELECTRON vii
CNC Z32 Programming Manual Contents
viii
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 – Files organization and structures
CHAPTER 1
1.1 INTRODUCTION
CHARACTERS 'O' and '0'
Letter 'O' and number zero '0' are so similar that even a skilled programmer may confuse them;
however, we must remember that the machine codes of these two characters are different and the
CNC do (and MUST) distinguish between them.
Therefore, please remember:
O => alphabetical letter 'O'
0 => number zero
IMPORTANT NOTE
Z32 is a numerical control with extremely open programming and structure. This manual
provides technical details of the CNC, especially in reference to milling machines and machining
centers, but does not describe specific installations.
To configure the machine the manufacturer of the machine tool installs subprograms, special
cycles, PLC and calibration programs that influence the performance and behaviour of the Z32.
Please consult with care the information supplied by the manufacturer.
D. ELECTRON 1
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The last performance includes all the operations that allow the computer to know the operations
requested by the operator and consequently to calculate the values and the movements of the
axes, the machine functions to be performed, etc.
Various types of operations can be requested: one of the most important is to machine a part
with the program already loaded in the memory of the Z32.
The purpose of this handbook is to describe the instructions the Z32 will accept, inside a
program to be executed automatically.
PROCESS 0 1 2 3 4 5
PARAMETER TABLE 125 122 119 116 113 110
ORIGIN TABLE 126 123 120 117 114 111
TOOL TABLE 127 124 121 118 115 112
BASE ORIGIN TABLE 237 236 235 234 233 232
The files are accessible through editor activity (for modification or creation of files, please refer
to the user manual). They can be copied from the hard disk to floppy disk and vice versa, or sent to
external peripherals or loaded from external peripherals using the various methods with which Z32
communicates through the serial ports or through Ethernet network (see specific manuals).
2
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 – Files organization and structures
Important note for the execution of disk residing part-programs, for WinTerm and ZTerm user
interfaces:
When a part-program residing on disk is greater then 64KB, the program is executed directly
from the disk in DNC mode. For this reason, depending an the actual implementation, the user
interface may automatically create a "launcher” file, calling the file to be executed in DNC mode.
Part programs smaller then 64KB are copied to the Z32 CMOS memory, and executed from the
CMOS (all necessary operations are automatically executed by the interface, completely
transparent to the operator).
CMOS files used by the user interface to create launcher programs (for files larger than 64kB),
or for the CMOS copy (programs smaller than 64kB), have the following default:
PROCESS 0 1 2 3 4 5
CMOS FILE USED 99 98 97 96 95 94
Different files may be used for special requirements.
The execution in DNC mode poses some limitations with respect to a direct execution from the
CMOS memory; for details about these differences, see the instruction !:L254… (DNC execution).
1.2.3 Part-program
To machine a part, all the relevant information must be supplied to Z32: this information
constitutes the PART-PROGRAM.
For correct interpretation information must be written in a LANGUAGE that Z32 understands.
D. ELECTRON 3
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
A standard international program language exists (ISO standards) that defines a possible
standard language for programming numerical controls: these standards have unfortunately not
been up-dated for years and seriously limit the data processing possibilities of modern computers.
Most of the OPERATIVE instructions of the programming language of the Z32, that is these that
produce an immediate physical result on the machine tool (e.g. axes movements, execution of
auxiliary functions) are compatible with the ISO standard.
In addition to the ISO instructions the Z32 executes a number of EVOLVED and STRUCTURED
PROGRAMMING instructions which do not bring to an immediate physical effect on the tool
machine, but perform special functions such as calculation of expressions, jump to subprograms,
conditioning, etc.
To avoid confusion the programming lines can be only ISO or only “evolved”, or only of
“structured programming”, that is to say it is not possible to insert in the same line ISO and
EVOLVED and/or STRUCTURED PROGRAMMING instructions.
The “evolved” lines are different because, right after a line number (N…) there is an exclamation
mark “!” which opens the first field of the evolved line.
Structured programming lines are recognized by two consecutive leading “-“ characters.
A part-program is made up of the following parts in this order:
− a title (any title can be used but it must not contain the character “%”)
− the character '%' (not mandatory)
− the significant lines of the program can be either ISO, EVOLVED STRUCTURED
PROGRAMMING in no fixed order.
When the part-program is performed, the first 40 characters of the first line of the program
(which can contain a concise identification code) are displayed on the screen, to enable the
operator to immediately see that the program is running.
PART-PROGRAM
TITLE 1 or more lines without the percentage sign
%
N1 ...
.....
ISO or EVOLVED program lines
...
:OS possible local origins section
X1=...
...
:PA possible local parameters section
PP=...
...
:TL possible local tools section
T1#1...
...
4
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 – Files organization and structures
WARNING
The first line of a part-program cannot be a jump destination: this
limitation is more evident if the initial % is missing as the first line
becomes operative in every respect.
D. ELECTRON 5
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
...
N10 G0 X0 Y0
N11 G4 TT0 (dwell time equal to zero)
/N12 X10
...
As G4 function, at block N11, empties the buffer, the optional block command will be
immediately operating on block N12.
6
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 – Files organization and structures
Section The section number is not a parameter and it must be a complete number (without commas or
number decimal points).
The section number (programmed with “:” at the beginning of ISO line) cannot be greater than
99999.
The sections do not have to be numbered in progressive sequence, but this is recommended to
have more clearness.
Sectioning lines (those with a “:”) must not have the block number N (they must start with “:”)
Progres- Program sectioning zeroes the progressive number (block number).
sive An example of the structure of a program with sectioning follows. The rules to be followed for
number good results are very simple.
zeroing
In section zero (which is always read during step search procedure):
- enter valid information for entire program
- do not enter tool change instruction (it is not an error, but is not useful)
- enter a sectioning instruction before each tool change instruction
- remember to program all machining functions after each sectioning operation
SECTIONING TEST%
N1 G37OL G25XYZ OX1 OZ1
zero section information is always read during block search procedure
....
:1
N2 T1 M6
for certain types of tool change it is useful to anticipate the search of the next tool
N3 T2
...
all the machine program functions of tool T1 must be entered
N4 S100 M3 M41
:2
N20 T2 M6
the operator must confirm T because this is a new section
N21 T3
N22 S500 M3
N23 !GON6-N8!
lines N6-N8 belong to another section
N24 ...
In a sectioned program such as above, any beginning of section can be searched very quickly.
Example:
3 ENTER: :2
The CNC performs the following operations:
− it reads and acquires the entire zero section
− it skips sections different from section 2
− it goes to the beginning of section 2
Program sectioning lines also introduce local parameter, origin and tool sections; they are not
part of the part-program and are used only as tags.
Example:
...
:OS local origin section beginning signal
D. ELECTRON 7
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
X1= 10.121
...
Line :OS does not produce any operation and it must not be processed as a part-program
line. It only marks the beginning of the local origin section.
The ISO lines consist of a line number (not necessary) and a series of elementary
instructions.
8
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 – Files organization and structures
The line numbers can be in any sequence (we recommend increasing) and can be repeated
more than once in the same program. In the case of a block search procedure or jump (GO N…)
the line found is always the first starting from the beginning of the program. Any second line with the
same number will not be found.
The line number, apart from making the program more comprehensible, is used also as a jump
destination address.
The CNC can use it as a jump address, the line number must be exactly at the beginning of the
line, without intermediate spaces or characters. In some instances the line can be searched by
including the preceding characters (% or /).The sequence to be entered after “GO” must be
identical to the sequence of the characters at the beginning of the line to be searched. The decimal
point is considered a character different from a comma.
Examples:
N12 G41... is found with !GON12!
%N1G41... is found with !GO%N1!
/N12G41... is found with !GO/N12!
N132,5HA... is found with !GON132,5! not with !GON132.5!
N132.5M3... is found with !GON132.5! not with !GON132,5!
Some functions (e.g. the G110 to make a rough-machining macro) automatically create a line
number starting from the value of a parameter. In such instances, in order to be found:
- N must be at the beginning of the line without additional spaces or characters (%, /, //)
- any decimal points must be made with a full stop and not a comma
The line number 'N...' can be omitted: in this case the line cannot be considered destination for
the jump procedure.
D. ELECTRON 9
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
In accordance with ISO standards, addresses consist of a single letter of the alphabet, however,
ADDRESSES as this is too restrictive, Z32 permits, as will be seen in the chapter dedicated to parameters,
addresses with one, two or three characters and two vectors PAR[ ] e PAL[ ] with an index.
For example:
X normally assigned to axis X
M auxiliary function
MA auxiliary functions
F feed
PAR[ ] parameter with index
The addresses determine the particular type of operation to be performed by the CNC: some
addresses are defined by the manufacturer of the tool machine (e.g. axes names), others can be
defined by the end-user (user parameters), while others have pre-defined functions (system
parameters, etc.). The following are already defined:
G preparatory functions
M, MA, MB, MC auxiliary functions
F feed
S speed
O supplementary origins
T, TA, TB tool programmed, current, future
PAL [ ] parameter with index for communication with programmable logic
Numerous other addresses have specific meanings (see chapter on parameters)
To complete the elementary instruction, the addresses are followed by a numerical value.
NUMERICAL
VALUES Numerical values can be entered directly or, as will be seen more clearly in the relevant
paragraph, as a result of a mathematical EXPRESSION.
When numerical values are entered directly they are programmed as numbers with a decimal
comma, with the following rules:
− at least one value must be programmed (zero is programmed with one or more figure
“0”)
− for numerical input, numbers with a maximum of 9 digits are accepted, before or after
the decimal point or comma (to be precise, the highest acceptable number is
1.000.000.009). Higher numbers produce program error CN1D14.
− the leading zeros may be omitted, even if there is a decimal part.
− either a comma “,” or a decimal point “.” can be used to separate the whole from the
decimal part
− there must be no characters or spaces inside the number
For example, to program 0,1 at address X the operator can program indifferently:
X.1
X .1
X,1
X0,1
X 0.1
X .100
X00000,1000
10
D. ELECTRON
CNC Z32 Programming Manual Chapter 1 – Files organization and structures
999999999
0,999999999
0,00000999999999
99999,9999
X12345,678
X123456,2
X0,1234567
D. ELECTRON 11
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
12
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
CHAPTER 2
2. PREPARATORY G FUNCTIONS
2.1 G FUNCTIONS
G functions are known as “preparatory functions” insofar as they prepare the CNC to read
subsequent instructions.
The number that follows G identifies the particular function for which the Z32 is prepared. The
G0
value that follows G must always be a numerical value (it CANNOT be the result of an expression).
G00
The G is not a parameter.
Only some G functions (that is only some numerical values) are read and executed by the Z32.
When a G that is not implemented is programmed the Z32 gives an alarm.
The functions are those prescribed by ISO standards, with some adjustments.
In particular:
− the initial zeros of the G function can be omitted (G00 becomes G0)
− several G functions can be programmed in the same block: in this case the G functions
are recognized by the CNC and executed as they are encountered in the programmed
line. When several contrasting G functions have been programmed, the last G
programmed remains active.
− G functions can be followed by additional data, which complete their definition.
Modal G functions whose effect is maintained also in blocks subsequent to those in which they are
programmed are called MODAL. The modal G functions are normally cancelled by other special G
functions.
With Some G’s require the machine to be STOPPED; the contour must be completely defined when
stop they are executed. Therefore, neither a contouring command with open profile, nor a contouring
command with radius compensation, must be in progress.
These specific G functions are indicated later as WITH STOP. If these G functions are
programmed in a prohibited part of the path, the CNC gives an alarm.
Other functions (M, MA, MB, MC, T, O) require the stop, as can be seen more clearly in the
relevant paragraphs.
D. ELECTRON 13
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
For example: X and Y maximum speed = 10 m/min, Z maximum speed = 5 m/min, all axes at
initial position = zero.
WARNING
G1 can be programmed alone (without values) on one line, but it has a
special meaning (rectilinear movement OPEN, see chapter on contour
programming) and does not only mean to prepare for movement in G1.
For example:
...
N10 G1
N11 X0 Y0
...
is not allowed: at step 11 it gives error CN3414 PREVIOUS OPEN
14
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
2.1.5 G4 - dwell
Operative only on the block, with stop.
The duration of the dwell is equal to the value of the ‘TT’ parameter, which can be programmed
in the same block or in a previous block. If from the beginning of the execution ‘TT’ has not be
programmed, the dwell time is zero. The ‘TT’ parameter defines the dwell time in seconds and
decimals.
When performing the dwell the time may vary by about ten milliseconds because of the of the
cycle times of the microprocessor.
Example:
...
N10 TT2.5
N11 G4 (DWELL OF 2.5 SECONDS)
...
D. ELECTRON 15
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
16
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
The geometrical accuracy of the path is better than RA (overshoot) divided by 2: if RA0.005 the
geometrical accuracy is 0.0025
If the NURBS contains edges (determined by coinciding nodes or measures), these will be
handled as G114 edges. The feed programming during a NURBS is acquired and effected as soon
as possible. This occurs at about the right point with a 4th-order NURBS (P4), delayed of about the
half of a block containing a 3rd-order NURBS (P3).
The delay between feed programming and its execution depends on the fact that with active
NURBS’s there is no precise coincidence between a programmed motion and a machine motion, as
the machine motion is the effect of other programmed motions.
WARNING
Programming a G10 eliminates the jerk limit imposed by NTAR. See
calibration help function in “global axis motion options”.
In general, the G10 acts as follows:
- the final soft approaching phase is eliminated
- the positioning time (if existent) is eliminated
- it goes to the next step at a certain distance from the final point defined in the machine
settings which can exceed the positioning threshold.
The negative effects of the G10 are:
- possible overshooting of final point (axes can go beyond the programmed point when
acceleration is excessive)
- moving on to the next movement when the axes are still far from the programmed point
(some hundredths to some tenths of millimeter depending on the calibration). If the axes
remain alive during the next movement they are called back to the correct position: in
normal conditions the axis returns within the machine accuracy limits within a few tenths
of a second.
Generally speaking G10 is not recommended when:
- going beyond the final point can be detrimental
- the precision of the positioned axes is immediately necessary (there is no time for
subsequent position recovery)
- one or more positioned axes are blocked (with G29) immediately after positioning (no
longer being alive, the axis is not recalled into position).
D. ELECTRON 17
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
In the case of advanced speed management (G113V), which has greatly speeded up
positioning, the advantage of G10 is reduced and therefore it was considered that the best
compromise was to eliminate G10 (even though programmed) and, therefore, the blow to the axes
when G113F is active.
Therefore:
- if advanced management (G113V) is not active, G10 functions normally
- if G113V is active and the motions are soft (G113P), G10 functions normally
- if G113V is active and the motions are rigid (G113F) G10 is automatically converted to
G0
WARNING
If a line that is shortened or eliminated owing to radius compensation
contains a motion of the third axis, this motion it will be completed on the
next motion.
Example:
18
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
G109E on the N2 line is required to execute the pocket in radius compensation mode, the
motions are normal up to the N4 included.
In this position a rotation around the edge is effected, that is not terminated as the tool diameter
is higher than the width of the pocket (tool diameter 20 mm, pocket width 15 mm).
All the subsequent motions in the program are eliminated up to the rotation around the last edge
N7 (X25) Y0.
Therefore, the tool centre motion consists of two incomplete revolutions, one around the first
edge and the other around the last edge, in order to position the tool against the pocket edges.
The N6 block containing the upward motion Z30 is eliminated, therefore the upward motion will
be effected with the next motion.
- arc (incomplete) around the edge X25 Y0 increasing the level measure from Z0 to Z30
- motion continued at Z30 up to the tool path end
Helixes The plain line upon which G12 acts can be either linear or circular, including the lines of
attachment to or separation from the profile (G41 and G42). When the line in the plane is circular, a
helical interpolation is performed.
As G12 limits the programming (slope, radius compensation, etc.) it must be entered only when
necessary and immediately cancelled when no longer required.
Example:
...
(WITHOUT RADIUS COMPENSATION)
N20 G0 X0 Y0 Z0 F1000
N21 G12 G2 X50 Y0 I25 J0 Z5 (HELIX)
N22 G1 X100 Z0 (INCLINED LINE)
N23 G13
...
(WITH RADIUS COMPENSATION)
N50 G0 X0 Y0 Z0
N51 G12
N52 G41 X50 Y0 QF0 Z2 (HELICOIDAL CONNECTION)
N53 G1 X60 Z4 (INCLINED LINE)
N54 G13
N55 G2 X60 Y-10
N56 G40
...
D. ELECTRON 19
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The change of axes can be carried out with the G16 function, which allows the axes to be re-
directed on new addresses.
For example, a machine program contains the axes X Y Z B C in this precise order. The order is
important as the re-direction is effected on the basis of the axes order: the characters following G16
are assigned to the physical axes in the same order as the list.
G16XYZBC
Now if we have a program which requires the exchange of X and Z axes (i.e. X must move
instead of Z and vice-versa).
The following instruction has to be entered before effecting the motions with the axes changed:
G16ZYX
Thanks to this instruction, Z is re-directed on the first axis (i.e. X), Y on Y (does not change) and
X on Z.
Rules:
- the characters assigned to the various axes must immediately follow G16, without blank
spaces in between
- a blank or the end of line break the character sequence and therefore interrupt G16
- the allowed names are the alphabet characters in capitals, excluding FGIJKLMNORST,
otherwise a CN1D14 program error will ensue
- if the number of characters following G16 is inferior to the number of the machine’s controlled
axes, the remaining axes do not change
- after G16, if an axis name is repeated in the same axis sequence, a CN1D14 program error
will ensue; for example, if a machine has the axes XYZBC and the G16ZX instruction is entered,
the result will be G16ZXZBC, therefore Z is repeated and an error will ensue
- with G53 enabled (axes referred to the base origin) or if a system subprogram is on (canned
cycle or special M) the G16 is interrupted; this avoids possible interference of G16 with essential
system programs
- in addition to the programmed measures, the axis re-direction function is also active for the
axes defined by G25, G28, G29, G43, G44, KM, KD.
- the re-direction of axes is enabled for all the programmed motions, in work and rapid traverse
st nd
mode, yet the meaning of I and J, which are however associated with the 1 and 2 axes of the
triad, remains the same; the programming of G25 with re-directed axes resumes all the necessary
references.
20
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
After G25, three characters with the three symbols of the axes defined as continuous on the
machine must be entered in succession. For example, G25XYZ defines that the machining triad
consists of the three axes X, Y and Z. The first two axes form the contour plane (in which it is
possible to perform circular interpolations). The other axis is an additional axis co-ordinated with the
first two (which can be used for canned cycles and other machine functions).
At power-on and at program beginning the triad defined in the machine-Settings becomes
active. It is important to define correctly the direction of movement of the axes to avoid surprises.
Machining takes place due to the movement of the spindle with respect to the workpiece. It
should be noted that, depending on the structure of the machine, the spindle or the piece can move,
and that on the same machine the spindle can move for some axes and for others the workpiece.
To avoid confusion, the operator must not consider the physical movement of the axis but the mark
left by the spindle on the piece as a result of the motion of the axis.
Two of the three axes of the triad identify the work plane (where circular interpolation, radius
compensation, etc., are permitted). To choose which of the two is the first and which the second
axes of the plane (which can be entered also with AA and AB respectively instead of their symbols)
the operator shall:
- ideally go into the positive part of the third axis (always considered as work mark);
- ideally perform a movement towards the positive of each of the two axes of the plane;
- again, ideally, rotate the plane until one mark is positive towards the RIGHT and the
other positive towards TOP.
New work The first axis of the plane (which the operator must write first after G25) is that which makes the
plane mark towards the right, the second axis is the one which makes it towards the top.
According to ISO 841 standard, the symbols to be given to the axes are:
- X for the first axis of the working plane
- Y for the second axis of the plane
- Z for the third axis
The machines do not always follow this regulation, especially when the same unit can, with
suitable accessories, be used with either a vertical or horizontal head.
In this case nor the letter that identifies the axis, nor the direction of movement of the axis that is
to be considered positive can be changed (they are tied to the physical axis). However, the Z32 can
adapt itself to various situations, by simply programming the G25 instruction followed by the three
axes in the order described above.
D. ELECTRON 21
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The figures show some situations deriving from ISO 841: please note the difference between the
physical axis (direction of movement) and the geometrical axis (the ideal trace left by the tool on a
piece as a result of physical motion) when a piece moves. In this case the physical motion is
identified by the apex (X’, Y’, etc.).
Figure 1A shows the same machine as figure 1, with the same symbols and the same direction
of movement of the axes, but with the spindle vertical instead of horizontal. Please note how the
correct triad is G25ZXY. In the same way if machine 2 (made with vertical head) is transformed to
horizontal, the correct triad is still G25ZXY.
Should an incorrect triad be entered (e.g. the first and second axes of the plane inverted), the
Z32 cannot detect the error (which may not be an error if one imagines a spindle that works from
below) and executes the movements that would be correct for a machine with inverted axes.
The operator will see inverted circular movements (G2/G3 and G41/G42).
Example:
...
(HERE G25XYZ IS ACTIVE)
N10 G0 X0 Y0 Z0
N11 B0
N12 G25BYZ
N13 G2 B30 Y0 I15 J0
N14 G25XYZ
...
22
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 23
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
Up to 13 Up to 13 axes can be alive simultaneously, but each alive axis requires supplementary
live axes computation to the microprocessor, which may not be compatible with very complex system
configurations. It is therefore advisable to keep constantly alive only the axes really necessary.
When the system takes control of a previously inactive axis, the Z32 acquires the present
position the axis, without giving an alarm, if the axis had been moved from the last positioning. This
makes it possible to:
1) lead an axis to a position and abandon it
2) move the axis by means other than CNC (manually, with PLC or other automatism)
3) take the axis under control again from the actual position without errors occurring.
Please note that the axis position parameter is not preset by G28, even if the axis was previously
abandoned. The acquisition of the axes positions in the relevant parameters if performed
exclusively with G105 (see relevant paragraphs).
The axis is activated prior to any axis motions contained in the line. Example (machine with XYZ
alive and B not alive):
...
N10 G0 X0 Y0 Z0 F300
N11 G28B B0
N12 G1 Z-10
N13 Y50 B50 G29B
...
In the case of cyclic axes, some peculiarities must be borne in mind. Please see the paragraph
Cyclical Continuous Axes in the chapter on Special Performances.
For the management of SCARA axes, the G28 function behaves in a special way because both
the two physical axes and the two fictitious axes are made active and inactive together (see M95
user manual, chapter on alarms CN..13).
24
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
The CN3A14 AXIS NOT ALIVE alarm will appear only if one tries to program a disabled axis
while G98 is active.
If a disabled axis is programmed, and this axis is already within the position threshold defined in
the machine settings, the programmed movement is ignored and the superfluous lock/unlock cycle
is not produced, thereby saving considerable time.
Naturally if the axis is alive any movement is performed, even if shorter in length than the
positioning threshold.
The lock/unlock cycle is however generated if the disabled axis is one of the three of the triad
currently active, but this is most unusual: typically the axes of the triad are in fact always active.
Should the origin be programmed on the same line as the movement of the disabled axis, for
example:
G29B ... (axis B is "dead")
OB1 B0
the execution of the lock/unlock cycle of the axis itself will be forced.
This means that, if the origin is entered in the same line as the programmed movement, there
will always be a lock/unlock cycle on the axis, even if the axis is already in position and remains still.
If the programmer wants to eliminate this cycle he will have to split the line in two and program the
origin in a previous line.
If a disabled axis is programmed in the same line with G53 or G54.
For example:
N100 G53 B10 X20 (B is a “dead” axis)
The dead axis is made alive even if the movement is null.
D. ELECTRON 25
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
One axis only of those defined as continuous by machine settings must be specified.
If the operator wants to make more than one axis inactive, he should enter the G29 instruction
several times in the same line or in different ones. e.g. G29XG29A to abandon axes X and A.
The request to make an idle axis inactive is allowed, but it does not produce any result.
Axis deactivation is performed after any axis movements included in the line.
See the example for G28.
26
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 27
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G35 Z70 threading with decreasing pitch, but the behavior is the
same of a fixed pitch threading, because the I parameter
has not been programmed after G33
Example 2:
G0 X0 Y0 Z0
M3 S200
G34 K2 I0.5 Z30 threading with rising pitch of 0.5 mm/round starting from
the initial pitch 2 up to Z30
G33 Z50 threading with pitch equal to that reached in the preceding
block, up to Z50, sets pitch increment = 0
G35 Z70 I0.25 threading with decreasing pitch of 0.25 mm/round, starting
from the pitch of preceding block, up to Z70
Example 3:
G0 X0 Y0 Z0
M3 S200
G34 K2 I0.5 Z30 threading with rising pitch of 0.5 mm/round starting from
the initial pitch 2 up to Z30
G33 Z50 K3 threading with pitch 3 up to Z50 WARNING: if the final pitch
of preceding block is different from 3, an abrupt pitch
variation is encountered
G35 Z70 I0.25 threading with decreasing pitch of 0.25 mm/round, starting
from the pitch of preceding block, up to Z70
Example 4:
G0 X0 Y0 Z0
M3 S200
G34 I0.5
K5 Z30 threading with rising pitch of 0.5 mm/round starting from
the initial pitch 5 up to Z30
G35 Z60 threading with increasing pitch of 0.5 mm/round, starting
form the final pitch of preceding block, up to Z60 (switching
from G34 to G35, the same I increment of 0.5 is
maintained)
Example 5:
G0 X0 Y0
M3 S200
G34 I0.9
K5 Z50 threading with rising pitch of 0.9 mm/round starting from
the initial pitch 5 up to Z50
28
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
G35 Z60 K4 I0.8 threading with decreasing pitch of 0.8 mm/round, starting
from pitch 4 up to Z60. WARNING: big pitch change,
because the final pitch of preceding block is certainly not 4.
G36*
G36* asks the CNC to force the progressive number of the operation (that used in block search
procedure) to the following value.
Active only in the block.
After G36* the operator must enter the 8 digit number (max 16777216) he wants to insert in the
progressive number. Leading zeroes can be omitted. For example:
G36 * 200
forces the progressive number to the value of 200.
This can be useful when there are cyclic programs, which never find M2, because at the end of
the program there is a jump without return to the beginning, e.g.:
CONTINUOUS PROGRAM%
N1 G36*0
N2 ...
...
N100 M0 (CHANGE WORK PIECE AND PRESS START)
N101 !GON1!
By means of this program a continuous working cycle is set up: the operator must change the
workpiece at the end of the program and press START to perform the machining of a new
workpiece. If there were no G36* next to the N1 instruction, the progressive number would increase
indefinitely, to make any block search procedure impossible. With G36*C instead the progressive
number starts from zero and a single step search procedure can be performed normally.
G36H/G36S halt/start
G36H and G36S ask the CNC to stop (H) and start (S) counting progressive numbers again.
Modal. G36S is active at reset.
These are useful when the operator does not want to disturb the regular increasing of the
progressive number, for operations depending on contingent machine situation, or when the
operator does not want to authorize the single block search procedure inside a sequence of
operations.
During the execution of special M functions or canned system cycles, the progressive number is
automatically stopped at the initial value (this is equivalent to a G36H operation at the beginning of
D. ELECTRON 29
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
the sub-program and a G36S operation at the end of the sub-program). A single block search
procedure is, therefore, not possible inside special M functions, nor inside canned system cycles.
Example:
...
N10 G0 X0 Y0 Z0 F1000
N11 M70 probe measuring cycle
N12 !IF AM<9000 ;GON16!
N13 G36H from this point the progressive number will not change
N14 T<T>M6 tool change searched for replacement tool
N15 G36S counting starts again
N16 ... the progressive number is always the same here
...
G36R/G36W read/write
G36R/G36W ask the CNC to read the progressive number in the HX parameter and to write in
the progressive number the content of the HX parameter.
Active only in the block, with stop.
Allow the progressive number manipulation, useful in case of repeated operations.
These are to be used by the manufacturer of the tool machine or very skilled programmers. The
example is to be considered as exclusively didactic.
The machine has a control device for the integrity of the tool during machining, which is
connected to the PLC, that permits movements to be performed in G62. If a worn tool is detected
during movement the tool must be changed and movement must be repeated without changing the
normal flow of the progressive number
...
N20 G0 X0 Y0 Z0
N21 G1 G62 F1000 Z-20
N22 !IF AM<9000 ;GON26!
... here tool is changed and operation repeated
N23 G36H Z100 T<T> M6 replacement tool
N24 G36R HX<HX-2> G36W G36S resets the old number
N25 !GON20! repeats operations
N26 ...
30
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 31
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
32
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 33
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The programmed state for origins and length compensations (G43-44, Origin, …) remains
freezed when G53 is active, and is restored by G54.
The operator is allowed to modify origins, G43, etc., during G53 operation: the effect of these
modifications is suspended until G54 instruction.
34
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
This can operate during radius compensation (G41 and G42) but it cannot be programmed while
G41 and G42 are operating.
See chapter on mirroring.
D. ELECTRON 35
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
- spindle reversing. During the reversing time Z axis, which is connected to the spindle,
goes beyond the Z-50 level. If the axis goes too far beyond the final position (the
maximum overtravel is defined in the machine settings, normally 10 mm) the alarm
message CN0713 occurs. In any case, leave sufficient space at the end of the hole.
- return (with Z axis still connected to the spindle) to the starting level (Z10).
- positioning of Z axis at the starting level (Z10). As the axis needs a stopping
distance, the synchronism between Z axis and spindle is abandoned when a certain
distance is reached: the programmer must leave a suitable safety distance.
N12: spindle reversing (which goes back to M3) and movement at rapid rate to X-10.
N13: another tapping cycle. Please note that the spindle must have finished the reversing
operation before beginning N13: if the reversing operation has not finished, the initial sign
will be wrong, and when the spindle finally reverses the axis, it will go backwards until an
error message is displayed (CN0713).
The K tapping pitch is always in millimeters, also on machines set in inches.
It is possible to do multiple passes on the same thread (only provided that the tool has not been
rotated) because the start of the movement is synchronized with the passage of the spindle through
zero position.
No functions requiring stopping can be programmed if G33 is operating except for G4 (i.e. all the
auxiliary functions M, MA, MB, MC, S, etc.) If one of these functions is programmed with G33 or
operating, the CNC will display the alarm message CN3C14 G33, G34, G35 or G63 ACTIVE
If the motion of a “dead” axis is programmed (which should be therefore activated and then
deactivated) the following alarm message is launched:
CN6214 LIVE AXES CHANGE + G33/G34/G35/G63
During G63 the overrides (axes and spindle) and feed-hold are not operating. Reset and stop
controls are operating but can be disabled if the manufacturer of the tool machine considers it
necessary.
The machine needs to be prearranged as follows allow the G63:
- position transducer on the spindle must be connected to the CNC.
- spindle reversing and steady spindle speed detection must be managed by the PLC.
It is suggested that the manufacturer supplies a canned cycle for synchronized tapping that
manages all the auxiliary functions pertaining to the spindle.
The following error (first in one direction and then in the other) present when G113P is enabled
(soft movements) is not compatible with synchronized tapping.
Soft movements are automatically discontinued during synchronized tapping.
Ingress in G63 (synchronized tapping), that is moving to the first synchronized thread with the
spindle going through the zero, is soft. This occurs without having to extend the thread ingress
phase thanks to a calculated advance applied to the linear axis entering synchronized tapping
mode.
It is furthermore possible to define the G63 approach time in machine setup, i.e. the initial
acceleration ramp when the rigid tapping starts. For this feature, please refer to the machine tool
builder specifications.
36
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 37
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The HX value may have decimal part and may be obtained by mathematical formulae.
To calculate the position increment this value will be divided by 1000.
WARNING
The HX value must be programmed before G91 (G functions are processed
during the line ANALYSIS, that proceeds with the same programming
order): therefore, it is a mistake to program
G91 HX10
If we want to program in incremental hundredths because the value of HX when G91 is
processed is not yet 10.
When G91 is active the programmed incremental dimensions for all the continuous axes (there
can be more than one in the same line) are added algebraically to their previous value.
The next example (only didactic and not realistic) contains a lot of possible combinations.
%
X0 0 Value
HX10 G91 Hundredths programming on
X100 Increment 100*10/1000=1 mm, so 1mm position
!X=X+0,5! Position does not change, X parameter at 1,5mmm
X50 The parameter was 1,5 increase 0,5 so 2mm position
X0 The increase 0 so position remains at 2mm
X<X+1> It is not a number so the absolute programming takes place.
X parameter value was 2 so position goes to 3mm
X-100 2mm position
HX100 G91 Change of increment weight to decimals
X100 10+2=12mm position
X100,04 12+10,04=22,004mm position
X<100> It is not a number so absolute programming takes place 100mm
position
X100 110mm position
G90 Incremental programming off
X<X+10> X parameter value was 110 so 120 position
Incremental programming requires special attention to the errors which can accumulate
indefinitely.
Errors can accumulate as follows:
1) Directly on the computer that originates the part-program. To avoid accumulation of
errors the truncating error of each value must be carried forward in the calculation of
the next value;
2) On Z32. As the decimal values (for example 0,001 mm) cannot be represented
precisely in the format used inside the Z32 (floating point binary), we have an error
which cannot be eliminated for every programmed increment. The value of this error
9
can be a maximum of about one part on 10 of the actual value. This means, for
example, that when working on maximum values of 1000 mm, there can be a
maximum error of 1 micron after the sum of 1000 increments. From test performed it
has been seen that 100,000 increments of 0.01 mm starting from value 0 lead to a final
value of 999,986 instead of 1000 (hence the error is 1.4 microns after 100,000
increments).
38
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
The error is very small, but it is a good idea to avoid the indefinite accumulation of errors that
could be unacceptable particularly in very long programs.
It is advisable to send the absolute values every so often: it has been seen that by putting the
numerical value in acute brackets it is interpreted as an expression and is therefore taken as
absolute programming of the value and the parameter.
It has already been said that incremental programming does not act inside a system sub-
program. This avoids problems in the event that the operator forgets to cancel the incremental
programming before calling up a special sub-program (imagine the consequences of a tool change
with special sub-program if the values are considered incremental …).
This restriction is not important, because incremental programming is useful only for
computerized part-programming.
The limitation does not apply to sub-programs and user canned cycles: if necessary, the
programmer will insert a G90.
Example:
N1 G0 X0 Y0 (rapid traverse)
N2 G93 F1000 (G93 enabled, time 1/1000 min.)
N3 G1 X0.5 (500 mm/min)
N4 Y2 (2000 mm/min)
N5 X0 Y0 (2061.5 mm/min)
N6 G0 X10 Y10 (rapid traverse)
Rules:
- there is no control of the programmed feed and of the length of the segment programmed: if
the segment length is zero, a zero feed will result
- nothing changes if axes are measured in inch: the function of G93 is that of entering the
inverse time within which the subsequent segments have to be executed
- G93 cancels G94, G95, G33 and G131 and is cancelled by G94, G95 e G131.
- G53 immediately cancels G93 and resumes G94 (programming in mm/min or unit/min)
D. ELECTRON 39
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
F parameter (feed) has mm/mm value (or other units) when G94 is active.
40
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 41
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
42
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
Reserved for This G function is useful in programming general-purpose sub-programs, when the operator
the wants to modify the state of the program and then restore the previous one, without knowing what it
manufacturer was. For example, inside a canned cycle, it is possible:
- to save the status with G102.
- to activate local origin and parameter sections.
- to use and modify local origins and parameters.
- to reset the sections operating prior to the canned cycle.
We suggest using G102 and G103 instructions only if the operator is an experienced
programmer.
See G103 instruction, for the examples.
WARNING:
The programmer should ensure that only one G103 corresponds to each
G102 and that it is not possible, e.g. due to programs running as a result
of conditional jumps, to skip a G103 or perform one too many. The next
G103s would reset states different from those desired, with unforeseeable
consequences.
D. ELECTRON 43
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
We recommend that the programmer of canned system cycles and sub-programs associated to
special M’s, should not use G53/G54 to interrupt and then reactivate compensations, but to use
G102 followed by G53 at the beginning of the sub-program and G103 at the end of the program to
restore status. This avoids problems if a special sub-programs is called by another special sub-
programs.
There are in memory only two data concerning G53 status: one for the normal status (user) and
one for the special status (manufacturer): any G54 in the special sub-program called back, would
cancel the G53 of the special calling sub-program. In the following example, a drilling canned cycle,
with computation of the holes done, is described:
DRILLING CANNED CYCLE
%
N1 G102
...(NORMAL CANNED CYCLE)
N80 G37PL
N81 !:RPN1=HA!HA=HA+1!:WPN1=HA!
N82 G103 G26
Please note that the previous status restoring, operated by G103, does not mean a previous
origin and length reset: the names of the origins and the value of L parameter will be the same.
When G103 is executed, the L parameter is considered as programmed, and all the origins will
be calculated again, only if there is a change in the status of the origins (G53/54) or of the length
(G43/44/45). In the example we describe some situations, which rarely occur in practice, but useful
to better understand the theory:
...
N8 G0 G54 G43Z G37OG OX0 OY0 OZ0
N8,5 L0 X0 Y0 Z0 all axes at zero position: there are no origins nor lengths.
N9!L=100! Z does not change, because L is programmed in an evolved
line.
N10 G102
N11 G103 because the status of origins and lengths do not change,
corrections are not calculated again and therefore Z does not
change
N12 G102
N13 G53 nothing is changed because no origins or L are operative.
N14 G103 as the status is changing from G53 to G54, origin and length
compensation will be calculated again. Z value = -100.
N15 G102
N16 OX1 global X1 origin is activated, X value=+50
N17 G103 global origin OX1 remains active, X value=+50
N18 G102
N19 G53 the origin is cancelled, X value=0
N20 G103 the status has changed and so the origin is calculated again:
X value=+50
N21 G37OL local section is activated OX1 global origin remains active
N22 G102
N23 G53 origins are deactivated
44
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
N24 G103 status G53 is changing; origins are calculated again: X1 global
origin previously programmed is activated again; it is reset as
global origin, even though local origins are now operating.
D. ELECTRON 45
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
WARNING
The position transferred is the real measured position, not the
programmed one. These two positions may be different due to positioning
errors (which, however, must be very small to remain within the position
threshold).
For example, if the operator enters X10, and the axis reaches the position 9,998, G105 will
acquire the position 9,998 and not position 10.
For cyclic axes see chapter on Special Performances, paragraph Continuous Cyclic Axes.
46
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
multiplied as well (possible error message: CN0013, CN0113 – axes out of control): by setting lower
limits, the operator resets the correct functioning of the axes, thereby eliminating tracking errors.
For example there is a rotating B axis with traverse of 5000 mm/min and acceleration of 300
degrees/sec/sec.
Suppose that the programmer wants to apply a permanent formula (e.g. to program B in mm on
a diameter of 57.3) which multiplies the values of the B axis by 2: without using G108 instruction,
the traverse (500*2=10000 degrees/min) and the maximum acceleration (300*2=600
degrees/sec/sec) would vary.
To bring B axis back within the allowed limits, the feedrate can be reduced to 2500 degrees/min
and the acceleration to 150 mm/sec/sec. Subsequently by applying the permanent formula (which
multiplies by two) feedrates will be brought back to the real ones.
...
N10 HX2500 G108F
N11 HX150 G108A
N12 B<<B*2>>
...
The limit is applied on every axis involved in the movement, obtaining the unwanted side effect
of reducing feedrate and acceleration pertaining to axes which do not need it. If the slowing is not
tolerable, the operator can cut the limits from the program, before performing movements that do
not need them.
The limits upon which G108 functions act, are also accessible by the PLC to be varied in real
time: request information from the manufacturer of the machine tool to avoid possible
inconsistencies.
G109U - G109V
G109U and G109V are used to modify feedrate control during radius compensation.
When in radius compensation mode, Z32 tends to maintain machining speed constant at the
contact point between the tool and the programmed profile.
D. ELECTRON 47
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
If the profile contains an internal arc, the tool centre (if the radius is positive!) follows an arc that
is narrower than the programmed arc. If the tool centre feedrate was kept constant, excessive feed
would occur on the periphery.
Therefore, in these cases, Z32 decreases the speed of the tool centre automatically.
This automatism may be incorrect if the radius is actually fictitious, that is, if it does not represent
the real radius (this is the case when a CAM calculates the path of the toroid tool centre in advance
and the R radius set in the CNC only represents the minus or plus variation with respect to the
theoretical radius).
G109U eliminates Feedrate Optimization by the CNC and forces Uniform Feedrate mode.
G109V (active at reset) restores the feedrate optimization during radius compensation mode.
G109X
G109X is used in some particular cases of closed profile.
When the Z32 is in radius compensation mode, it looks ahead to some segments on the profile
(from 3 with G109A to 7 with G109E) and eliminates intermediate segments if the tool interferes.
In the case of closed profiles made of a small number of segments (less than the number of
those explored in advance) the CNC may decide that there is an interference between the last and
the first segment and may therefore cancel the whole profile.
If programmed at an intermediary point on a profile, G109X forces the CNC to acquire all the
programmed segments that are geometrically closed: if it is programmed at an intermediate point
on a closed profile, it prevents interference checks between the first and the last segment thus
preventing the profile from being cancelled.
G109R G109N
Furthermore, it is possible to program:
G109R to radius the inner angle
G109N to cancel G109R
By radiusing an inner angle, it is possible to examine and solve problems related to the error
CN2B14 INCOMPATIBLE PROFILE.
G109R can be programmed immediately before the blocks which produce the error situation,
thereby easing analysis and correction.
G109S G109T
G113A or G113B are used for determining the curvilinear profile of a point-by-point path, or with
an indefinite sequence of linear segments.
As specified in the high-speed control manual, an arc breaks the sequence of radiusing
segments.
Normally, the CAM system keeps into account the size of the tool in the development of the
point-by-point program, and therefore it is not necessary to use radius compensation on the NC.
Sometimes, in the case of flat profiles, the operator may want to use the Z32 radius
compensation function in order to adapt the profile to a worn-out tool without having to generate
another profile on the CAM system.
On internal edges, G113A or G113B and high speed continue to operate correctly, however on
internal edges the radius compensation system introduces linkage arcs to obtain the rotation of the
tool around the edges as a result impeding the determination of the curve, and therefore leading to
sizeable slow-downs.
48
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
With G109S it is possible to force the Z32 radius compensation system in order to avoid the
generation of arcs and extend the segment up to the bisecting line of the edge. This ensures the
correct functioning of G113A or G113B and avoids any slow-down.
G109S (modal, not active on reset) forces the correction on the bisecting line, while G109T
(modal, active on reset) restores the normal operation of Z32 with the introduction of linkage arc.
As G109S id modal, it can be programmed only once at the beginning of the program, for
example:
The extension of the path up to the bisecting line may provoke an excessive lengthening of the
segment, which is undesirable in the case of sharp edges. For example, in the extreme case of a
180° edge, the path extension would be infinite.
Considered that in the case of sharp edges, G113A or G113B will not insert any connection
radius, and in order to avoid undesired path deviations, G109S is only effective on edges with
angles inferior to 16°. In case of wider angles, the standard linkage arc function is introduced, as a
result keeping the path around the edge within safe limits.
General remarks
G110 macrofunctions allow the creation of rough-machining macros.
G110 is commonly used by macro designers; when programming a piece the macro is provided
with a few parameters defining the profile, the pass slope and the cut increment.
The macro will use the G110 macrofunctions to define intersection points, cuts, fast returns, etc.
Generally, G110 is programmed according to the following syntax:
G110TxPy or G110Tz where:
− x (from 0 to 6): is a macrofunction identifier
− y (from 0 to 2): is a program identifier
− z (3 or 4): is a macrofunction identifier
The codes have the following meanings:
D. ELECTRON 49
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
Pre-lengths
AN… AP…
‘Pre-length’ parameters are used G110 both in input and output.
Pre-length means the distance covered by the tool centre from the beginning of the profile to the
specified point.
This is a simple and univocal way of identifying any point on a profile.
50
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
− It is not necessary that the first line number be lower than the last line number, it must
only be possible to reach the last line from the first line.
Examples (Line numbers and related HX):
N0 HX0
N1 HX1
N1,3 HX1,3
N1.3 error: decimal point
N1234,567 HX1234,567
N 37 error: intermediate space
N12345,56 HX12345,56
N03 error: initial zero
N12,30 error : insignificant decimal zero
N12345,567 error: too many significant figures
D. ELECTRON 51
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
Profile limitations
There are no particular limitations to the number nor types of profile segments contained
between the first and the last line: a longer profile will just require more time to be processed.
Every time G110 is called, the specified profile is always completely executed, even when the axes
movement is only partial or null (it is a sort of block search). Therefore, at the end of G110, the status of
the Z32 ( parameters and other modal functions) is modified according to the contents of the profile.
Consequently, the profile must be completely defined and be repeatable many times without
requiring any special initialization. In particular:
- the first profile section cannot be G2/G3 (as the initial point is not always the same); G0
is better
- the final segment must be closed
- it is better if the parametrical data in the profile, if any, be initialized in the profile itself: If
data contained in non-initialized parameters are used, make sure that these data are not
modified at the end of the profile.
- Rototraslation, mirroring and scale factors can be used as long as they are enabled
within the profile and disabled before the end. For greater certainty, the programmer of
the macro should force a cancellation
Because of internal macro organization requirements, the following limitations also apply:
- movements beyond the working plane are not admitted
- the working triad cannot be programmed within the profile.
Technical specifications
Analysis, G110T1
Call: G110T1Py (y = 0, 1, 2)
Function: searches on the specified profile, starting from the specified pre-length, the first
negative intersection and the next positive one with the straight cut line (positive intersection
meaning that the profile crosses the straight cut line in the some direction as the increment).
Input parameters:
52
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
Contour, G110T2
Call: G110T2Py (y = 0, 1, 2)
Function: executes the profile comprised between the initial pre-length and the first positive
intersection with the cutting line.
Input parameters:
HX HY first and last line number
HT angle of the cutting line
HR height of the cutting line
K cut increment
AN initial pre-length
Output parameters:
AN positive intersection pre-length (-1 if not found)
Remarks:
- if no intersection is found, the profile is executed from the initial pre-length to the end
- if contouring is to be made up to the negative intersection, just invert the K increment
input
- due to internal organization during contouring there is a slow down at the end of each
programmed segment.
In G110T2, if G114 is active, there is no slow down at the end of each section.
To simplify internal calculations, the profile performed using G110T2 (contour) does not feature
continuous speed as it would if it were performed directly.
There is a strong slow down at the end of each elementary section making the profile.
This slow-down does not occur if G114 is active: in this case the part of the profile executed
using G110T2 has the same speed as if it were performed directly.
D. ELECTRON 53
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
Please note that G114 is not compatible with G95 (cutting speed in mm/rotation), therefore this
performance is hardly significant for lathes that mainly use G95.
Dimensions, G110T5
54
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
AN gives >= 0 (typically 0) if < than the total length of the profile, -1 if input AN value
was > the total length of the profile
HR, HT dimensions of point on the profile. If AN on output is -1, these are the
dimensions of the last point of the profile.
AP, HX, HY not significant
Practical recommendations
G110 allows the creation of even very complex roughing macros.
However, the designer should take into account some aspects of the use of G110 that are not
always clear at the beginning in order to avoid problems in the case of profiles featuring extreme
geometric situations.
Calculation precision
D. ELECTRON 55
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The calculations performed by Z32 to determine the intersections of the cutting line with the
analyzed profile are all floating point calculations, with 31-bit accuracy (8 decimal digits). Calculation
errors accumulated during the various phases do not normally exceed one micron.
Analysis from the profile beginning with an already negative initial point
The analysis of a profile can begin from any point: when entering the macro the AN parameter
specifies the quantity of profile that must be discarded before performing the analysis. If the initial
point of the analyzed profile is already negative, this initial point is taken as first negative
intersection.
This will avoid problems should the cutting line intersect the profile exactly at the end of a
segment: calculation approximation may indeed insert the cutting line in a profile ‘interruption’ and
the intersection may not be found.
This forcing must be taken into account when making logical decisions.
In the example shown in the figure, to find the N2 and P2 intersections, we can program:
AN0 HX10 HY20 HR... HT30 K8 G110T1P1 (1st analysis)
AN<AP+.002> HX10 HY20 HR... HT30 K8 G110T1P1 (2nd analysis)
If AN = AP is programmed in the second analysis, two different and unforeseeable results may
appear depending on the calculation approximations:
- the N1/P1 intersections are found
- the N2/P2 intersections are found
56
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- the circle intersects in two separate points that are very close to each other.
Execution time
The execution time of G110 depends on the length of the profile: in practice, every G110
explores the profile completely, and performs intersection calculations that may last from 0.1 to
about 15 milliseconds for each profile section.
The execution time of a complete macro is the sum of the times required by the instructions it
contains: the G110 and the other instructions. If the profile is complex, a large number of additional
analyses may be required to distinguish multiple intersections, thus making execution time longer.
D. ELECTRON 57
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G113L controls 8 mS
It is possible to program already active G113H or G113L (this has no effect)
Upon reset, the axis control mode as defined in the machine calibrations (axis control cycle time
= 2.8 mS) is active by default.
G113H/L can be programmed anywhere in the program even during radius compensation.
WARNING:
Because of the buffer of pre-processed blocks in the memory, the effect of
G113H/L occurs before the point where it is programmed. The entity of the
advance cannot be foreseen (currently, it amounts to about ten blocks and
is likely to vary later if the buffer memory is increased). If it is necessary to
be certain when G113H/L will occur, a “stop” function must be
programmed beforehand, the most harmless being G4 (delay) TT0.
If the whole program must be run with fast interpolation, a G113H at the beginning is sufficient.
For less stiff machines (those of lager size) and sculptured surface effects, it is possible that the
best results are ensured by the G113P, because the higher accuracy of motions required by G113X
implies higher accelerations which may give rise to mechanical oscillation as a result leading to
undesired marks on the workpiece. The effectiveness and applicability of this function must be
assessed by the manufacturer case-by-case.
To enable the “X MODE” it is necessary to program G113X, which is modal and disables G113P
and G113F.
The programming of G113X requires that the G114 is active, otherwise the alarm CN2C14
INCOMPATIBLE PARAMETERS will be launched.
58
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
For the sake of simplicity in programming, G113X automatically enables G113H (2 millisec) and
G113V (advanced speed management).
With G113X active, it is superfluous to program G113L (8 mS) and G113S (standard speed
management): they will be ignored.
With G113X active G113C is not effective, as it only operates with G113P soft motions.
G113X is interrupted during the G63 synchronized tapping motions and the G61, G62 measuring
motions.
In order that the G113X can reach its best performance levels it is necessary to enter various
calibration parameters into the NC system. This function is carried out easily through G125.
After replacing or changing the calibration values of drives or NC boards, the G125 must be run
before applying G113X.
G113X influences all motions (included the G0 rapid traverse), which are carried out with
minimum tracking error even in steep acceleration and slow-down ramps. Compared to G113F
(which ensures minimum tracking error) the accuracy error is reduced by a factor of 10 at least;
from some tenths to few hundredths of millimeters.
An item in the machine settings defines which mode is active at reset, whether G113P
(proportional) or G113F (feed-forward) or G113X (X MODE).
These functions are part of the high speed machining system; for further details please see the
relevant M146 "High Speed" manual.
D. ELECTRON 59
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
A) Operating lines
These are lines “doing” something, like axes movement, auxiliary functions, etc.
60
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 61
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
parameters in MDI mode, go to Jog mode and extract the tool by sending jog
commands through the buttons.
The X, Y, Z, I, J, and K parameters determine the geometry of G116, which is incremental and
associative.
X, Y, and Z identify the origin of the new axis system defined in the current axis system.
I (or J or K), that can be programmed one at a time, identify the rotation of the new axis system
around the X (or Y or Z) axis in the current axis system.
In other words, G116 introduces a rotation having an angle I (or J or K) around the point whose
coordinates are X, Y, Z in the coordinate system that was valid before programming G116.
I, J and K must be expressed in degrees.
The line containing G116 does not generate any movement.
On the same programming line of G116 it is possible to enter a linear translation motion plus a
rotation: the system will perform first the linear motion and then the rotation in this order.
The position displayed is always referred to the coordinate system rototranslated from G116.
The order according to which G116, KA, X, Y, Z, I, J, and K are programmed is not important.
G116 can be programmed when G116 is already active.
G116 is compatible with G117 and G118 but not with G118HR1, nor permanent formulae, or with
tracing movements (G111).
As with permanent formulas, previsional end of travel are not active when G116 is operating, but
real time stops are.
G116 affects all the programmed movements, whether traverse or working, linear or circular.
WARNING
In order to avoid deviations, the first motion after having programmed the
G116 – which effects a translation of the reference system – must contain
the axes measures in logic numbers 0, 1, 2 (normally X, Y, Z).
G116 is incompatible with G43/G44/G45, otherwise it sends a CN5B14 alarm.
G25 (selection of the machining triad) does not affect G116 that operates according to the logic
number of the axes. To make G116 work correctly, the X axis must have logic number 0, Y logic
number 1 and Z logic number 2. To be precise, if X, Y or Z do not correspond to the axes having
logic numbers 0, 1 or 2, we must replace in all the examples given:
- X with the name of the axis with logic number 0
- Y with the name of the axis with logic number 1
- Z with the name of the axis with logic number 2
The following example shows a part program (containing only 90-degree rotations for greater
clarity) together with the positions referred to the straight coordinate system (Xr Yr Zr) and
displayed on screen (Xv Yv Zv), that have been reached at the end of the movement.
Part-Program Line Xr - Xv Yr - Yv Zr - Zv
N1 X0 Y0 Z0 0 0 0 0 0 0
N3 X3 Y2 Z1 13 3 22 2 31 1
N4 G116 X0 Y0 Z0 13 3 22 2 31 1
N5 X0 Y0 Z0 10 0 20 0 30 0
N6 G116 I90 10 0 20 0 30 0
62
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
N7 X50 60 50 20 0 30 0
N8 Y20 60 50 20 20 50 0
N9 Z30 60 50 -10 20 50 30
N11 X45 60 45 65 20 50 50
N12 Y50 60 45 65 50 80 50
N13 Z40 50 45 65 50 80 40
N21 X0 Y0 Z0 0 0 0 0 0 0
Programming only one rotation axis at a time is a necessary limitation to have a clear idea on
the order according to which multiple rotations must be made: as a matter of fact, programming, for
example, a rotation around X and then around Y, or programming this rotation around Y first and
then around X does not lead to the same result.
Rotations around more than one axis can be obtained by cascade programming (on consecutive
lines) the various rotations in the desired order.
D. ELECTRON 63
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
The special G118 function is used for controlling RTCP (rotation tool centre point) of a machine
tool equipped with a rotary or bi-rotary “tilting” tables (one or two axes, inclined with respect to the
main axes triad).
The general format for enabling G118 is:
G118 N [KA…] [RA…] [I… J… K…] [X… Y… Z…]
or
G118 ‘axis name’ [KA…] [RA…] [I… J… K…] [X… Y… Z…]
For a more detailed explanation on the use and on the functioning please refer to the M154
Manual, rotation RTCP.
2.1.69 G118 HR1 - RTCP for rotary table with combined linear/rotary motions
Modal.
The G118 HR1 special function is used for controlling RTCP (rotation tool centre point) with
combined motions of the rotary and linear axes, for a machine tool equipped with a rotary or bi-
rotary “tilting” tables (one or two axes, inclined with respect to the main axes triad).
The general format for enabling G118 is:
G118N HR1 [KA…] [RA…] [X… Y… Z…]
or
G118 ‘axis name’ HR1 [KA…] [RA…] [X… Y… Z…]
For a more detailed explanation on the use and on the functioning please refer to the M154
Manual, rotation RTCP.
2.1.70 G119 - MDI and jog mode with position transducer alarms
The G119 was introduced to allow axis movement in MDI or in jog mode with transducer alarms
(type CNxx12). The characteristics are as follows:
- G119 has effect only if programmed from a MDI line
- It is modal and transparent at reset
- If G119 is active the type 12 transducer alarms are ignored
- It is automatically reset if an automatic program is launched or if there is an attempt to
launch any subroutine from MDI mode (even if it is a special M)
To move the axes in jog or in MDI mode with type 12 alarms, one must:
- enter MDI mode
- write G119, press Enter and then START
- press RESET (the transducer alarms disappear)
- work normally in MDI or in jog mode.
WARNING:
When G119 is active, the software end of travel are disabled on all the
axes because transducer may contain insignificant distances therefore
preventing the movement from taking place. It is up to the operator to take
care to avoid collisions and damage. In any case, as an extra precaution,
Z32 will automatically activate the TEST condition (reduction of rapid
movement to 1/5) when G119 is active.
64
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
D. ELECTRON 65
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G123 KA1 [X...] [Y...] set positive limits and enables positive limitation; if axes exceed the
range, the CN5514 alarm will ensue
G123 KA-1 [X...] [Y...] set positive limits and enables negative limitation; if axes exceed the
range, the CN5514 alarm will ensue
G123 KA3 alarm mode: if a measure exceeds the range, the CN5614 alarm will
ensue
G123 KA4 restores the standard operation mode; the measures are limited to the
set range
G123 KA5 enables the stop mode; if one or more programmed measures exceed
the set range, it will stop all motions and will only resume them when
all measures have returned within the range.
On reset and on program start, the default conditions are the following:
- range limits from +infinite to –infinite on all NC-controlled axes
- both the negative and positive limits are disabled (G123KA0)
- this configuration does not causes alarms and limits the number of measures exceeding the
range (G123KA4)
Rules and limitations for G123
G123 must be programmed in a separate line, otherwise the CN2C14 INCOMPATIBLE
PARAMETERS alarm will ensue.
In a line with G123, KA must be programmed with a value chosen exclusively among the
following values: -1, 0, 1, 3, 4, 5.
If KA is programmed more than once, only the last value programmed is retained.
If the KA value is other than the admissible ones, the CN2C14 INCOMPATIBLE PARAMETERS
alarm will ensue.
If KA1 or KA-1 are programmed, the measures of the axes (all NC-controlled axes) are
considered as positive (if KA1) or negative (if KA-1) limits.
With KA1 and KA-1, if some axis measures are not entered, the corresponding limits will be
retained.
The programming of positive limits and negative limits must be carried out on different lines.
It is possible to enable either positive limits or negative limits, or enable both positive and
negative limits at the same time.
On each axis, (positive limit) > (negative limit), otherwise the CN5514 G123 LIMITS NOT VALID
alarm will ensue.
On reset, all positive and negative limits are disabled and the standard mode is resumed (KA4).
The programmed limits are always referred to the active origin.
With G123 enabled in its standard mode (KA4) the final measures programmed are replaced, if
they exceed the range, with the limit measures.
With the G123 enabled in the KA3 mode, if the final measures programmed exceed the range,
the CN5614 G123 QUOTA EXEEDS LIMITS alarm will ensue.
If a circle is programmed (G2 or G3) with G123 enabled, the CN5714 G123 CIRCLE+G123
alarm will ensue.
With G123 KA1 or G123 KA-1 only the measures of the NC-controlled axes can be displayed as
programmed measures, otherwise the CN2C14 INCOMPATIBLE PARAMETERS alarm will ensue.
If G53 is programmed with G123 enabled, or vice-versa G123 with G53 enabled, the CN5A14
G123+G53 alarm will ensue.
66
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
If G105 is programmed with G123 enabled, the CN5914 G123+G105 alarm will ensue.
WARNING
If more than 5 axes move during the stopping procedure, on resuming the
motions more than 5 axes will be considered as programmed, and
therefore the CN2C14 INCOMPATIBLE PARAMETERS alarm will ensue.
The lines related to the stopped motions are not displayed, unless they contain auxiliary
functions.
Disabling procedure
By programming G123KA0 it is possible to eliminate both the positive and the negative limits,
however all the programmed settings (limits, KA3 or KA4) remain enabled.
In order to restore a previous positive limit it is sufficient to program G123KA1 without entering
any measure, while a negative limit can be restored by programming G123KA-1 without entering
any measure.
Programming the G123 limits with a measure already out of range
Let us now consider the case (for the sake of simplicity, we will refer to a single axis) of range
limits programmed with G123, while the current measure already exceeds these limits: for example,
when we have X=80 and enter G123KA1X30.
Here, a distinction must be made between G123KA3 (alarm mode) and G123KA4 (limitation
mode).
G123KA3, case 1:
G0X100
G123KA3
G123KA1X30 the only positive limit is on X
G0X40 CN5614 G123 QUOTA EXCEEDS LIMITS alarm
G123KA3, case 2:
G0X100
G123KA3
G123KA1X30 the only positive limit is on X
G0X10 X goes to 10 (within the set limits)
G123KA3, case 3:
G0X100
G123KA3
G123KA1X30 the only positive limit is on X
G0Z200 Z goes to 200
D. ELECTRON 67
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G123KA4, case 1:
G0X100
G123KA4
G123KA1X30 the only positive limit is on X
G0X40 X goes to 30 even if 40 has been set
G123KA4, case 2:
G0X100
G123KA4
G123KA1X30 the only positive limit is on X
G0X10 X goes to 10, within the G123 limits
G123KA4, case 3:
G0X100
G123KA4
G123KA1X30 the only positive limit is on X
G0Z200 Z goes to 200
G0Y300 Y goes to 300
G0X50 X goes to 30 even if 50 has been set
EXAMPLE 2%
G0X20Y20Z20
G123KA1X30Y40Z50 positive limits
G123KA-1X-10Y-15Z-20 negative limits
G0X-60Y-60Z-60 end point X=-10, Y=-15, Z=-20
G0X60 X stops at 30
G0Y80 Y stops at 40
M2
68
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
EXAMPLE 3%
G0 X0 Y0 Z0
G123 KA1 Y20 only positive limit: max Y =+20
G123 KA5 enables “stop” mode
G1 F1000 X5 motion executed
X-10 Y25 Z-20 motion not executed as Y exceeds range
X-12 Z30 motion not executed as Y still exceeds range
Y10 motion executed as if X-12 Y10 Z30 had been programmed
D. ELECTRON 69
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
G124 from now on, A and B can only be moved using the handwheels
G0X10Y10Z10C40 ok (C axis not linked to G117)
G0A10 alarm CN5814 because the A axis has been programmed
Example 2:
G0X0Y0Z0A0B0C0
G117
G0A30B40X40
G124 from now on, A and B can only be moved using the handwheels
G0X10Y15Z25C30 ok (C axis not linked to G117)
G0Z0X0Y0C0 ok
G124KA0 A and B handwheels disabled: A and B can be re-programmed
G0A15B35X10 ok
Example 3:
G0X0Y0Z0A0B0C0
G124 no effect as G117 is not active
G117
G0A30B40X40 A and B can be re-programmed
G124 from now on, A and B can only be moved using the handwheels
G0X10Y15Z25C30 ok (C axis not linked to G117)
G0Z0X0Y0C0 ok
G117KA0 the disabling of G117 also disables G124: A and B can be re-
programmed
G0A15B35X10 ok
These functions are incorporated in the high-speed machining system. Further details are
available in the M146 Manual, ‘High Speed’.
70
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
In these machines, the workpiece is fixtured on a moving conveyor belt (i.e. the “master axis”)
while the machining unit is stationary and can have various axes, one of which is the tracking axis
(i.e. the “slave axis”).
G126 enables the tracking mode between the master axis and the slave axis.
Further details about this function are available in the M99 Manual – PLC, “FFLOCK” function.
The description of the system (for the users of machines which are configured for process lock
functions) is available in the M252 Manual.
However, a passive motion does not provoke a relative motion between the workpiece and the
tool tip: in fact, it keeps the tool tip still with respect to the workpiece.
- with RTCP and G131 active, the programmed feed will only be referred to linear axes
- the execution time of the linear axes motions is calculated on the basis of the programmed
feed and the translation length of linear axes
- at this point, a new feed value is calculated that is expressed as the inverse of the time
calculated as above, and the result will be like that of a G93 programmed with this feed value.
- in the G131 enabling line, it is possible to enter the I parameter followed by a positive number
that indicates the maximum speed of the rotary axes involved in the programmed motion; if this
parameter is not entered, the maximum speed will be the rapid traverse speed.
WARNING:
- if the feed value calculated as above is too high for some of the axes involved in the motion,
the feed will be limited properly
D. ELECTRON 71
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
- if the translation length of linear axes tends to zero, the rotary axes will have a higher speed
that will be eventually taken to the maximum admissible speed as specified by the I parameter; if
this parameter is not entered in the G131 line, the maximum speed will be the rapid traverse speed
- in blocks where the translation length of linear axes is zero, the rotary axes will revolve at their
maximum admissible speed (I parameter or rapid traverse)
- in blocks without linear axes, the rotary axes will revolve at their maximum admissible speed (I
parameter or rapid traverse)
- if the programmed motion contains passive motions along the XYZ axes that are induced by
the RTCP rotary axes, and the resulting speeds of XYZ axes are too high, these speeds will be
properly limited to those allowed for XYZ; this however provokes speed variations between tool tip
and workpiece
- in particularly long translation motions, speed variations may arise due to the passive motions
on the linear axes induced by RTCP rotary axes
- If G131 is enabled, G93 or G94 or G95 will be eliminated; vice-versa, if G131 is active, the
enabling of G93 or G94 or G95 will eliminate G131.
- the motions that obtain the cam profile are only those of the rotary axes, leaving to the CNC the
task to calculate the linear axes motions in real time in RTCP.
The problem that emerges in production is that the real tool radius can be slightly different from
the radius in the CAM system, and therefore, in order to avoid rewriting the whole part-program with
the CAM system, the CNC must provide the possibility of correcting the tool motions to compensate
for the radius difference: G132 provides the solution to this problem.
where:
72
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
(v1) can only assume two values, +1 or -1, to indicate that the compensation must be applied to
axis1 with its original value or with changed value
(v2) can only assume two values, +2 or -2, to indicate that the compensation must be applied to
axis2 with its original value or with changed value
(axis3) is the name of the first rotary axis, normally associated to the first linear axis
(axis4) is the name of the second rotary axis, normally associated to the second linear axis
3 and 4 are obligatory values which allow the NC to identify the axes
(vx) is the numerical value which individuates the length in mm of the rotation arm related to the
first rotary axis
(vy) is the numerical value which individuates the length in mm of the rotation arm related to the
second rotary axis
(vr) is the numerical value in mm representing the difference between the radius used by the
CAM system for calculations and the real radius of the tool on the machine; the maximum
admissible difference is 8.192 mm.
(vf) is the maximum speed in mm/min at which the NC moves the linear axes for corrections
For example:
- X and Z are the linear axes, associated to the A and C rotary axes
- the real tool radius is inferior to the radius in the CAM system by 0.162 mm
G132 KA0
- the length and speed values are in mm and mm/min, even though the unit of measure for the
machine is the inch
- if KA1 has been programmed, it will be necessary to enable HX, HY, HR and the four axes
with the values +-1, +-2, 3, 4 respectively
- I programming is optional; if not programmed, I will assume the 500 mm/min default value; if
programmed, its maximum value will be 2000 mm/min
D. ELECTRON 73
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
- the elements that make up the line can be entered in whatever order
- all the numerical values can be programmed through expressions; for example, HR<R-10> can
be used for indicating that the CAM radius was 10 mm and therefore the difference is the current
radius R minus the CAM radius
- G132 is compatible with RTCP and with whatever geometrical segment programmed (linear,
circular etc.)
- with G132 enabled it is possible to program linear axes: the correction value is added to the
programmed motion.
- when enabling G132, the corrections start from zero and reach the calculated values within a
period which begins with a certain delay (at least 0.25° for a rotary axis) and lasts the time
necessary for reaching the full correction value; then the segment which immediately follows the
G132 should be on air so as not to generate wrong profiles
- when disabling G132 (after G132 KA0) an inverse motion occurs for recovering the correction;
here too, a motion on air is necessary so as not to generate wrong profiles
- during the block search, the correction function is not active; when machining starts again,
there is an initial linkage period (similarly to the G132 enabling procedure)
- during machining the maximum correction speed on each linear axis is limited to the
programmed speed (default value 500 mm/min); if the workpiece geometry requires higher speeds,
the errors can be compensated successively as soon as the axes speeds have returned within the
set limits
- corrections are calculated on the basis of the axis motion direction, and are amplified by the
radius difference programmed with HR; therefore, the surface finish quality not only depends on the
correctness of the programming procedure, but also on the radius difference which should be as
small as possible (far lower than the HR limit, i.e. 8.192 mm)
74
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
(axis1) is the name of the linear axis parallel to the cylinder rotation axis
(v1) may assume only the values +1 or -1, to indicate if the computed correction must be applied
to axis1 with its sign or with opposite sign
(axis2) is the name of the other linear axis
(v2) may assume only the values +2 or -2, to indicate if the computed correction must be applied
to axis2 with its sign or with opposite sign
(axis3) is the name of the axis specifying, together with axis2, a plane orthogonal to the cylinder
rotation axis (if axis1=X, axis2=Y, then axis3=Z) and never programmed
3 is a mandatory numeric value, allowing the CNC to identify the axis
(axis4) is the name of the rotating axis (whose rotation axis is parallel to axis1)
(v4) may assume only two values +4 or -4: +4 indicates that a positive rotation of axis4
corresponds to a positive displacement of axis2, while -4 indicates that a positive rotation of axis4,
corresponds to a negative displacement of axis2.
(vaxis2) numeric value, in milllimeters, indicating the position from the cylinder rotation axis,
along the axis2 coordinate, relative to the active origin
(vaxis3) numeric value, in milllimeters, indicating the position from the cylinder rotation axis,
along the axis3 coordinate, relative to the active origin
(vr) numeric value, in millimeters, representing the difference between the radius used by the
CAM for path computation, and the radius of tools mounted on the spindle. Maximum allowed value
is 8,192 mm.
(vf) is the maximum feed, in mm/min, used by the CNC to move all linear axes for correction
purposes
Example:
G132 KA2 X1 Z-2 Y3 B4 HX10 HY5 HR-0.5 I1800
Introduces a correction for cylindrical cams, where:
- linear axes are X (first linear axis), Z (second linear axis) and Y (third linear axis)
- the cylinder rotation axis is parallel to X axis
- the plane orthogonal to the cylinder rotation axis is the YZ plane
- the rotating axis with rotation axis parallel to the first linear axis (X in this case) is B
- a positive rotation of B corresponds to a positive displacement of Z
- the correction along Z axis ha a sign opposite to the computed theoretical value
The cylinder rotation center has coordinates (10.5) in the reference system with origin on active
origins of the two axes (Z,Y)
- the used tool radius is 0.5 mm smaller than that used by the CAM
- maximum correction speed is 1800 mm/min
The correction may be deactivated by programming:
G132 KA0
Some notes on the programming syntax for G132 KA2
- lengths and feed values are expressed in mm and mm/min, also on inches programmed
machines
- parameters axis1, axis2, axis3, axis4, HX, HY, HR and corresponding values are mandatory
- the I parameter is optional, and if not programmed, a default value of 500 mm/min is assumed;
maximum allowed value is 2000 mm/min
D. ELECTRON 75
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
where:
(axis1) is the name of the linear axis programmed, one of the two axes of table plane
(v1) may assume only the values +1 or -1, to indicate if the computed correction must be applied
to axis1 with its sign or with opposite sign
(axis2) is the name of the other linear axis of table plane, never programmed in part-program
movements, and always equal to the position, along axis2, of the table rotation center
76
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
(v2) may assume only the values +2 or -2, to indicate if the computed correction must be applied
to axis2 with its sign or with opposite sign
(axis3) is the name of the rotating axis (whose rotation axis is orthogonal to the table plane
defined by axis1 and axis2)
(v3) may assume only two values +3 or -3: +3 indicates that a positive rotation of axis3
corresponds to a positive displacement of axis2, while -3 indicates that a positive rotation of axis3,
corresponds to a negative displacement of axis2.
(vaxis1) numeric value, in milllimeters, indicating the position of the table rotation center, along
the axis1 coordinate, relative to the active origin
(vr) numeric value, in millimeters, representing the difference between the radius used by the
CAM for path computation, and the radius of tools mounted on the spindle. Maximum allowed value
is 8,192 mm.
(vf) is the maximum feed, in mm/min, used by the CNC to move all linear axes for correction
purposes
Example:
G132 KA3 Y1 X-2 C-3 HX10 HR-0.5 I1800
Introduces a correction for polar cams, where:
- linear axes are Y (first linear axis) and X (second linear axis)
- the plane orthogonal to the table rotation axis is the XY plane
- the rotating axis with rotation axis orthogonal to the table plane is C axis
- a positive rotation of C corresponds to a negative displacement of X
- the correction along X axis ha a sign opposite to the computed theoretical value
- the table rotation center has coordinates 10 in the reference system with origin on active origin
of Y axis
- the used tool radius is 0.5 mm smaller than that used by the CAM
- maximum correction speed is 1800 mm/min
The correction may be deactivated by programming:
G132 KA0
Some notes on the programming syntax for G132 KA3:
- lengths and feed values are expressed in mm and mm/min, also on inches programmed
machines
- parameters axis1, axis2, axis3, HX, HR and corresponding values are mandatory
- the I parameter is optional, and if not programmed, a default value of 500 mm/min is assumed;
maximum allowed value is 2000 mm/min
- all line elements may be programmed in any order
- numeric values may be programmed also through expressions (for example HR<R-10>)
- G132 KA3 is not compatible with G53/G54
- G132 KA3 is compatible with RTCP
- with G132 active, both linear and rotating axes movements may be programmed: the
correction movement along the two linear axes axis1 and axis2 is added to that programmed for
these axes
D. ELECTRON 77
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
- on activation of G132 KA3, all corrections start from zero and reach those computed with a
connection starting after a delay (at least 0.03125 rotating axis degrees, or 0.1 mm linear axis
displacement are needed) and lasting for the time necessary to reach the final correction value;
therefore the space immediately following the G132 KA3 activation must be executed in order to
avoid profile errors.
- on deactivation (after G132 KA0), a reverted correction recovery movements is made: also in
this case it is necessary to execute it without contact with the workpiece in order to avoid errors
- during block search the correction is not active. When the machining is resumed, the initial
connection element is executed, in the same way as on G132 KA3 activation.
- during the machining the maximum correction feed (for each linear axis) is limited to the
programmed value (default 500 mm/min) If the geometry requires higher values, correction errors
arise, possibly recovered later on, when the feed returns inside allowed limits
- the corrections are computed depending on the axes movement directions, and amplified by
the radius difference programmed with HR. The finishing degree depends on the programming
regularity, but also on the radius difference, which must be maintained as smallest as possible
(much lower than the HR allowed limit of 8,192 mm).
78
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- the M6 programming on milling machines also stops the spindle (behaves like if a hidden M5
was programmed), while this is not true for lathes.
With G134 KA0, the milling machine behavior is enabled, while with G134 KA1 or KA2, the lathe
functionality is enabled.
If no KA is programmed or if the programmed KA value is different from 0, 1, 2, the alarm
CN2C14 INCOMPATIBLE PARAMETRS is issued.
At reset and program beginning, the milling/lathe functionality defined in machine setup is
automatically restored.
G134 may be programmed more than once in a part-program, either to force or to restore a
behavior different from that specified in machine setup. The situation of “forced lathe” (i.e. a
machine defined in setup as a milling machine, but forced to behave like a lathe) is special because
it doesn’t allow the G107 (diameter programming): the alarm CN1D14 PROGRAM ERROR is
issued, like programming G107 in a milling machine.
The G134 cannot be programmed in the same line as G133, otherwise the alarm CN1D14
PROGRAM ERROR is issued.
In case of forced operation (milling machine forced to behave like a lathe or viceversa) it is not
possible to program G25 (change of machining tern) otherwise the alarm CN1D14 PROGRAM
ERROR is issued.
If G53 is programmed in a forced lathe condition (for example during a tool change to refer the
positions to base origins) the machine returns a milling machine and G53 is considered “with stop”.
To restore the lathe behavior, it is not sufficient to program G54 to cancel the G53, but G134 KA1
or KA2 must be newly programmed.
The alarm CN1D14 PROGRAM ERROR is issued if the lathe is activated when every kind of
RTCP is active (G116, G117, G118, G120, G122), or if RTCP is activated when the lathe is active.
The G134 programming provokes also the acquisition of tool length corrections and origins, like
the L (milling) or LX and LZ (lathes) programming on a ISO line.
G113X is canceled on the switching mill-lathe with G134 KA1 or KA2 and restored on
subsequent lathe-mill switching with G134 KA0.
If G114 is disabled while lathe functionality is active, returning to mill behavior, G114 is restored,
and if G113X parameters have been changed during the lathe phase, the new parameters remain
active also in the mill phase.
Operation of G113 KA1
This functionality is reserved to machines where the mill axes X and Z are also used as lathe
axes.
The machining plane XZ valid for lathes must be activated (for example with G25XZY) before
the activation of lathe functionality, otherwise the alarm CN1D14 PROGRAM ERROR is issued.
If G53 is programmed in a forced lathe condition (for example during a tool change to refer the
positions to base origins) the machine returns a milling machine and G53 is considered “with stop”.
To restore the lathe behavior, it is not sufficient to program G54 to cancel the G53, but G134 KA1
must be newly programmed.
Operation of G113 KA2
This feature allows to activate the lathe functionality also if the XZ mill axes are not used as XZ
lathe axes.
General programming syntax:
G16… G134 KA2
A G16 programmed in the same line as G134 KA2 allows to define the name of the axes
designed to behave as XZ in a lathe.
D. ELECTRON 79
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
For example, suppose a mill having XYZ as main axes (logical numbers 0, 1, 2) desired to
operate as a lathe where:
- mill Y axis becomes the diameter axis of lathe (X axis of lathe)
- mill X axis becomes the longitudinal axis of lathe (Z axis of lathe)
- mill Z axis becomes a third axis of lathe (Y axis of lathe)
The following must be programmed:
G16ZXY G134 KA2
After executing this line, a lathe machine with XZ conventional axes is available, but
corresponding to Y and X axes of the milling machine; in this case it is therefore implicit also the
definition of the new XZ machining plane, like if, after G134 KA2, a G25XZ were programmed.
If other G16 or G25 were active before G113 KA2, they are frozen and automatically restored
when the G134 KA2 is canceled from G134 KA0, restoring the milling machine.
If G16 is not programmed with G134 KA2, it is like programming a G16 confirming the main
machine axes (or G16XYZ). Previously active G16 and G25 are frozen and restored with G134
KA0, also if G16 is not programmed.
Under JOG (activity 4) the physical axes defined in machine setup must be moved, also if G134
KA2 is active; in this case the axes redirection obtained with the G16 of G134 KA2 is not active.
80
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
TT and HX parameters are mandatory on the same line where G136 is programmed; if not
programmed the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
G136 is a function with stop. If programmed in a block with axes movements, it is executed
immediately after the movements, indpendently from its position on the line. Example:
G1 F5000 X100
G136 TT0.002 HX1
is fully equivalent to:
G1 F5000 X100 G136 TT0.002 HX1
or to:
G136 TT0.002 HX1 G1 F5000 X100
In all the above cases, the microdwell commanded with G136 is executed immediately after the
X100 movement.
The G136 function must be supported by the machine PLC. For further details, please consult
the machine tool builder.
D. ELECTRON 81
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
After G141 activation, all movements concerning at least one position of the tern chosen for
G141, must contain all three components of the vector orthogonal to the machining surface, also if
not changed from the preceding block.
In blocks subsequent to the G141 activation, positions not related to the G141 tern may also be
programmed.
In program lines following the G141 activation, blocks not containing any axes of the tern and no
component of the orthogonal vector are allowed.
Let us consider the following situation:
Z,Y,X = tern axes
A,B,C = other axes external to the tern
I,J,K = components of orthogonal vector
G141 Z Y X I1 ;correction for spherical milling tool, tip zeroed, ZYX tern with tool aligned
along X
....
X10 Y5 Z6 I0.707 J0.707 K0 ;correct line
X10 Y5 I0.707 J0.707 ;not correct line: K not programmed
A10 ;correct line; no tern axis is programmed, nor orthogonal vector components
B10 X5 Y10 Z9 I1 K0 ;not correct: orthogonal vector component J not programmed
.....
Deactivation
G141 is deactivated by programming G140, function without any parameter
G141 I2 ;activation
....
G140 ;deactivation
82
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- If the third axis of the chosen tern is not the axis parallel to the tool, the alarm CN7C14 G141:
TOOL AXIS NOT VALID is issued.
- If movements programmed when G141 is active contain at least a position related to an axis of
the tern, all three components of the orthogonal vector must be programmed, otherwise the alarm
CN2C14 INCOMPATIBLE PARAMETERS is issued.
- G141 may be programmed together with KA, which may assume only the values 0 (spherical
tool) or 1 (toroidal tool), otherwise the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
- By programming G141 KA0, the J parameter must not be programmed, or programmed = 0,
otherwise the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
In the G141 activation line, if the specified tern is not following G141, the alarm CN1D14
PROGRAM ERROR is issued.
D. ELECTRON 83
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
K, X, Y and Z are mutually exclusive, only one among KXYZ may be programmed.
F feed in mm/min. or inches/min. used to execute the displacement.
Deactivation
The function G143 deactivates G142. This G function is without parameters.
Notes:
- If G142 is programmed first in a part-program without any parameter, the values specified in
machine setup for retraction entity and execution feed are assumed. Please refer to the information
supplied by the machine tool builder.
- If G142 is programmed a second time without any parameter, after a G143, the function will be
reactivated with the preceding activation parameters.
- If active, G142 is applied on both feed and rapid movements.
- During a G142 movement, the travel limit management differs, depending if G142K… or G142
along a physical axis (X, Y, Z) has been programmed:
if G142X… or G142Y,,, or G142Z… has been programmed, the applied travel limit management
is the same of JOG movements: if the movement related to the G142 brings the axis outside travel
limits, the CNC automatically limits the movement to the travel limit, without completing it and
without issuing any alarm.
if G142K… has been programmed, the movement is executed by activating G117 (RTCP), thus
activating the real time travel limit management. If the programmed movement brings one or more
axes outside the travel limits, this movement is executed up to the first limit encountered, possibly
issuing a CNEx13 alarm.
- If G53 is programmed when G142 is active, the G142 function will be temporarily deactivated
and automatically reactivated on the next G54.
When the movement programmed by G142 has been executed, the CNC issues the alarm
CN7E14 (G142 EXECUTED); this alarm may be cleared only with a reset or a machine shut down.
- In case of process lock (see G128, G129, G130) the G142 on master process forces the same
G142 also on all connected slave processes, in the program section where the lock is active. If the
lock is not active, the G142 on the master process operates normally, without influencing the G142
on the other processes.
- During a process lock, if the G142 is programmed in the part-program of the slave process, the
function is temporarily disabled when the lock is active, and reactivated when the lock is no more
active.
- If an alarm CNxx13 is present when the G142 is activated, the related movement is anyway
executed. This is not true for alarms CNxx14.
- If one of the axes interested by G142 is not alive when the function is activated, the axis is
forced alive and restored as not alive at the end of the movement.
- If G142 is temporarily suspended by a G53 when the PLC activates the G142 procedure, the
CNC stops the axes, but the movement related to the G142 is not executed. In this condition the
alarm CN7E14 G142 EXECUTED is anyway issued,
84
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- If the tool is associated to an axis different from X, Y or Z when G142 is active, the CNC issues
the alarm CN7F14 G142: TOOL AXIS NOT VALID.
- G142 may be programmed only if a generalized G117 management (head RTCP) has been
defined in machine setup, otherwise the CNC issues the alarm CN5414 INCONSISTENT
MACHINE SETUP. Please consult the machine tool builder.
- The line where G142 is programmed cannot contain parameters different from X, Y, Z, K and
F, nor other G functions, otherwise the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
- The line where G142 is programmed may contain only one among X, Y, Z, K, otherwise the
alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
- The displacement value programmed with X, Y, Z or K may vary from –1000mm to +1000mm
(in inches machines, from –39.37 inches to +39.37 inches).
D. ELECTRON 85
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
If the segment at the end of which the G145 stop is programmed is shortened due to the effect
of radius correction, the stop is anyway executed at the end of the segment; if the segment is
skipped because of radius correction, the stop is transferred at the end of preceding segment.
86
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
2.1.96 G200 HX6 / G200 HX7 - low search feed change in G61
The low search feed in G61 is defined in machine setup.
With this function the low search feed may be modified by the part-program. Example:
G200 HX6 HY500
After this instruction, the low search feed in G61 becomes the 50% of setup feed.
The search feed defined in setup is multiplied by HY/1000.
HX must be programmed in the same line as G200, while HY may also be defined in preceding
lines. Example:
HY500
G200 HX6
Valid range for HY is from 0 to 1500. Therefore with G200 HX6, the low search feed defined in
setup may be decreased up to zero (in this case the search movement is not executed) or
increased up to 50%.
Values external to this range are limited to the extremes, therefore negative HY values act as
zero, while values greater than 1500 act as 1500.
The forcing of low search speed remains until part-program end, and is canceled by a reset or
program start.
D. ELECTRON 87
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
2.1.97 G200 HX8 / G200 HX9 - rigid tapping without spindle inversion
The rigid tapping function G63 considers the tool axis as always rigidly locked to the spindle,
which must invert its rotation at the end of the tapping, in order to return to the starting position.
Since some time, special fixtures exist, allowing a “semi-rigid” tapping with automatic rotation
direction inversion, thus avoiding the need to invert the spindle rotation.
Using these fixtures, the tapping cycle must be:
a) spindle rotation
b) starting of tapping axis and locking to the spindle rotation
c) tapping feed
d) axis inversion, without spindle inversion, with temporary sync loss and new lock in the
opposite direction
e) return to the starting point
It is possible to force the execution of this cycle, by programming G200 HX8 before G63, and to
return to the execution of standard tapping with G200 HX9. Example:
T57M6 (THREADING TAP WITH INVERSION, PITCH 2)
G200 HX8
...
G63 Z-50 K2
...
G63 Z-50 K2
...
T58M6 (RIGID THREADING TAP, PITCH 1)
G200 HX9
...
G63 Z-80 K1
...
At RESET and program beginning, the standard mode is active (rigid tapping with spindle
inversion, G200 HX9).
G200 HX8 is a modal function: it remains active until reset and may be deactivated with G200
HX9.
When G200 HX8 is active, the axis inversion time is double with respect to the soft approach
time defined in setup for the G63, because during the inversion a feed step from positive to
negative is generated, the double of the starting feed step going from zero to the positive feed.
88
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
In order to allow the user the possibility to test the feature, it is possible to activate the option for
a total 30 minutes period, by programming G200 HX10 in the part-program.
If the machine is licensed, G200 HX10 has no effect.
If the machine is not licensed, after a total 30 minutes working time is elapsed with G113X KA1
active, the alarm CN7814 is issued.
WARNING: the alarm may be issued also during the machining of a workpiece; use this
feature only for test purposes.
The 30 minutes period is a total machining time; it is not influenced by RESET, program change,
etc. When the period is elapsed, G113X KA1 cannot be used again.
The 30 minutes test period is restored only with a On/Off power cycle of the machine.
D. ELECTRON 89
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
If a canned cycle is called while another is active, the first cycle is canceled and overwritten with
the second.
MHA-MHZ = 26 float parameters, copied in ZFP[550]-ZFP[575]
These three letters parameters are not allocated in the Z32 memory with their programmed
values, but their value is simply transferred in corresponding ZFP[] parameters; parameters not
programmed have no effect on the corresponding ZFP[].
ZFP[550]-ZFP[599] are reserved for G800, but at this time, ZFP[576]-ZFP[599] are not used.
KA0 = resets all ZFP[550]-ZFP[599] parameters
G800 may be programmed in four different modes:
G800 Kn [MHA.. MHD..]
updates all ZFP corresponding to programmed parameters, reads from disk the cycle Cn, loads
it in subtemp 65 and activates it.
G800 KA0
clears all parameters reserved to G800: ZFP[550]-ZFP[599]
G800 [MHA.. MHB..]
updates all ZFP corresponding to programmed parameters
G800K0
equivalent to G27C0 + G800KA0, i.e. deactivates the canned cycle and resets all parameters
associated with G800 (ZFP[550] – ZFP[599])
Rules and limits:
- if other parameters, different from those listed above (G, M etc....), are programmed in the
same line as G800, the alarm CN1D14 PROGRAM ERROR is issued
- G800 must be programmed at the beginning of the ISO line, only blank characters may
precede it
G800 K1 MHB100 correct programming
G800 K1 MHB100 correct programming
K1 G800 MHB100 program error (CN1D14)
- if KA0 is programmed, no other parameter can be programmed on the line, otherwise the
alarm CN1D14 PROGRAM ERROR is issued:
G800 KA0 correct programming
G800 KA0 MHA100 program error (CN1D14)
G800 K1 KA0 program error (CN1D14)
- the value of MHA-MHZ parameters may be expressed with a number or with a valid Z32
expression (all MHA-MHZ are Z32 float)
- the value of K parameter (number of canned cycle to be loaded from disk) may only be
expressed with an integer number ranging from 1 to 9999 and not with an expression; if the number
specified is fractional, only the integer part is accepted, without signaling any error
- the value of KA parameter must always be equal to zero and may be expressed only with the
number 0 and not with an expression
- if an attempt is made to load a canned cycle not existent on the hard disk, the error CN8214
G800/1/2 PC FILE ERROR is issued
- if an attempt is made to load from the hard disk a canned cycle too large for the available
subtemp memory, the alarm CN8314 G800/1/2 MEMORY FULL is issued
90
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
- N.B. During the execution of a canned cycle called through G800, the lines of the cycle are not
displayed.
D. ELECTRON 91
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
- the value of KA parameter must always be equal to zero and may be expressed only with the
number 0 and not with an expression
- if an attempt is made to load a macro not existent on the hard disk, the error CN8214 G800/1/2
PC FILE ERROR is issued
- if an attempt is made to load from the hard disk a macro too large for the available subtemp
memory, the alarm CN8314 G800/1/2 MEMORY FULL is issued
- N.B. During the execution of a positioning macro called through G801, the lines of the macro
are not displayed.
92
D. ELECTRON
CNC Z32 Programming Manual Chapter 2 - Preparatory G Functions
equivalent to G27C0 + G802KA0, i.e. deactivates the canned cycle and resets all parameters
associated with G802 (ZFP[650] – ZFP[699]) and the ZFP[700] parameter (G802 HX1)
G802 [MHA.. MHB.. Axes..]
updates all ZFP corresponding to programmed parameters and clears the parameter ZFP[700]
(G802 HX1)
Rules and limits:
- if other parameters, different from those listed above (G, M etc....), are programmed in the
same line as G802, the alarm CN1D14 PROGRAM ERROR is issued
- G802 must be programmed at the beginning of the ISO line, only blank characters may
precede it
G802 K1 MMB100 correct programming
G802 K1 HX1 MMB100 correct programming
K1 G802 MHB100 program error (CN1D14)
- if KA0 is programmed, no other parameter can be programmed on the line, otherwise the
alarm CN1D14 PROGRAM ERROR is issued:
G802 KA0 correct programming
G802 KA0 MHA100 program error (CN1D14)
G802 K1 KA0 program error (CN1D14)
- HX1 may be programmed only if K is also programmed in the line, otherwise the alarm
CN1D14 PROGRAM ERROR is issued.
G802 K2 HX1 correct programming
G802 HX1 program error (CN1D14)
- the value of MMA-MMZ parameters may be expressed with a number or with a valid Z32
expression (all MMA-MMZ are Z32 float)
- the value of continuous axes programmed as parameters may be expressed with a number or
a valid Z32 expression
- the value of K parameter (number of macro to be loaded from disk) may only be expressed
with an integer number ranging from 1 to 9999 and not with an expression; if the number specified
is fractional, only the integer part is accepted, without signaling any error
- the value of KA parameter must always be equal to zero and may be expressed only with the
number 0 and not with an expression
- the value of HX parameter may be 0 or 1, and must be expressed only with the numbers 0 and
1 (no expressions allowed)
- if an attempt is made to load a macro not existent on the hard disk, the error CN8214 G800/1/2
PC FILE ERROR is issued
- if an attempt is made to load from the hard disk a macro too large for the available subtemp
memory, the alarm CN8314 G800/1/2 MEMORY FULL is issued
- N.B. During the execution of a machining macro called through G802, the lines of the macro
are not displayed.
D. ELECTRON 93
Chapter 2 - Preparatory G Functions CNC Z32 Programming Manual
94
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
CHAPTER 3
3.1.1 M “ISO
M0 - stop
Stops the execution of the program that can be resumed by pressing the start button.
Requires spindle stop and coolant stop.
M1 - conditional stop
Similar to M0, except that the effectiveness of M1 is conditioned by a special input of PLC:
contact the manufacturer of the machine tool for further details.
Requires spindle stop and coolant stop.
D. ELECTRON 95
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
M2 - end of program
Exit the CNC from “EXECUTION” mode and closes automatic operations
M3 - spindle clockwise
Requires spindle rotation to be clockwise at the S speed previously programmed
M4 - spindle counter-clockwise
Requires spindle rotation to be counter-clockwise at the S speed previously programmed
M5 - spindle stop
Requires the spindle to stop.
Stops the coolants as well.
M6 - tool change
Requires that the tool (programmed as T in the same block or in previous blocks) be
mounted on the spindle.
Stops the spindle and the coolants
After execution (not in block search) of an M6, the N/C acquires the description of the tool
mounted on the spindle then updates the parameters accordingly.
The updating of parameters in tool description occurs on exiting (G26) the tool change
subprogram (also see tool management)
M7 - dispense coolant n. 1
Requires that coolant n. 1 be dispensed.
M8 - dispense coolant n. 2
Requires that coolant n. 2 be dispensed.
M9 - stop coolants
Requires that coolant dispensing be stopped
M19 - spindle indexing
Requires that the spindle be indexed (oriented).
Also requires spindle and coolants stop
96
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
A special M can also be called from within a canned user or system cycle or from within another
special M. For example, it is possible to create a canned cycle containing the check of tool integrity
and to call tool change (M6 is special) even from within the canned cycle.
10 nesting The Z32 features up to 10 levels of nesting of jump and return.
levels
Each of the following operations counts as a level:
− GON…-N jump to a series of lines with return
− GOP… jump to a subprogram with return
− special M
− canned system or user cycle
Manufacturer’s Two levels are used by G110 (rough-machining macro-functions)
notes
Beyond the available levels there is the error: CN2E14 TOO MANY SUBROUTINES
Since special M’s are a typical means used by the machine tool manufacturer to personalize the
N/C, please refer to the information supplied by the manufacturer for a complete list and information
on the use of the special M’s.
3.3 FEED
According to ISO standards, address F is assigned the meaning of feedrate.
The feed is expressed in displayed integers per minute at the reset with G94, while with G95, it
is expressed in displayed integers per revolution, and with G93 it is expressed as the inverse of the
time (in min) necessary to execute the motion.
For example, in the case of linear axes with display in millimetres (and micron decimals),
programming F100 means 100 millimetres/minute.
In the case of rotary axes with display in degrees (and thousandths of degree), programming
F100 means 1000 degrees/minute.
D. ELECTRON 97
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
As is the case of any other parameters, F can be programmed with 9 significant digits before or
after the decimal comma or point. However, F has also the effect of setting the machining feedrate:
since the feedrates set must never exceed rapid feedrate, the N/C will limit the physical feedrate of
the axes according to the rapid feedrate of the axes involved in the movement and according to the
programmed movement.
In brief:
- during movements in G1, with override at 100%, and taking into account the inclination
of the movement, no axis must exceed the rapid feedrate divided by 1.2 (with override at
120%, the feedrate cannot exceed the rapid).
- During movement in G2/G3, the feed with 100% override cannot exceed the lowest of
the rapids of the axes of the working plan
Also see chapter “Preliminary G functions”, paragraphs regarding G1 and G2/G3.
The limits affect only the physical feedrate of the axes and not the F parameter that retains the
value programmed.
For example, the axes have:
X with rapid at 15 m/min
Y with rapid at 15 m/min
Z with rapid at 10 m/min
The following program generates the feedrates (on the path and with override at 100%) as
described in the comment:
...
N10 G0 X0 Y0 Z0
N11 G1 F5000 X100 Y100 Z100 (5000 mm/min)
N12 F10000 X0 Y0 (10000 mm/min)
N13 Z100 (8333 mm/min)
N14 X100 (10000 mm/min)
N15 F99000 X200 (12500 mm/min)
...
The minimum interpolation feedrate increment is about 0.01 units/minute (that is, 0.01
mm/minute in the case of linear axes).
3.4 SPEED
S is the spindle speed
As a parameter, S can be programmed with 9 significant digits, either before or after the decimal
comma or point.
The actual spindle speed is determined by the PLC.
Also refer to the information supplied by the manufacturer of the machine tool.
98
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
Axis dimensions are programmed using the axis name (a letter assigned to a continuous axis in
the machine settings) followed by a numeric value.
As a parameter, the dimensions can be programmed with 9 significant digits, either before or
after the decimal comma or point: one or more than one axes are driven outside from the working
field admitted by the machine, the CNC will signal an end of travel error.
Axis dimensions are programmed using the same units as the displayed integers.
For example, in the case of linear axes where millimetres (and microns as third decimal) are
displayed, programming X100,25 means programming 100,25 millimetres.
In the case of rotary axes where degrees (and thousandths of degree) are displayed,
programming A10.47 means programming 10.47 degrees.
On the same machine axes, even when simultaneously active, can be defined using different
units (for example, millimetres for linear axes and degrees for rotary axes).
The three axes of the machining triad can be programmed using their names (for example X, Y,
Z, etc.) or respectively as:
AA... first axis of the machining triad
AB... second axis of the machining triad
AC... third axis of the machining triad
For example if at a certain point of the execution of a program, the XYZ triad is active (that is,
G25XYZ), programming AA100 AC125 is the same as programming X100 Z125.
If, on the contrary, the ZXY triad were active (G25ZXY) it would have been the same as
programming Z100 Y125. This opportunity is very useful for canned cycles and for standard
subprograms that can be completely defined in generic form regardless of the machining triad in
which they will be used.
Also see chapter “Preliminary G Functions”, paragraph on G25 – Working Triad - for more
information on axes orientation.
D. ELECTRON 99
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
SUPPLEMENTARY ORIGIN
PROGRAMMED POINT
BASE ORIGIN
TRANSDUCERS ZERO
3.6.1 Origins
Address O informs Z32 that an additional origin has been programmed.
After O, no numeric value must be programmed but, as explained later, a combination of letters
that identify the origin to be activated.
The origin of interest to the programmer can be, for example, a point to which the
measurements of the drawing refer. This origin may also vary even within the same program, for
example because two different workpieces mounted on the same table or different faces of a piece
are to be machined, etc.
The programmed distance values must always be referred to that origin. The working origins
available for the programmer (SUPPLEMENTARY ORIGINS) are contained in the origin table that
can be found in the ‘global’ number 126 file, or as a ‘local’ section at the end of the part-program.
Origins in The global section is active upon reset and can be restored using G37OG. The various ‘local’
table sections are enabled by entering G37OL in the program or subprogram containing the section that
Local is to be activated.
origins Please note that if G37… and the origin are programmed in the same line, G37 must precede
the origin:
N1 G37OL OX1
The X1 origin is read in the local file.
An origin section, either global or local, starts the line with :OS
The following lines define each origin, which are identified by the axis name to which they refer
followed by any printable character, except space and zero (reserved to the base origin only).
For example, we can define:
:OS
X1=20,47
Y4=+17,381
Y?=-11
XA=-318,963
The origin is acknowledged only if the origin string (for example Y1=32.5) is at the beginning of
the line or is preceded only by blanks.
The definition of the origin terminates with the first blank or open round bracket or end of line
characters (0dh), any other successive character is ignored.
For each axis and for each program about 50 different origins can therefore be defined.
The printable characters can be any of the following:
a) 9 numbers
b) 26 alphabetical characters
c) about another 25 characters such as + - ‘;# ( and others)
100
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
We do not recommend using an asterisk "*" as this has the meaning of active origin during
reading and writing (:R and :W, see evolved lines).
The origin table uses memory according to its content and undefined origins do not occupy any
memory.
To make things easier for the operator, the origin table can be preceded by a description or by a
comment.
This is an example of origin table:
SUPPLEMENTARY ORIGIN TABLE-PIECE 4782-
:OS
X1=20,47
Y4=+17,381
Y?=-11
XA=-318,963
.....
Programming To call origins within a program, the following must be programmed:
− the letter ‘O’
− the name of the axis involved
− the character identifying the origin
For example, if the above origin table is present and active, the command OX1 OY1 means
referring the dimensions of the X axis to the point X = 381 and the dimensions of the Y axis to the
point –27.38.
When programming the origins, a stop is required (please refer to chapter “Preliminary G
functions” – paragraph G functions).
At reset, depending on the machine settings, the following can be active:
− zero origins (base)
− the last active origins
− origins 1 (OX1 etc.) on all the axes.
To cancel the supplementary origin correction the zero origin can be programmed. For example,
the command OX0 OY0 means: cancel the supplementary origins regarding axes X and Y: after
this instruction the NC refers the dimensions of these axes to the base origin.
Even if already defined in the origin table, for example X0=100, as soon as the CNC encounters
an OX0 instruction, it will cancel the additional origins and ignore any OX0 defined in the origin
table.
Function G53 (that is cancelled by G54) stops the effect of the supplementary origins and
activates the base ones.
D. ELECTRON 101
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
The axis involved in the tool length is defined by G43 (positive correction) or by G44 (negative
correction).
Tool length L can be either positive or negative.
Length correction can be:
− cancelled by programming L0 in an ISO line
− suspended using G45 (restored by G43/G44)
− suspended together with the origins using G53 (restored by G54
102
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
Warning: the usage of these parameters may contrast with the PLC, if the PLC is managing a
tool radius change (ZZRAYNEW variable). Consult and agree with the machine tool builder.
The actual value for L and R used by Z32 is the value of L+DDL and R+DDR.
In position display, L is recomputed if L or DDL are programmed in a ISO line (but not if
programmed in an evolved line, as explained for L in the paragraph “Tool length”); it is therefore
better to always program DDL in a SIO line to immediately obtain its full functionality.
Also DDR should be programmed in an ISO line, in order to immediately obtain its full
functionality, thus limiting possible incompatibilities with the PLC.
3.7 PARAMETERS
As already mentioned, many machine functions are programmed using one or two alphabetical
characters followed by a numeric value, for example: X100.
Besides the above-listed addresses corresponding to special functions many other two-letter
combinations are possible. These addresses identify an entity we shall call a “parameter” the value
of which is stored in the Z32 memory for later use.
The addresses of specific machine functions (except for N, G, O) also correspond to numeric
values in the Z32 memory. These are updated as the program is running. These entities too can be
considered “parameters”.
In the example, after analysing the X100 instruction (also see chapter “Execution of an ISO
line”), the Z32 will contain the value 100 in the location assigned to X. The programming of X also
implies that the X axis will have to be moved, but, in the meantime, the programmed value was
written in the location corresponding to X.
The value of 100 assigned to the X parameter is stored in the memory of the Z32 until a different
value is assigned to X, and can therefore be used later for other scopes than making the axis go to
the distance 100.
The parameters are identified by an “address” (X in the previous example) that can have 1, 2 or
3 characters or by parameters having a PAR[], PAL[] or ZPF[] index. In the Z32 memory, there are
locations for the following groups of parameters:
1) AXES NAMES
2) SYSTEM PARAMETERS
3) USER’S PARAMETERS
4) PARAMETERS WITH INDEX
5) THREE LETTERS PARAMETERS
All the parameters are process parameters, that is, all of them can be used in any process.
D. ELECTRON 103
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
104
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
D.ELECTRON may define other parameters in the future to extend the software performances
of the Z32.
Max 60 The operator can define a maximum of 60 “literal parameters” inside a part-program (formed of
parameters one or two alphabetic characters) and parameters with index as described in the next paragraph.
Parameter symbols can be a combination of one or two printable characters, except for:
Parameters − BLANK cannot be used
in letters
− NUMBERS cannot be used
− characters ! $ % ( ) * + , - . / ; < = > cannot be used.
− the first character must not be any of the following ones: G N O
− the following combinations are forbidden, because they have other meanings:
AA AB AC first axis, second axis, third axis
RQ SN CS AT square root, sin, cos, arc-tang.
PI PI constant (=3,14159…)
PC CP Cartesian/polar conversion and inverse
IF conditioning
EB evolved line interruption
- Capital letters are accepted (though not recommended for clarity reasons).
To avoid problems, we suggest using for parameters alphabetical letters only.
Numerous other combinations are possible: some of these are used by the manufacturer of the
machine tool for canned cycles, standard sub-programs, macro-instructions, etc. The operator can
use these sub-programs as they are, without problems, provided the symbols used in the said sub-
programs are not used in the main programs that use them.
In case of canned cycle, we have the following meanings:
HA hole beginning
HB hole end
HC long exit hole
D. ELECTRON 105
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
HD working diameter
HE canned cycle internal use
HF canned cycle internal use
HG canned cycle internal use
HH canned cycle internal use
HJ canned cycle internal use
D. ELECTRON will possibly use symbols beginning with H in standard subprograms.
The final user can use symbols used in sub-programs, but he must know that, after executing
the sub-program, values pertaining to these parameters will be modified. (Therefore not
recommended).
106
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
The parameters that can only be accessed through system subprograms are undistinguishable
from parameters accessible through user subprograms, with possible interference.
For this reason, 156 parameters have been reserved for system subprograms.
These parameters have a three-character address (not allowed by the previous releases of the
software, therefore they cannot be mistaken) with these specifications:
- the second character is a capital letter from “A” to “F” (six possibilities)
These parameters can be used the same way as all the other parameters, both in ISO and
evolved lines.
Using these parameters does not increase the number of parameters used by the part-program
(if the number of 60 parameters is exceeded, the CN4B14 TOO MANY PARAMETERS alarm is
released).
D. ELECTRON 107
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
The value of the parameters stored in the Z32 memory is always the last parameter
programmed (in ISO or evolved line).
Current positions remain those previously programmed even if, due to various circumstances
(radius and length compensation, origins, roto-traslations, etc.) values really reached are different
from those programmed.
TA and TB (present and future place of the tool) are exceptions and are directly up-dated by
Z32 after programming a T instruction or a tool change operation.
Inside an ISO line, the operator can give values to any parameters, in order to use them for
future processing. E.g.:
X10 XA12 XB14 XC-20
to parameters X, XA, XB, XC are assigned values 10, 12, 14, -20.
By programming X axis you will have a movement of the X axis to the programmed value; the
programming of XA XB and XC will not produce any movement: parameters will be up-dated, and
they will be added to the list of parameters if they are met for the first time.
If the CNC meets a parameter, which has never been defined before, it will not display an alarm
message, but it will consider the value of that unknown parameter as equal to zero.
During the execution programmer can define a maximum of 60 parameters, but if one of them is
equal to zero, it will be not counted in the 60.
In other words, if a parameter has value = 0, it will be removed from the list of known parameters
and considered as never having been defined. This operation will not produce any errors, because
the CNC gives to undefined parameter the value = 0.
If necessary, therefore, the operator can cancel the parameters from the list of known
parameters, assigning to them value 0. This procedure is recommended above all inside standard
sub-programs (of manufacturer or end user) for parameters used as support for intermediate
results to reduce the number of parameters used.
108
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
For example:
X<100-R>
This means that X parameter takes the value of 100 minus the tool radius value (unknown at the
time of programming) and X axis must move according to the result of this expression.
The same parameter to which the result will be given can be called in the expression. During
the expression the value of the parameter is that previous to the calculation of the expression.
E.g.:
X<X*X> to raise X to square
X<X-10 to subtract 10 from X
X<PAR[1]+PAR[0]> to add two PAR parameters
X<X+PAR[[PAR[0]]> to add PAR with PAR[0] index to X
For example the following syntax is valid (but we advice not to over-complicate!):
HX<12*HA/PAR[HA+PAR[HB+1]]>
Multiplication and division operations have priority over addition and subtraction operations.
e.g.:
3+4*2 = 3+8 = 11
4*2+3 = 8+3 = 11
4*2+2*7*3 = 8+42 = 50
Brackets can be used to force a priority in the execution of operations. E.g.:
(3+4)*2 = 7*2 = 14
4*(2+3) = 4*5 = 20
4*(2+2*7)*3 = 4*(2+14)*3 = 4*16*3 = 192
10 levels of brackets are available. The following expression has 2 levels of brackets:
3+(2+3)*5-4/(5-3))*2 = 3+(5*5-4/2)*2 = 3+(25-2)*2 = 3+23*2 = 3+46 = 49
Brackets must first be opened and then closed, and all closed within the expression. The
following expressions are wrong:
3+(2 * 3 a closing bracket is missing
(3+2)*3) too many closing brackets
3)+(2 bracket closed first and then opened
It is allowed to begin an expression or a bracket level with ‘+’ or ‘-’. e.g.:
-3*(-2*4+3) = -3*(-8+3) = -3*(-5) = +15
RQ (square root), SN (sine), CS (cosine) and AT (arc-tang) are applied to the value, to the
parameter, or to the result of the brackets that immediately follows.
E.g.:
RQ16*2=4*2=8
RQ(X*X+Y*Y)=RQ(16+9)=RQ25=5 (for X=4, Y=3)
Values pertaining to SN, CS and AT operations are expressed in degrees and decimal fractions
of degrees.
E.g.:
SN30 = 0,5
AT1 = 45
Numerical calculations are done in a floating point with about 9 significant figures and a 10
exponent ranging from -16000 (a number with 16,000 zeroes after the decimal point) to +16,000 (a
number with 16,000 digits before the decimal point).
D. ELECTRON 109
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
To simplify calculations and to avoid machine stops, the exceptions are brought back to
permissible operations.
In particular:
1. the result of the division of a number by zero will be the maximum (number with
16,000 figures), which represents infinity. The sign is the right one.
2. the result of dividing zero by zero will be zero.
3. if the result of an operation exceeds the maximum (overflow), the result will be taken
back to the maximum (16000 figures).
4. if the result of an operation is less than the minimum (underflow, 16000 zeroes after
comma), the result will be forced to zero.
5. the square root of a negative number is the square root of its absolute value.
6. the sine and cosine of a large number (more than about 6 figures) are forced to zero
and 1 respectively.
110
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
The parameters #, #A and #B ÷ #Q can be read by ML logic in synchronized time and can be
programmed also in radius compensation only if programmed in ISO line.
If they are used in evolved line, they will behave like any other parameter.
Please refer to manual M99 – Programmable Logic for examples and clarification
(ZZVALCAN[1] and] ZZVALSUP[15]).
D. ELECTRON 111
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
This example is provocative and is useful to carefully consider the decimals usage. On a first
examination, the result seems to be HX=10, but this is not true: the result will be 9, but it is not a
“sure” result because it depends on roundings made on the least significant digit of internal
formats representing the numbers.
In fact the internal Z32 number representation is binary, and in binary format the value 0.1
cannot be exactly represented. It is the same situation arising in our normal decimal system with
periodic numbers: 20/3 is equivalent to 6.66666… but cannot be represented with a finite number of
digits.
Therefore, in a binary system, the result of 100*0.1, where 0.1 is approximated with a finite
number of digits, produces a result not exactly 10, but a little bit less, like in a decimal system where
3*6.66666 doesn’t produce 20, but 19.99998.
Therefore, the truncation operated by INT doesn’t produce the expected integer, but one less (9
instead of 10 in the bynary example and 19 instead of 20 in the decimal system).
The programmer must pay attention because the result depends on very marginal conditions,
not easy to forecast. For example, in a decimal system, if 20/3 were approximated with 6.66667, the
multiplication by 3 would produce 20.00001, and the INT result were 20.
In this case , the NEI function produces a completely certain result:
HA.1 HX<NEI(HA*100)>
The result is certainly 10, because the internal computations are made with very high precision
and the error is very much lower than 0.5, representing the “tolerance range”.
But pay attention: also the NEI function may produce uncertain results if the value is around 0.5.
Example:
HA.1 HX<NEI(HA*5)>
The result may be 0 or 1, depending on computing approximations.
It is important to note that if a programs operates correctly, but in marginal conditions, it may be
subject to errors using only slightly different parameters, or (very important) with future versions of
Z32 software, possibly operating different approximations.
It is recommended to be very careful in considering computing approximations and to avoid
“marginal” tolerance conditions, possibly bringing to uncertain results, depending on small
parameter or operating conditions changing.
112
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
Example:
--IF RST(0) >= 1094
(instruction 1)
--ELSE
(instruction 2)
--END IF
instruction1 is executed if the software version is at least T109-4, otherwise instruction2 is
executed.
D. ELECTRON 113
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
--ELSEIF RST(3) = 2
ERREUR, VALEUR DE HA TROP GRAND
--ELSE
ERROR, VALUE OF HA TOO HIGH
--END IF
Displays an error message in three languages, Italian or French, if defined in setup, otherwise in
English if any other language was defined.
114
D. ELECTRON
CNC Z32 Programming Manual Chapter 3 - M Function, Feed, Speed, Origins, Parameters
HX assumes the value +176 (the tangent of +10 is 0.176327, thus NEI is applied to 176.327).
Nota that this is a “certain” result because the uncertainty NEI point would be 176.5, with a
consequent very large tolerance range.
D. ELECTRON 115
Chapter 3 - M Function, Feed, Speed, Origins, Parameters CNC Z32 Programming Manual
116
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
CHAPTER 4
PROCESS 0 1 2 3 4 5
PARAMETER TABLE 125 122 119 116 113 110
ORIGIN TABLE 126 123 120 117 114 111
TOOL TABLE 127 124 121 118 115 112
We suggest care in using ‘local’ sections, which must be used only when necessary and in
agreement with the manufacturer.
On reset, the ‘global’ section is active. G37TL instruction activates ‘local’ sections while G37TG
resets the ‘global’ section.
The active sections of the tool tables start with the line: ’:TL’
:TL Starting from the line following the ‘:TL’ line, the operator can edit the tool lines containing ‘T’,
the tool number and its description with a total number of 247 characters; lines with a higher
number of characters will provoke the release of the CN1D14 alarm when the tool is in the chuck.
The tool table uses the memory space necessary for tools actually described: tools not entered,
do not occupy any memory space.
Example of tool description line:
T231#34L100R20
tool no. 231, place 34, length 100, radius 20.
Every description line must begin with the letter ‘T’, followed by the tool number (up to 9 integral
decimal digits the initial zeroes must be omitted) and by the sign ‘#’
In our case‘T231#’.
IT IS IMPORTANT that there be no spaces between T and # and that the initial zeroes be
omitted, otherwise the CNC will not recognise the programmed tool.
The zero tool is edited as ‘T0#...’ (only one zero).
# The number following ‘#’ identifies the position of the tool in the tool magazine, which will be sent
Place to the PLC for the search procedure. In our case ‘34’. The initial zeroes of the position may be
omitted.
After that, the programmer can enter some instructions in the same way as an ISO line is
programmed (tool description). In this case ‘L100R20’..
The CNC will normally execute these instructions when the tool changes, as if they were in a line
following that of tool change.
The execution of the tool description leads to the assigning of the value 100 to the L parameter
and the value of 20 the R parameter.
D. ELECTRON 117
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
The tool description is as effective as an ISO line containing the same instructions: by
Length
programming L in the tool description, the tool length and origin compensation will be calculated
again. The execution of the tool description line occurs on exiting (G26) the tool change
subprogram. On the final G26 of the subprogram, the description of the tool in the chuck is
executed, with the initialisation of parameters contained in the description (see chapter concerning
origins).
In the tool description, the programmer can enter other functions (F, S, M,...) to reduce
programming.
One or more tools with an identical ‘place’ can be listed in the tool table: the operator can easily
manage multipurpose tools, because the different uses of the same tool will be marked by a
different ‘T’ but with an identical ‘# place’. The tool description may be different in one or more
parameters, in order to exactly describe the features of the tool to be used.
There will be a limitation to the multiple definition of the same tool in case of ‘random’ tool
change. Please refer to the paragraph “Multipurpose Tools and Random Management”.
The tool is programmed in the part-program with T parameter followed by a number of four
figures. Leading zeroes can be omitted (but it is not necessary).
E.g.:
T1234 indicates that tool no. 1234 is programmed
When programming T, stop is requested. Please refer to chapter “Preparatory G Functions”,
paragraph “G Functions”.
By programming T, the operator asks the CNC to communicate to the PLC the future tool, but
this will not immediately trigger the tool change, which will be performed by entering M6 instruction
in the same line or in following lines.
Tools do not need to be edited in an increasing T sequence, but it is useful to allow a better
consultation.
E.g.:
:TL
T471#32 L100 R20(MILL D40 HSS)
T472#32 L50 R30 (physically no. 471, with different correctors)
T371#16
T12#27(DRILL D10 HSS) L80 R5 S1000 F200
...
For correct system functioning, Z32 must always know which tool is placed on the spindle, even
when passing from one program to another, and after shutting off. As the tool placed on the spindle
can be from a global section or local sections, Z32 must know:
− the number of the T tool
− the number of the file that contains the section the tool comes from.
This information is memorized by Z32 in the first line of the global file no. 127. E.g.: if the first
line of table contains:
T12P3 the T12 tool, coming from program no. 3, is placed on the spindle.
If the P instruction is not included, the tool will be considered as coming from global table.
The first line of the table is automatically up-dated by the CNC, every time a tool change
operation is performed: the operator can modify that line in case of manual operations.
When the operator writes a brand new tool table, he needs to insert this first line, every time,
even if the spindle is empty (ask the manufacturer for the tool number usually assigned to null tool–
usually T0 or T1).
If tool table is missing, the CNC will display the alarm message:
118
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
REMARK
This example has to be considered as only didactic: the final user shall
follow instructions given by the manufacturer of the machine tool.
D. ELECTRON 119
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
120
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
T100M6
L<LX>R<RX>
...
With the above very simple management the instructions “:R” or “:W” that read and write the ‘R’
and ‘L’ parameters may access only to a couple of correctors.
If this limitation has to be eliminated we may write:
TOOL TABLE
...
T100#...L0 R0 LX100 RX30 LY150 RY20
...
PROGRAM
..
T100 M6
L<LX> R<RX>
... here LX and RX are operating
!:WSLX=L,RX=R! at the end, LX and RX are restored
T200 M6
...
T100 M6
L<LY> R<RY>
!:WSL=L,R=R!
... here LY and RY are operating
!:WSLY=L,RY=R!
...
In different words, after tool change the desired pair is written in the tool description. Before
returning the tool to the tool magazine, the pair of correctors will be up-dated according to what is
written in L and R: the result of any macro-instructions modifying L or R will be saved in
PERMANENT MEMORY.
D. ELECTRON 121
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
When a tool is completely worn out, it can be replaced by another in tool magazine: the worn out
tool description includes the TS parameter which identifies the replacement tool. Several
replacement tools can be put on chain. The last of the chain has TS = 0. When the last tool of the
chain is completely worn out, the CNC will show an alarm message:
TOOL TABLE
...
T10#...R..L..TS11 US1000 (it can be replaced by T11)
T11#...R..L..TS12US905 (partially worn out-to be replaced by T12)
T12#...R..L..TS0 US1000 (last of the T10 chain)
...
T20#...R..L..TS0 US1000 (it has no replacement)
...
PART-PROGRAM
...%
N1 HU0 T10 M6 manufacture with T10 tool: after 120 changes the
tool is worn out.
N100 HU8.34 T30 M6
...
M6 SPECIAL SUB-PROGRAM
... searching for replacement tools, also in block search
procedure
N1 !:RT US=US!IF US>0;GO//N5!:RT TS=TS
N2 !IF TS<=0;NO SUBSTITUTIVE TOOL
N3 T<TS>
N4 !GON1! (it repeats, searching for a good tool)
//N5 !GON7! (in block search procedure tool wear is not up-dated)
N6 !IF HU=0;EB!:RS US=US!US=US-HU!:WS US=US!
(it up-dates previous tool wear condition)
N7... (continuing with normal change)
122
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
D. ELECTRON 123
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
The active tool is described in the heading of the global tool file (file 127 if process zero) together
with the origin program. For example:
T4P127
means that the T4 tool in the global table of file 127 is active.
If the tool is not the first in the family, this fact is also reported in the global file heading:
T4P127J3
means that the 3rd tool of the T4 family in the global file 127 is active.
If the tool is the first of the family, the J parameter will not appear, even though the family has
other members. Therefore:
T4P127
means that the first or the only tool of the T4 family in file 127 is active.
Access to the family member from the part-program with :R and :W
The fields of the evolved line :R and :W grant access to the parameters contained in the tool
description.
The programmed tool or the active tool can be accessed correctly even though they are not the
first family member.
Modification of tool parameters from task 4
The modification of the tool parameters, for example:
4 ENTERS L:0
is carried out easily without the need for special procedures: the tool is active, and can be
searched for even if it is not the first family member.
Access to the member from DTO, task 4 and 5
It is possible to enter the tool origin file and its position in the family, for example:
4 ENTERS DT42P127J2L+.1
J is followed by the position in the family.
124
D. ELECTRON
CNC Z32 Programming Manual Chapter 4 - Tools - Execution of ISO Line
D. ELECTRON 125
Chapter 4 - Tools - Execution of ISO Line CNC Z32 Programming Manual
126
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
CHAPTER 5
Fields are performed in the order in which they are written. The following paragraphs provide
details about the instructions that may be enclosed in an evolved line field.
D. ELECTRON 127
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
If the operator subsequently enters, in an ISO line, the instruction X<X>, the value given to X in
the evolved line is confirmed and the movement is obtained.
5.2 JUMPS
Five types of jump instructions are possible:
− jump to a line without return (GON...)
− jump to a series of lines with return (GON...-N...)
− jump to a sub-program with return (GOP...)
− jump to a line inside a subprogram (GOP…-N…)
− jump to a series of lines inside a subprogram (GOP…-N…-N…)
The line number or the program number can be made into parameters (see specific paragraph
further on in this chapter).
128
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
D. ELECTRON 129
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
N20: a jump to N15 is conditioned by a parameter: until the jump to N20 is performed there is no
return from lines N10-N20; when the jump is no longer performed (HA = 10), the CNC
returns to N31.
We suggest this feature be used only by experienced programmers: initially, it is advisable to
avoid jumps from the end line of a series of lines.
The previous program could be more clearly edited as follows:
N10 G0 X0
...
N20 !HA=HA+1!IFHA<10;GON15!
N21
...
N30 ! GON10-N21 !
N31 ...
By adding an empty line (N21) as end line, any misunderstanding on Z32 behaviour is avoided.
If, instead, the end line includes an implicit jump (a canned cycle or a special M function, for
example), the return from the series of line will be done after performing the service sub-program.
E.g.:
...
N9 G27C1
N10 G0 X50 Y10
...
N20 X65 Y20
...
N29 G27C4
N30 ! GON10-N20!
N31 ...
Line N20 includes an implicit jump to the canned cycle (canned cycle no. 1 on the first running
and canned cycle no. 4 on the second): on the second running, the CNC will regularly perform the
jump to the canned cycle sub-program and, after finishing the canned cycle, the CNC will return to
N31.
10 nesting The end line can also coincide with the beginning one: the CNC will perform an only line.
levels Jumps with return can be executed inside other jumps with return, up to 10 levels. Beyond this
limit, the CNC will display an alarm message: CN2E14 TOO MANY SUBROUTINES.
The CNC considers the following as jumps with return (a level of nesting is used):
- GON...-N... jump to a series of lines
- GOP... jump to sub-program
- special M
- G27C... system or user’s canned cycle
- G27P... permanent sub-program
The level number decreases by 1 every time there is a return from a sub-program or a series of
lines: it is normally impossible to reach the maximum allowed.
G110 (rough-machining macrofunctions) uses two levels.
The following example describes how the operator can call for series of instructions.
The purpose of this program is to dig a rectangular window, with a path of the cutter centre as
showed in the picture. The tool has to pass two times, increasing Z by 5 mm.
%
130
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
Please note that, during the execution of N12, the CNC meets another jump with return: this
means the program in the example has two levels of nesting.
It should be noted that the return from a series of lines is performed only if the end line does not
contain an explicit jump that has to be performed (with ‘GO’)
The ‘EB’ instruction and implicit jumps to sub-programs (canned cycle, special M...), even
though performed, will not prevent the CNC from coming back from series of lines.
Example of a incorrect program:
N1!GON10-N30!
...
N10X0
N20Y10
N30!GON56!
...
Return from line N30 will never be performed, as the line will be interrupted due to a jump to
another line.
D. ELECTRON 131
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
132
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
Main Program:
...
D. ELECTRON 133
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
A very long part-program has to executed, as a result requiring the DNC mode. This program
should include the possibility of being interrupted at some certain points whenever required by the
machine’s PLC. The PLC provides the PAL[5]=64 parameter in the case that the program must be
interrupted.
The following line must be entered in the part-program executable in DNC mode:
134
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
...
!IF PAL[5]=64;G26!
or:
...
!IF PAL[5]<>64;EB!G26!
Similarly to the jumps GO... if G26 is executed, the following fields will be ignored, and the
line will not be recognised as the final line of a jump GON...-N...
The G26 field must end with an exclamation mark and must not include blanks, otherwise it
will not be recognised and a program alarm will be released.
5.3 CONDITIONING
This instruction orders Z32 to execute or not execute the following fields separated by character
‘;’ up to the first ‘!’ character, according to whether or not conditions are verified.
e.g.
!IF (expr.1)<=>(expr.2);(field A);( field B);...!( field C)!
Meaning: if the value pertaining to expression no. 1 is less, equal or greater (only one or two
conditions can be used) than the value of expression no. 2, go on performing the next field (A),
otherwise jump to the first ‘!’ character and continue with the next field (C).
Examples:
N12 !IF X >= 3;GON30!
if X is greater or equal to 3, jump to N30, otherwise go on with the next line (there are no further
fields).
N12!IFAA<>2;GON30!GON47!
if AA is different from 2, jump to N30, otherwise jump to N47.
N12!XA=XA+1!IFXA>5;XA=5!
increase XA of 1; if the result is more than 5, set XA=5
N12 !IF R=5;EB! R=R-1,5;IF R<5 ;R=5!GON1-N11!
If R=5, go on with the next line (EB), otherwise decrease R of 1,5: if the result is less than 5,
bring R back to value=5, then repeat lines from no. 1 to no. 11 with the new R. This line allows the
repetition of a succession of lines with the R parameters, decreasing of 1,5 its original value, limiting
R to a minimum of 5. After the last pass with R=5, the CNC will go on.
N12!IFX<10;IFY<10;EB!GON63!
if X is less than 10 and Y is less than 10, go on; otherwise jump to N63.
N1X10
...
N10 !R=R-1!IF R = 5;GON3!
...
N20!GON1-N10!
D. ELECTRON 135
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
Repeat lines from no. 1 to no. 10. Please note that the end line has a jump, conditioned by R=5:
the return from N10 will be performed only when the cycle is terminated, that is when the jump
GON3 is not performed because it has become R<5.
WARNING
‘=’ condition will be verified if the two results are identical up to to the last
decimals. Since the required approximations can lead to errors on last
decimals, we suggest using the ‘<=’ or ‘>=’ conditions in place of ‘=’.
E.g.:
...
N10 Z10
N11 ...
...
N20!Z=Z-0.1!IFZ=0;GON30!
N21 ...
N22 ! GON11 !
...
N30 ...
In N20 line the operator must use Z=0 to jump to N30, but the program does not run because
there are some approximations. Binary 0.1 (Z32 performs all calculations in binary code) is a
periodic number and therefore approximated.
The correct way to program is to include in N20 the ‘<=’ condition, which can always be found.
136
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
This operation is obtained through an evolved line field. By executing this field, Z32 makes the
CMOS memorized parameter equal to that of the program.
The figure shows the general syntax of the field.
‘:R’ means read by CMOS in the part-program parameter. ‘:W’ means write in CMOS by
parameter or by part-program mathematical expression (which can be a constant in a simpler
case).
CMOS memory can represent:
− parameter section
− origin section
− a parameter of the programmed tool description (T)
− a parameter of the description of the tool on the spindle (S)
The symbol of the part-program parameter can have one or 2 characters (numbers not allowed),
or system parameters DDL and DDR, following the rules described in the paragraph concerning
parameters. That of CMOS memory always has two characters (when parameters or origins), while
it can have one or two characters or system parameters DDL and DDR, when it is a tool
description.
If, in the CMOS section involved, the indicated parameter does not exist, the CNC will display an
error message: CN1D14. If, instead, the parameter does not exist in the memory of the part-
program, it will be created with zero value.
The symbol of the parameter in CMOS can be the same as, or different from, that one of the
parameter in memory (remember that the symbol of the parameter in work memory cannot include
digits).
The highest number that can be written is 999999,999 (six full numbers and three decimals); if
the number to the written is greater than the maximum the maximum number is written.
E.g.:
!:ROX1=HA! reads OX1 in the HA parameter
!HA=50!:WOX1=HA! makes OX1=50
!:WOX1<50>! also this expression makes OX1=50
!:ROX1=HA!HA=HA+5!:WOX1=HA! moves OX1 origin by 5mm
!:ROX1=HA!:WOX1<HA+5*X>! as above.
!:WTL<50,5>! makes L=50,5 for the programmed tool
A writing operation in the permanent memory consists of various operations, which can be
interrupted by a reset or a power drop. In this case, in the involved file, the line will be split into two
parts immediately after the address of the incomplete parameter: if the operator uses that
D. ELECTRON 137
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
parameter (CMOS memorized) another time, the CNC will show an alarm message (CN...). The
operator has to restore in memory the correct parameter.
WARNING
Local parameter-origin-tool sections from part-program must not be
written if several part-programs can act simultaneously on the same local
section.
138
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
!:WS#=HA!
which modifies the place of the tool on the spindle.
WARNING
Local parameter-origin-tool sections from part-program must not be
written if several part-programs can act simultaneously on the same local
section.
WARNING
This operation (tool place modification) is to be performed by the
manufacturer of the machine tool in his special sub-programs.
An incorrect modification can lead to collision when changing the tool.
5.5 OTHER
D. ELECTRON 139
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
140
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
WARNING
A file loaded using :L can be edited (using option 5), but the results will
stay valid as long as the NC is powered; results are not guaranteed when
the PC is switched off and then on again, the file will be null.
The following error messages have been added for :L:
CN4E14 :L DISK FILE ERROR
Informs that the DOS program found a reading error while accessing the selected file.
There is no other detail on the error that may be due to number of reasons: file or directory not
found, disk not ready, error during access to disk, and others. It is up to the operator to correct this
error.
CN4F14 :L Z32 FILE ERROR
Informs that Z32 found an error while writing the file. Here too there are no further details.
The error may be due to a number of causes: memory full, file used by the Z32, writing error,
etc. In this case too, the operator must correct the error.
CN5014 UNKNOWN :L ERROR
Informs that an error occurred during the dialog between Z32 and the supporting program.
If the DOS program is correct, this type of error should never occur.
D. ELECTRON 141
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
This trick works if the programs contain functions with stop (just an M, a G4 wait…) or if they are
long enough (to stay on the safe side, at least 200 blocks).
Of course, more than two programs may be involved until we obtain the desired length
2) by inserting a stop function
for example:
!:L 10 -C:\PPG\OP3244.1!GOP10!
G112
!:L 10 -C:\PPG\OP3244.2!GOP10!
G112 is the special synchronization G, but any other function with stop can be used (M, G4,
etc.). This trick will always work but requires that the program be split at a suitable point accepting a
stop.
142
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
N4 G1 Z0F100
N5 F300
N6 !:L254-P4523.PRG!
N7 QR<QR+30>
N8 !IF QR<360;GON2!
N9 Z30
N10 M2
The lines from N2 to N8 are repeated 6 times, in 6 different angles distant 30 degrees from each
other.
Here are some specifications on the part-program file to be executed in DNC:
% character not allowed
it must not carry the “%” character at the beginning (this means that any initial comment must be
delimited by round brackets as specified by ISO standard)
For compatibility with a not documented feature of NTERM and ZTERM interfaces, an exception
is made for a single % character only at the end of the first line (but it is better to avoid the usage of
% character inside DNC programs).
termination with G26
It must end with instruction G26 (return from subroutine)
GON and GON-N jumps allowed with restrictions
The jumps, executed with GON or GON-N instructions, are allowed also for DNC programs, but
with a length limit for the jump, which cannot extend beyond the file section contained in the Z32
internal memory.
If the jump destination results external, the destination line is not found, provoking a
programming error.
If the file to be executed is smaller than 64kB, no jump problems due to the length exist,
because all the file is loaded in the 64kB dedicated by Z32 for the DNC.
If the file is larger than 64kB, the rules to decide if the jump destination will be reached or not,
are more complex. Simplifying the problem:
- a backward GON cannot jump more than 20.000 characters before any line already executed.
- initial line of a file cannot be found as destination for a backward jump: if necessary, insert a
comment of at least 4 characters at begin of file, to allow to find the first following line
- a forward GON cannot jump more than 40.000 characters after the starting line
- both lines of GON-N instruction must respect the above conditions
Please note that the quantities of 20.000 and 40.000 contain a certain safety margin; it is
therefore possible in some cases, depending on character transmission speed, to find also farther
lines. It is also important to note that this behaviour may be uncertain; D.Electron recommends to
limit the distance of destination lines inside the safety zone.
Inside a program section available in memory, the first line destination of a jump corresponding
to the specified N is found. In order to avoid uncertainties in individuating the destination line, it is
recommended to keep N line numbers in increasing order for the whole file.
D. ELECTRON 143
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
PPG499
PPG500
At this point, if HA contains a number from 1 to 500, it will be sufficient to write:
!:L254-PPG<HA>!
It is also possible to introduce an expression, provided that it is written between pointed
brackets:
!:L254-PPG<HA+1-HC*2>!
The expression can be included in the file name, or can be repeated several times:
!:L254-PPG<HA>.DAT!
specifies the file names PPG1.DAT, PPG2.DAT etc.
!:L254-PPG<HA>.<HB>!
specifies the file names PPG1.1 (HA=HB=1), PPG20.46 (HA=20, HB=46) etc.
Here follows some rules for the expression:
- the initial 0’s are always left out; if the expression is zero, only one 0 must be entered
- if the result of the expression is negative, the program will assume it as absolute value
- if the result of the expression is a fraction, the program will assume its nearest integer.
144
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
The two strings "START" and "END" are also accepted for specifying the file start and end. For
example:
!:L254-PRG126.ISO[312--82468]
!:L254-PRG126.ISO[START--4743]
!:L254-PRG126.ISO[2810--END]
The NC alarm codes linked to this function (communicated to Z32 by the special Windows
application) are:
CN6514 :L WITH []: SYNTAX ERROR
CN6614 :L WITH []: POINTERS NOT IN LINE HEAD POSITION
CN6714 :L WITH []: POINTERS BEYOND END OF FILE
CN6814 :L WITH []: START POINTER HIGHER THAN END POINTER
Evolved instruction :P
With the following syntaxes it is possible to use an evolved line field to display part-program data
on the screen:
!:P n1 - n2 “string” [expression] ...!
:P is the opening of the special field (“P” for Print)
/. to format data with a point instead of a comma (optional)
n1 is the position of the initial character (min. 0, max. 158)
- is the hyphen (minus sign) separating n1 and n2
n2 is the position of the last character (min. n1+1, max 159)
“string” is an ASCII string delimited by double quotes (optional).
[expression] is an algebraic expression delimited by square brackets (optional)
! is the field opening and closing character (“;” is also valid except at the beginning of a line)
- :Pn1-n2 are mandatory.
- n1 and n2 identify the characters of the special display screen strings (two full lines, therefore a
maximum of 160 characters are available)
- The characters between n1 and n2 (inclusive) are cancelled and replaced with the data to be
displayed.
- Strings and expressions are optional, and can be repeated many times in any sequence, until
they fill the number of characters set (n1-n2).
- Nothing is ever written outside the field delimited by n1-n2. If the printing is longer, it is cut off
without prompting any alarm.
- The strings can contain all the printable characters except for double quotes that are used as
delimiters.
- Expressions can be all those that can be included in the subroutine.
- The results of the expressions are printed without leading zeros and with a maximum of 3
decimals. The highest result that can be displayed is 999999,999. Higher results are saturated to
the maximum without prompting any N/C alarm.
- It is possible to specify the formatting of values (expression results) with a decimal point
instead of a comma, by programming “/.”
D. ELECTRON 145
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
- There are no blank spaces either before or after the results of the expressions. Add if
necessary. If n1 and n2 are not consistent, or delimiter characters do not exist, etc, a CN1D14
PROGRAM ERROR alarm is prompted.
- After requesting a display using :P the displays from PLC are frozen (even in the area outside
n1-n2).
- To cancel the displayed data and resume other displays of PLC data, an evolved line field must
be programmed in the subroutine in the following form:
!:P /R!
Examples:
!:P0-30 “HA=”[HA]” HB=”[HB]!
Displays the two parameters HA and HB, with a description.
!IF HA<0;:P0-60 “WRONG VALUE OF HA = “[HA]!
Displays only if HA<0
!:P20-80"Result: “[12*4-PAR[18]+CS(HB-30)]!
Displays the result of the expression
Instruction :D
Displaying data on the screen using the advanced line instruction :P has the following limits:
− there is a conflict with the PLC displays because the string is printed in the same screen area
− the print is not synchronized with the real position of the subroutine because of the pre-
processed instruction buffer.
The :D instruction can be used when it is necessary to overcome these limitations (mnemonic
Display) may replace :P. This instruction maintains the same syntax but with none of the above
limits. Printing with :D is performed in the special display areas (the ones enabled by pressing
CTRL-R V) and that are seldom used. If the CTRL-R V display areas are used, the text associated
to :D is temporarily not displayed.
The syntax of :D instruction is the same as :P, the only difference being the special field opening
command becoming :D (“D” comma Display):
!:D /. n1 - n2 “string” [expression] ...!
Examples:
!:D0-30 "HA="[HA]" HB="[HB]!
Displays the two parameters HA and HB, with a description.
!IF HA<0;:D0-60"WRONG HA = "[HA]!
Displays only if HA<0
!:D20-80"Result: "[12*4-PAR[18]+CS(HB-30)]!
Displays the value of the expression
!IF HA>40;:D /R!
If HA>40 displays of :D are cancelled.
HA100,123
!:D/.0-20 “PARAM. HA=”[HA]!
Will display the line: PARAM. HA=100.123
146
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
The string immediately follows the required file, the expression is calculated and immediately
follows the required file.
Example:
HA 45
!:F12"Value at point 4: "[HA*2]!
In file # 12, the following string is entered:
Value at point 4: 90
HA100,123
!:F/.40"PARAM. HA="[HA]!
The following line will be inserted in file 40: PARAM. HA=100.123
The field can include several strings and expressions up to 160 characters. Eventual characters
in excess will be ignored.
Any file number from 1 to 99 is accepted, yet the file specified cannot be the same file that is
currently running in automatic execution.
The evoluted line instruction :F allows to write ASCII strings in a CMOS file from a prt-program.
The main purpose of this instruction is to allow the compilation of production reports.
If the dimension of the CMOS file overcomes 64kB due to a :F instruction, old values at file
beginning are automatically deleted to obtain space for the new ones.
Warning: it is good practice to avoid a file overcoming the 64kB limit, because the deletion of
initial bytes may be quite long (also more than 1 second), thus slowing down the part-program
execution.
A specific syntax can be used to delete the file completely:
!:F nfile/R!
Example:
!:F90/R!
Deletes file # 90.
D. ELECTRON 147
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
148
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
If the DNC mode has been chosen at the execution start, the currently running file is the # 254.
In block search mode the effects are:
- the destination file is opened and read
- the fixed section of the initial string is checked
- the number of the current program is checked to verify whether it coincides with the number in
the block search
- the length of the initial string is checked; date and time are not important, but the line must
contain 34 characters
If the check result is positive, the block search continues normally, and the operator’s choices
will be read by the DOC file. On the contrary, in case of errors, the block search will continue in a
special mode: as the DOC file data are inconsistent, the operator will be prompted to repeat his
choices at every optional block.
Optional block
During the program execution the optional block is executed or not executed according to the
status of the external selector.
If the DOC file is enabled (i.e. the “!DOC>...!” field has been previously enabled in the program),
the operator’s choice is stored in the DOC file in a line consisting of the only character “0” when the
line is not executed, and “1” if the line is executed.
In the block search mode, we have one of the following cases:
- if the DOC file is not enabled, the line is executed or not executed according to the selector’s
status. The function is the same as in the previous versions.
- if the DOC file is enabled and contains no errors, the DOC file will be opened and the
operator’s choices repeated. The current status of the optional block selector does not have any
influence. If errors are found during the DOC file reading, the working mode is switched to the DOC
file mode with errors. (See the following notes.)
- if the DOC file is enabled (i.e. the program contains the “!DOC>...!” instruction), but in the error
mode, a STOP command is released (as with M0) in order to allow the operator to repeat his
choice. The check of the optional block selector status – and therefore the choice to execute or not
execute the line – is made by pushing the START key to continue the search.
Program sectioning
The program sectioning option, enabled by a line with an initial “:” character followed by the
section number, allows a much quicker block search. However, the optional blocks in the “skipped”
sections cannot be recognised or decoded.
In order to allow the synchronization of the pointer read mode with the section start, the program
sectioning option should be included in the DOC file.
In the execution mode, the sectioning line generates, in the DOC file, a line consisting in the “:”
character plus five digits that identify the section. Eventual initial 0’s are also included.
For example, the part-program line:
:456
generates a line in the DOC file:
:00456
In the block search mode, the sectioning line requires the search of a corresponding line in the
DOC file. The operator’s choices reading is resumed for the lines immediately following the
sectioning line.
If the DOC file contains an error, the sectioning line will be ignored with regard to the DOC file:
however, the choices related to optional blocks will be required to the operator via a program
STOP.
D. ELECTRON 149
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
The syntax for prompting the operator (only possible from an ISO line) is the following:
paramname<IN:comment>
where paramname is the name of the parameter that the operator must enter, while comment is
the string displayed to the operator that describes the function of the required parameter.
HA<IN:CUT DEPTH>
This dialog box displays the current value of the parameter, e.g. if HA value at that point of the
program is 5.234, the dialog box will display:
150
D. ELECTRON
CNC Z32 Programming Manual Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write
In any case, it is the same as the value introduced by Z32 into the dialog box had been entered
by the operator.
The operator can delete one or more digits and substitute them to reach the desired value.
INPUT is an instruction “with stop”, therefore before being carried out, it requires that all
currently open instructions be completed. In addition, like the other function “with stop”, it cannot be
programmed at the “open” points of the part-program (radius compensation, open geometry, etc.).
Once the open instructions are completed, the command line will be modified with:
where the field of 14 characters between pointed brackets contains the parameter’s value and
the cursor is available for data input.
The operator can modify the value displayed or simply fill the field with the new value that must
be assigned to the parameter, and then strike the Enter key. If the syntax is correct, the value will
be acquired by Z32 and the part-program execution will continue.
In entering the value, the operator can use the following special keys:
- BACKSPACE or LEFT ARROW delete the last digit, launching the “editing” mode: it is the
same as the other characters of the old value were entered by the operator.
- any other character will delete the value in the input box completely.
If the value is not accepted (e.g. it includes too many significant characters), a "?" will appear
prompting the operator to correct the string.
The CN6314 <IN:...> INVALID STRING alarm is linked to the input instruction.
The parameter input is enabled in both the execution and in the block search modes.
An interesting possibility is given by linking the INPUT instruction with the DOC file (enabled
through the !DOC>filenumber! instruction).
If the DOC file is not active, during the block search the INPUT instruction will be prompted
exactly in the same way as required during execution.
If the DOC file is enabled during the parameter execution, the parameter will be stored in the
DOC file in order that it will be available for an eventual block search.
In the block search mode, if the DOC file is active, the INPUT instruction is acquired into the
DOC file, but if the DOC file is corrupted or inconsistent, the operator will be prompted for the
INPUT instruction, as in the case of DOC file disabled.
D. ELECTRON 151
Chapter 5 – Evolved lines, Jumps, Conditioning, Read/Write CNC Z32 Programming Manual
152
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 – Structured programming functions
CHAPTER 6
These !GON instructions cannot be undertaken within a program implemented in DNC mode.
These instructions give the programmer the fullest freedom of operation; so that he can make
jumps wherever he wants within his program (forward and back) but it is limited in relation to the
!GON…! functions to programs actually contained inside the operational memory of Z32 and can
therefore be set to lengths not exceeding a 64K bytes.
For this reason certain “structured program” instructions have been added, to integrate the
existing instructions and which can, with few limitations, which we shall consider, also be container
in programs effected in DNC (therefore of any length).
The structured programming instructions are evidenced by the fact that the line which contains
them begins with two consecutive "-" characters. So that they are perfectly compatible with the
existing programs, which would give an error if they did not contain this type of line.
Complete syntax:
-- IF condition ; comment
instructions
instructions
D. ELECTRON 153
Chapter 6 – Structured programming functions CNC Z32 Programming Manual
-- ELSE ;comment
instructions
-- END IF ;comment
where:
- expression 1 and expression2 are the possible expressions in syntax Z32 (the most simple
form of expression is a number or a parameter.
= equal
<> different
2) condition = /
3) condition = //
- instructions are any number of lines undertaken by Z32, that is "ISO" lines, evolved lines
and other structured instructions.
- there may be any number of blanks between END and IF (ENDIF is also recognized, without
blanks)
- the ";" closing character and the following comment are optional are optional.
Example 1:
HB10
--ELSEIF HA=1
..HB11
--ELSEIF HA=2
HB105
--ELSEIF HA>2
154
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 – Structured programming functions
HB1000
--ELSE
HB-1
--END IF
Which assigns different values to the HB parameter according to the value of parameter HA.
Example 2:
G0 Z100
T0 M6 (UNLOAD SPINDLE)
M2 (END OF PROGRAM)
--END IF
Note that the same function could be obtained without structured programming, by adding the
character "/" to the three instructions which make up the IF unit.
Example 3:
--ELSE
--END IF
Assigns two different values to the parameter HA, according to whether we are in block search
function or not.
It is obvious that in this case also it would be possible to obtain the same functions even without
structured programming.
END IF is compulsory, while ELSEIF is optional (which may be of any number) and the ELSE
(which normally ends the alternatives of IF).
Example:
-- IF conditionl
instructions 1
-- IF condition2
instructions 2
-- IF condition3
D. ELECTRON 155
Chapter 6 – Structured programming functions CNC Z32 Programming Manual
instructions 3
-- IF condition4
instructions 4
-- END IF
instructions 3A
-- END IF
instructions 2A
-- END IF
instructions 1A
-- END IF
It is advisable to “indent” the program (that is, shift the instructions to the right, aligning them with
the IF to which they belong, as in the example) to make the instruction flow more evident and to
avoid errors in the re-closure of the IF. With END IF. Beware that in programs with many IF’s inside
each other, it may be difficult to find where the END IF is missing.
A jump to a sub-program temporarily cancels the IF level, and the return from the sub-program
returns the level of IF present at the time of the jump.
--IF condition1
--IF condition2
!GOP20!
--END IF
--ELSEIF condition3
istructions3
--END IF
if conditions 1 and 2 have occurred there is a jump to sub-program 20, and ELSEIF is not
carried out on return, even if condition 3 has occurred.
It is possible to insert a G26 (return from the sub-program) within an IF cycle. Return to the sub-
program however restored the level of IF of the program to which return is to be made. For example
the following is permissible in a sub-program.
--IF condition1
--IF condition2
--IF condition3
G26
--END IF
--END IF
156
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 – Structured programming functions
--END IF
In this case the return from sub-program G26 occurs correctly at IF level 3 in the sub-program;
the two lo west levels of IF are discarded and the function is resumed in the program or sub-
program recalled at the correct IF level recalled by the caller.
A M2 (program end) can be undertaken at a non zero IF level. For example the following is
correct.
--IF condition1
M2
--END IF
If END IF is programmed with no IF open the following alarm will be released CN6B14 "END IF
WITHOUT IF"
In the same way if an ELSE o ELSEIF is programmed without an open IF the following alarm
condition occurs CN7314 "ELSE OR ELSEIF WITHOUT IF"
Warning: if the file ends during an IF which is not implemented various alarm conditions are
possible which may be difficult to interpret. See the structured instruction --OUT which aids
understanding in such cases.
The possibility to have both –IF structured instructions and (!GON…!) not structured jump
instructions in the same file, gives a very high programming flexibility. The programmer must be
however careful to avoid !GON…! jumps exiting or entering inside –IF structures. For example this
program may give an error:
--IF condition
N1 !GON10!
--END IF
...
N10...
M2
The line N1 exits from the IF structure in an uncontrolled way, therefore M2 is issued when the
IF was non correctly closed, thus bringing to a programming error.
The jump to a sub-program therefore cancels the structured/non structured condition; therefore
it is possible in a program with structured instructions to jump to a sub-program which contains
instructions of type !GON… and vice versa.
It is also possible, to jump from a program that contains structured instructions to a sub-program
with detail of the line or series of lines. The following is therefore valid:
--IF condition
!GOP10-N35!
--END IF
or:
--IF condition
!GOP10-N35-N70!
--END IF
D. ELECTRON 157
Chapter 6 – Structured programming functions CNC Z32 Programming Manual
Complete syntax:
-- DO ;comment
instructions
instructions
where:
- number repetition of DO-LOOP cycle for the specified number of times (optional)
- <expression> repetition for the number of times specified by the result of the expression,
evaluated only the first time.
- the blanks between EXIT DO IF and between LOOP IF are optional (the following are also
accepted EXITDOIF, EXIT DOIF, LOOPIF)
- the number following the –LOOP instruction indicates the number of times the jump is
executed, therefore the DO-LOOP cycle is executed one time more than specified (first time and
the number specified)
- the number must be positive, otherwise, the alarm CN1D14 PROGRAM ERROR is issued
- it is possible to program the number also with the result of an expression: --LOOP <(100-
HA)/2>. The expression is evaluated only once and the result is stored and used like it were directly
programmed.
- for the expression (unlike the direct programming with a number) also non integer or negative
results are allowed, with the following rules:
if the result is not an integer, the result is approximated to the nearest integer
if the resulting integer is zero or negative, the DO-LOOP cycle is not repeated (executed only the
first time)
This tolerance with abnormal results is useful because it is easy to have non integer results, due
to the binary format for numbers (the expression 10*0.2 gives to a not integer binary result), while
negative results may be useful in case of complex control conditions.
Basic examples:
G0 X0 Y0
Z0
158
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 – Structured programming functions
--DO
G1 F1000 Z<Z-2>
X100
Y100
X0
Y0
--LOOP 2
2 repetitions after the first cycle (last time with Z-6)
G0 X0 Y0
--DO
X<X+5>
..Y<Y+5>
--LOOP IF X<20
makes a step until X20 Y20 (ends with movement fromY15 to Y20)
G0 X0 Y0
--DO
X<X+5>
--EXIT DO IF X>=20
Y<Y+5>
--LOOP
steps similar to the previous, but ending with movement from X15 to X20, with Y=15
A DO cycle consumes a sub-routine level (as the !GOP.. and !GON-N) therefore the following
alarm condition is generated CN2E14 TOO MANY SUBROUTINES if the "nesting" of the
subroutines exceeds the maximum of the 19 permitted levels.
Several DO cycles may be contained inside each other; the permitted nesting is the total one of
the subroutines.
It is possible to enter DO cycles at IF level, non zero, and it is also possible to enter IF (up to 31
levels) inside a DO cycle.
The LOOP must be at the same IF level as DO to which it refers, otherwise an error occurs as
follows CN7414 "LOOP DURING OPEN IF". For example:
--DO
--IF condition
--END IF
D. ELECTRON 159
Chapter 6 – Structured programming functions CNC Z32 Programming Manual
--DO
--IF condition
--EXIT DO
--END IF
--LOOP
In this case the EXIT DO closes all the IF levels and the cycle is resumed after the LOOP
The DO instruction may also be contained in a program implemented with DNC, but in DNC
there is a limit to the length of the instructions contained inside the body of the DO:
in DNC the body of the DO (the instructions contained between the DO and LOOP)
cannot exceed 44KB, otherwise the following alarm condition is generated CN7614 " DO -
LOOP CYCLE TOO LARGE IN DNC"
If the LOOP is programmed without an open DO the following alarm is generated CN6E14
"LOOP WITHOUT DO"
If EXIT DO is programmed without an open DO the following alarm occurs CN7214 "EXIT
WITHOUT DO".
Warning: like the IF case, the possibility to have both –DO structured instructions and (!GON…!)
not structured jump instructions in the same file, gives a very high programming flexibility. The
programmer must be however careful to avoid !GON…! jumps exiting or entering inside –DO
structures.
Syntax:
instructions
-- LN expression ;comment
Where:
- the blanks between GOTO and LN are optional (GOTOLN is also accepted)
After GOTO all the instructions are missed up to the destination line LN, which features a
numerical expression identical to that of the GOTO expression.
The destination line LN can only be forward in the program as compared to the GOTO line.
Example:
--GOTO LN 20 ;comment
instructions
160
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 – Structured programming functions
--LN 20 ;comment
Beware of expressions that contain non-whole numbers, which could cause an unexpected
reaction.
instructions
The explanation is that the expressions are evaluated by Z32 in a truncated binary floating point
format (not rounded), and in this format the simple decimal numbers 0,9 and 0,1 are periodic (they
have an infinite number of decimals) and so they can only be represented in approximated form.
It is rather as if with decimal notation with 4 figures one wanted to compare the number 2/3 with
3-1/3
It is therefore advisable to always use full expressions; or explicit numeric values, which totally
guarantee function.
Warning: if the file ends without having found the destination line various alarm conditions may
occur which may be difficult to interpret See –OUT instruction which aids understanding in such
cases.
Syntax:
instructions
where:
- number is whole and between 1 and 119 inclusive, which defines the entire Z32 file in which
the instructions container in DEFINE must be written.
- it is not possible to overwrite the program or sub-program currently in progress to which return
is necessary (for example if sub-program 25 is in progress which is recalled with an !GOP! from
sub-program 20, which is in turn recalled with a !GOP! from program 1, files 1, 20, 25 cannot be
written on).
D. ELECTRON 161
Chapter 6 – Structured programming functions CNC Z32 Programming Manual
Example:
G0 Z<Z-30>
G1 Z<Z-20>
G4 TT.3
G0 Z<Z+50>
G26
-- END DEFINE
This structure is principally destined for evolved editors, inserted in a part-program (for example
to be sent in DNC) which may be macro or fixed cycle type which may not be recovered amongst
the macro and fixed cycles of the system.
One DEFINE cannot be inserted inside another DEFINE, otherwise the following alarm condition
is generated CN6C14 "DEFINE INSIDE A DEFINE".
If the file number is irregular (0 or with decimals or negative …) the following alarm condition
occurs CN1D14 "PROGRAM ERROR"
If an END DEFINE is found with DEFINE not open, the following alarm condition occurs CN6A14
"DEFINE END WITHOUT DEFINE"
There may be any kind of instructions inside a DEFINE, both structured and non-structured(with
the exception of --OUT necessary to check the closure of DEFINE), but which may even be
incorrect, and which are completely ignored during this writing stage in the Z32 file. Should there be
any implementation errors they will be highlighted when the sub-program is executed.
Warning: if END DEFINE is missing, the writing proceeds to the end of the file and there is the
risk of alarm conditions that are difficult to interpret. See –OUT instruction which aids understanding
in such cases.
Some program sequences may present a situation where the destibation of a GOTO jump is
also defined inside a DEFINE block. Line search inside a DEFINE block is inhibited in order to avoid
possible malfunctions. For example, suppose this program fragment:
--DEFINE P4
...
N1 G1 Z<Z-5>
...
G26
--END DEFINE
G0 X0 Y0 Z0
N1 ...
...
162
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 – Structured programming functions
N20 !GON1!
...
The fragment contains two N1 lines, one contained inside the DEFINE and one outside. The
destination of the jump on line N20 (!GON1!) cannot be the N1 contained inside the DEFINE block;
this line is skipped because it is contained inside a DEFINE, the destination assumed is thus the
second N1 line (outside the DEFINE), considered as the correct destination.
Warning: NEVER write unpaired –DEFINE or –END DEFINE lines inside a file!
To decide if a jump destination (GON..) is or not inside a DEFINE, the file is not completely
analyzed, but only lines containing --DEFINE or --END DEFINE are searched (without considering if
they can be executed or not) and the decision if the found line has to be skipped, is taken as soon
as certainty is reached.
If the file contains unpaired –DEFINE or –END DEFINE, wrong decisions may be taken.
Example:
INITIAL COMMENT: THIS FILE DOESN’T CONTAIN LINES OF TYPE:
--DEFINE
PROGRAM STARTS HERE
%
...
N1 G0 X0
...
N4!GON1!
The N1 line, correct destination for the jump on line N4, is dropped because the quick analysis
sees a start DEFINE before the N1 line, therefore the line is dropped, also if the DEFINE is inserted
in the initial comment.
Syntax:
-- OUT
Should this instruction be found an alarm will occur as follows: CN1D14 "PROGRAM ERROR".
The alarm will occur whether this line needs to be carried out or whether it needs to be missed
due to IF not to be implemented or due to GOTO (even inside a DEFINE).
The purpose of this instruction is to highlight the fact that an attempt has been made to read
beyond the end of the file. If programming is correct this line is totally useless.
However if this line is not entered and there is a programming error which results in the
continuation of reading beyond the end of the file (for example: an IF with untrue condition which is
not closet by the END IF, a GOTO of one LN which is not found, a DEFINE without an END
DEFINE) the following occurs:
- in the event of implementation by an internal file, the following error occurs CN1D14
PROGRAM ERROR on a void line, as the character 04 hex of file closure is read which is not
permitted in the lines of a part-program.
- in the case of the implementation by an internal file with irregularly closed file ( character 04
hex missing) the following error occurs CMOS 5, reading beyond end of file. Note: the Z32 may
D. ELECTRON 163
Chapter 6 – Structured programming functions CNC Z32 Programming Manual
be incorrectly closed (with character 04 hex missing) if an external editor is created, and sent to
Z32 with the normal means of communication.
- in the event of execution from DNC it comes to a stop waiting for further instructions.
- in none of these cases is it immediately apparent that reading is proceeding beyond the end of
a file: if the line –OUT is entered, which gives a program error and shown as incorrect line, one
gets a better understanding of the problem.
- this line must be entered at the end of the file, after all the instructions which can be carried
out. The line must be entered at the end of the file, after the last instruction that can be
implemented. (normally M2 o G26). For example:
M2
-- OUT
or:
G26
-- OUT
where:
in which expression1 and expression 2 are the mathematical expressions accepted by, and the
comparison is expressed by one of the following conditions "<", ">=", "=", ">=", ">". For example:
--WAIT PAL[20] = 0
Where the expressions are reduced to their basic format (a parameter and a constant
The purpose of this instruction, which halts the reading of the part program, until the condition
has been assessed is to synchronize the part-program with the machine PLC wasting as little time
as possible.
The WAIT instruction is also compatible with the open profiles, correction, radius etc but the
PLC engineer needs to take all the necessary precautions which take into account the fact that the
reading of the part-program may be many blocks ahead in relation to implementation.
For example, let us image that we need to transmit orders to PLC with PAL[1] and to operate in
synch with G112. The part-program could be:
G112 (empty of instructions in progress)
PAL[1]<1+8+64+256+512> (start bits 0,3,6,8,9)
PAL[20]1 (sync)
--WAIT PAL[20]=0 (the PLC confirms it has read the bits contained in
PAL[1])
164
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 – Structured programming functions
The PLC must of course work fast ( 2 millisecond section) to ensure maximum time saving.
This resource has been specifically developed for use on the user interface Z-flash, but it is also
available for manual programming mode.
The subtemp are internal files of Z32 and are very similar in structure to the CMOS files, but with
some important differences.
1) A subtemp is created with a --DEFINE and belongs to the part-program that generates it
The only way to generate a is from the inside of a part-program with the structured instructions --
DEFINE S…
For example:
...
-- DEFINE S20
(SIMPLE FIXED DRILLING CYCLE
G0 Z<HA>
G1 Z<HB>
G0 Z<HA>
G26
-- END DEFINE
...
It will be noted that this DEFINE flanks that already introduced for the CMOS files (DEFINE P…):
one of the main differences being that the subtemps are “new” resources, which do not therefore
affect the structure of the CMOS installation files already consolidated.
A subtemp is generated by a part-program and follows it lifeline: it is, as the name states
“temporary” as it disappears at the end of the part-program, or more logically when the machine is
switched off.
Unlike the CMOS files which, once created, can be accessed from any process, a subtemp is
accessible only from the part-program and the process that generated it.
For example in a multi-process machine, if two part programs are being undertaken at the same
time, one on process 0 and one on process 1, the two part-programs may define two different
subtemps with the same number (i.e. DEFINE S3) without the two subtemps interfering with each
other.
Up to 64 subtemps are possible for each process (numbered from 1to 64, zero excluded).
D. ELECTRON 165
Chapter 6 – Structured programming functions CNC Z32 Programming Manual
No specific instruction exists for the cancellation of a subtemp, but if necessary it is possible to
overwrite a subtemp that has already been defined with a new one. It is in practice equivalent to the
cancellation of a subtemp by overwriting a subtemp with a void.
3) There is 1 MB of total space available, the individual subtemp may reach max 240 KB
The memory space available for the subtemps (inclusive of all processes) is 1MB.
Note that the subtemps are destined for use for fixed cycles or system macro, therefore under
conditions of normal use they should not be very long.
As a first piece of advice it is advisable to never overwrite or cancel the subtemsp, even if they
appear already used remember that due to the effect of the advance of the letters of the lines; as
compared to their actual implementation, there are also a certain number of lines present that have
already been read, but are awaiting processing.
As the total 1 MB of space and the possibility of having 64 subtemps per process is m ore than
sufficient for the needs of normal part-programs, it is advisable to number the subtemsp from 1
onwards and to never cancel (they are however automatically cancelled on machine RESET).
In the event of any different needs, it is however advisable to cancel the oldest subtemps,
amongst those which are no longer required, to avoid the risk of the display problems mentioned
above.
5) The $ chaining character is not permitted in the subtemp files, the lines are of 240 characters.
Inside a subtemp the maximum line length is the standard Z32 length, that is, of 240 characters.
Unlike the case of the CMOS files, a subtemp line cannot be chained to another line with "$"
character.
After installation in the memory with instruction --DEFINE S… a subtemp may be recalled,using
instructions that are the same as those used for recallng the CMOS files of Z32:
to jump to the subtemp as a sub-program (the subtemp end G26 provokes the return to the
calling program.
166
D. ELECTRON
CNC Z32 Programming Manual Chapter 6 – Structured programming functions
G27S8
Note that instructions G27C0 and G27S0 which annul the fixed cycle are bi-valent, which means
that both annul both the fixed cycles of CMOS and the fixed cycles of subtemp. In other words to
annul either a G27S… or a G27C… either G27C0 or G27S0 may be used.
Within a subtemp the following instructions are permitted (with the same means as valid for the
CMOS files) !GON…!, !GON…-N…!, !GOP…!.
7) The subtemp always belong to the user, they cannot belong to the system
Z32 has certain critical performance protection devices of the system which are permitted in the
“system” sub program (CMOS file from 128 upwards) but which are forbidden in the “user”
programs and sub-programs (all others).
The subtemps always originate from the user, which means that the protected system resources
cannot be used.
8) It is not possible to activate local sections of tools, origins or parameters from within a
subtemp
Note that the local sections are activated from a CMOS file, using G37TL instructions (tools),
G37OL (origins) and G37PL (parameters); if these instructions are used in a subtemp, an alarm is
generated CN7914 SUBTEMP ERROR.
The G110 (empyting macro) is totally incompatible with the subtemps and therefore the following
alarm condition is generated CN7914 SUBTEMP ERROR, if G110 is programmed inside a subtemp
or if the caller of the G110 is a subtemp.
Block search with string inside a subtemp is not possible inside a subtemp, that is, there is
nothing corresponding to control P… of the block search activity 3.
D. ELECTRON 167
Chapter 6 – Structured programming functions CNC Z32 Programming Manual
168
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
CHAPTER 7
Parameter passing:
All necessary parameters are specified by programming them on the same line containing the
activation of G800. In the program line containing a G800 activation, it is possible to program only
parameters related to fixed cycles programming.
For example, with reference to the cycle G800K1, it is possible to set the parameters by
programming:
G800 MHA0 MHB-20 MHC10
An example of not correct programming is the following:
G800 MHA0 MHB-20 MHC10 F1000
The parameter F is not directly programmable on the G800 line, so a correct writing is as
follows:
F1000
G800 MHA0 MHB-20 MHC10
D. ELECTRON 169
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
170
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHB position
5. Dwell for MHT seconds
6. Rapid return to MHC position
feed MHF
feed F MHC
G0
MHA
MHD
MHB
MHT
D. ELECTRON 171
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHI: depth increment before stop for chip breakage
Type of chip breakage:
MHR: retraction for chip breakage
if MHR > 0 the retraction is executed and MHT is ignored
MHT: dwell time for chip breakage
Program MHR or MHT depending on the kind of chip breakage desired.
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHB position, with chip brakage every MHI mm, through:
- retract of MHR mm (if MHS > 0) from the actual position
- dwell of MHT seconds if MHR=0 and MHT>0
5. Rapid return to MHC position
feed MHF
MHC
feed F
G0
MHA
MHR
MHI
MHB
172
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHI: depth increment before retraction for chip extraction.
This increment is reduced by 10% at every movement up to a value of 50% of starting
MHI value, then the increments are constant.
MHZ: chip extraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed for MHI length
5. rapid return to chip extraction position MHZ
6. Optional dwell for MHT seconds
7. Rapid return to the MHS safety distance from the previous position
8. Feed movement for a MHI length with percentage reduction.
The depth increment is each time reduced by 10 % up to a value of 50 % of its initial value,
then the increments are constant.
9. Points 5, 6, 7, 8 are repeated until the MHB hole end position is reached.
10. Rapid return to MHC position
feed M HF
MHC
feed F
MHT
G0
MHZ
MHA
MHD
MHI
MHS
MHB
D. ELECTRON 173
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHP: tap pitch in millimeters, example MHP 1.25
MHM: kind of tapping: rigid or with compensating chuck
MHM = 0: rigid tapping
MHM = 1: tapping with compensating chuck
MHP
G0 MHC
MHA
MHB
MHT MHW
174
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Avanzamento in lavoro fino alla quota MHB
4. Dwell for MHT seconds
5. Feed return to MHA position
6. Rapid return to MHC position, if different from MHA
feed F
G0 MHC
MHA
MHB
MHT
D. ELECTRON 175
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Avanzamento in lavoro fino alla quota MHB
4. Dwell for MHT seconds
5. If MHS=0 spindle stop and optional dwell for MHW seconds
if MHS>0 spindle orientation, retract of MHS mm along the MHQ angle
6. Rapid return to MHC position
if MHS > 0 rapid return at hole center
7. Spindle rotation restore
feed F
MHC
G0
MHA
MHB
Stop
HS
M
MHG
176
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHA: hole start position
MHB: end hole position
MHC: high return position
MHI: increment before feed stop for chip breakage
Type of chip breakage:
MHR: retraction for chip breakage
if MHR > 0 the retraction is executed and MHT is ignored
MHT: dwell time for chip breakage if MHR = 0
Program MHR or MHT depending on the kind of chip breakage desired.
MHU: chip breaking zone end position – chip extraction zone starting position
MHL: depth increment before retraction for chip extraction.
This increment is each time reduced by 10% up to a value of 50% of its initial value,
then the increments are constant.
MHZ: chip extraction position
Cycle description:
1. Rapid positioning on the plane
2. Rapid movement up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHU position, with chip brakage every MHI mm, through:
- retract of MHR mm (if MHS > 0) from the actual position
- dwell of MHT seconds if MHR=0 and MHT>0
5. Feed movement for MHL length
6. Rapid return to chip extraction position MHZ
7. Optional dwell for MHW seconds
8. Rapid return to the MHS safety distance from the previous position
9. Feed movement for a MHL length with percentage reduction.
The depth increment is each time reduced by 10% up to a value of 50% of its initial
value, then the increments are constant.
10. Points 6, 7, 8, 9 are repeated until the MHB hole end position is reached.
11. Ritorno rapido alla quota MHC
D. ELECTRON 177
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
feed MHF
MHC
feed F
MHT
G0
MHA MHZ
MHD
MHI
MHU
MHL
MHS
MHB
Mandatory parameters:
MHA: hole start position
MHB: hole end position
MHC: high return position
MHU: end of first zone position
MHV: start of second zone position
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHU position, with chip brakage every MHI mm, through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
5. Rapid to MHV position
6. Movement with F feed up to MHB position, with chip brakage every MHI mm, through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
7. Rapid return to MHC position
178
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
feed MHF
MHC
feed F
G0
MHA
MHD
MHI
MHU
MHV
MHI
MHB
Mandatory parameters:
MHA: hole start position
MHB: end hole position
MHC: high return position
Middle zone:
MHU: end high zone – start middle zone position
(MHJ): feed inside middle zone. If MHJ=0, the middle zone feed is equal to the high zone
feed
(MHG): speed inside middle zone. If MHG=0, the middle zone speed is equal to the high
zone speed
D. ELECTRON 179
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Cycle description:
1. Rapid positioning on the plane
2. Rapid feed up to the hole start position MHA
3. Movement with MHF feed up to MHD position
4. Movement with F feed up to MHU position, with chip brakage every MHI mm, through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
5. If MHG > 0 retract of MHS mm from the MHU position, MHG activation and dwell for MHW
seconds to wait for spindle at nominal speed
6. Movement with MHJ feed up to MHV position, with optional chip brakage every MHI mm,
through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
7. If MHH > 0 retract of MHS mm from the MHV position, MHH activation and dwell for MHW
seconds to wait for spindle at nominal speed
8. Movement with MHK feed up to MHB position, with optional chip brakage every MHI mm,
through:
retract of MHR mm (if MHS > 0) from the actual position
dwell of MHT seconds if MHR=0 and MHT>0
9. Rapid return to MHC position
MHD
MHI
MHU
MHI
MHV
MHI
MHB
180
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHB: end hole position
MHC: high return position
MHD: hole diameter
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
Cycle description:
1. Rapid positioning on the plane on hole center
2. If MHK > 0, machining approach to MHA position, and spiral descent up to MHB position.
The descent is made by increasing the MHK depth at every turn.
If MHK = 0, descent in feed up to the MHB position, profile approach and contouring
machining in a single turn.
Contouring passes are executed in clockwise or counterclockwise direction with the
following criteria:
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
3. Detach from the wall and return at hole center
4. Rapid return to MHC position
MHD > 0
MHC
MHA
MHK
MHB
D. ELECTRON 181
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MHB: stud end position
MHC: high return position
MHD: stud diameter
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
Cycle description:
1. Rapid positioning on the plane on stud center
2. Positioning on approach point, at MHS distance from the stud surface
3. If MHK > 0, machining approach to MHA position, and spiral descent up to MHB position.
The descent is made by increasing the MHK depth at every turn.
If MHK = 0, descent in feed up to the MHB position, profile approach and contouring
machining in a single turn.
Contouring passes are executed in clockwise or counterclockwise direction with the
following criteria:
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
4. Detach from the wall
5. Rapid return to MHC position
6. Return on stud center
MHD > 0
MHS
MHD
MHD < 0
MHC
MHA
MHK
MHB
182
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Parameter passing:
All necessary parameters are specified by programming them on the same line containing the
activation of G801. In the program line containing a G801 activation, it is possible to program only
parameters related to fixed cycles programming.
For example, with reference to the cycle G801K1, it is possible to set the parameters by
programming:
G801 MPX0 MPY0 MPJ10 MPK5 MPN5
The parameter F is not directly programmable on the G801 line, so a correct writing is as
follows:
F1000
G801 MPX0 MPY0 MPJ10 MPK5 MPN5
Parameter programming and macro activation may happen on the same line or on different
lines.
As an example, all following syntaxes are equivalent:
G801K1 MPX0 MPY0 MPJ10 MPK5 MPN5 (parameter programming and macro
activation)
and
G801 MPX0 MPY0 MPJ10 MPK5 MPN5 (parameter programming)
G801K1 (macro activation)
D. ELECTRON 183
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
At the end of machining the macro parameters are cleared, if the recalling of a new machining is
desired, all necessary parameters must be programmed anew
184
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MPX, MPY: starting point coordinates
MPJ, MPK: increments on the first and second axis of the plane
MPN: number of points
MPK
MPX 0
MPJ
MPY
Mandatory parameters:
MPX, MPY: starting point coordinates
MPG: line slope angle
MPP: distance between points
MPN: number of points
D. ELECTRON 185
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
P
MP
0 MPG
MPX
MPY
Mandatory parameters:
MPX, MPY: starting point coordinates
MPA, MPB: end point coordinates
MPN: number of points
MPB
MPX 0
MPA
MPY
186
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MPX, MPY: starting point coordinates
MPJ, MPK: row increments
MPV, MPW: column increments
MPN: number of points in a row
MPM: number of points in a column
MPV
MPJ
MPK
MPW
MP M
MPY
MPN
0 MPX
Mandatory parameters:
MPX, MPY: starting point coordinates
MPP: distance between row points
MPG: row angle relative to the first axis of plane
MPQ: distance between column points
MPT: column angle relative to the first axis of plane
MPN: number of points in a row
MPM: number of points in a column
D. ELECTRON 187
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
MPT
MPP
MPQ
MP M
MPG
MPY
MPN
0 MPX
7.2.6 G801K6: GRID – ROW AND COLUMN STARTING AND END POINTS
Mandatory parameters:
MPX, MPY: first row starting point coordinates
MPA, MPB: first row end point, last column starting point coordinates
MPC, MPD: last column end point coordinates
MPN: number of points in a row
MPM: number of points in a column
MPD
MP M
MPB
MPY
MPN
188
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If MPC is positive, positioning happens counterclockwise
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPN: number of points
MPL
MPA
MPY
MPC
0 MPX
D. ELECTRON 189
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If MPC is positive, positioning happens counterclockwise
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPN: number of points
MPP
MPA
MPY
MPC
0 MPX
190
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If MPC is positive, positioning happens counterclockwise
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPB: final angle
If MPA = MPB the points are spaced along the whole circumference, starting from the
initial angle.
MPN: number of points
M
PB
M PA
MPY
MPC
0 MPX
D. ELECTRON 191
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MPX, MPY: rectangle center coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height
MPP
MPQ
MPG
MPY
MP
M
N
MP
MPX
0
Mandatory parameters:
MPX, MPY: rectangle center coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPL: rectangle base
MPM: number of points on rectangle height
MPH: rectangle height
192
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
L
MP
MP
H
G
MP
MPY
MP
M
N
MP
MPX
0
Mandatory parameters:
MPX, MPY: lower left corner coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height
P
MP
MP
Q
MPG
MP
M
MPY MPN
MPX
0
D. ELECTRON 193
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
MPX, MPY: lower left corner coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPL: rectangle base
MPM: number of points on rectangle height
MPH: rectangle height
L
MP
MP
H
G
MP
MP
M
N
MPY MP
MPX
0
194
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Parameter passing:
All necessary parameters are specified by programming them on the same line containing the
activation of G802. In the program line containing a G802 activation, it is possible to program only
parameters related to fixed cycles programming.
Unlike G800 and G801, with G802 it is possible to program the positions of continuous axes, in
order to define the macro reference point (i.e. a pocket center).
For example, with reference to the cycle G802K1, it is possible to set the parameters by
programming:
G802 X10 Y10 MMA0 MMB-20 MMC10
An example of not correct programming is the following:
G802 X10 Y10 MMA0 MMB-20 MMC10 F1000
The parameter F is not directly programmable on the G802 line, so a correct writing is as
follows:
F1000
G802 X10 Y10 MMA0 MMB-20 MMC10
Parameter programming and fixed cycle activation may happen on the same line or on different
lines.
As an example, all following syntaxes are equivalent:
G802K1 X10 Y10 MMA0 MMB-20 MMC10 (parameter programming and macro
activation)
and
G802 X10 Y10 MMA0 MMB-20 MMC10 (parameter programming)
G802K1 (cycle activation)
At the end of machining the macro parameters are cleared, if the recalling of a new machining is
desired, all necessary parameters must be programmed anew
D. ELECTRON 195
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Example:
G802 MMA0 MMB-30 MMC10 MMD60
G802K1 HX1 MMK1 MME2 MMW1 MMQ4
Please note that the pocket center positions are not programmed.
A fixed cycle may be suspended by the function G27X (see introduction to G800 fixed cycles).
By using a machining macro connected with a positioning macro, it is possible to use the
machining rotation (parameter MHR).
196
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Pocket geometry:
- The pocket is defined with:
- Pocket center coordinates
- Pocket diameter (MMD parameter)
- Pocket start position (MMA parameter)
- Pocket end position (MMB parameter)
- the pocket may be conical (MMN parameter)
Emptying cycle:
- The pocket is emptied starting from the center and proceding toward the exterior, with a
spiral movement.
- The machining feed on the plane corresponds to the F parameter
- The distance between passes on the plane depends on the paramater MMP, defining the
overlap between passes.
- Passes on the plane may be executed on counterclockwise or clockwise direction. If the
MMJ parameter is zero, passes are executed in counterclockwise direction (machining
concordant with the tool running in M3); if MMJ is 1, passes are executed in clockwise
direction (machining discordant with the tool running in M3).
- The MMS parameter the machining allowance:
-If the MMV parameter is equal to 1, at the end of the pocket, a further pass is executed,
removing the MMS allowance programmed. This optional pass is executed with circular
approach and retract.
Pass increment:
- The depth pass increment (MMK parameter) may be executed on pocket center in a pre-
hole, or with a ramp descent.
If MMW = 0, at the end of each pass, the tool retracts from the machined surface of a safety
distance (MME parameter), then it executes a rapid positioning to pocket center, and
executes the pass increment with MMF feed.
If MMW = 1. the pass increment is executed with a ramp descent. The parameter MMQ
specifies the maximum slope of the ramp. Depending on the pass increment and on the
maximum ramp slope MMQ, the descent is executed with a spiral movement around
pocket center with a feed equal to MMF. If MMQ is zero, the descent is executed with a
single movement.
Cylindrical and toroidal tools may be used. The parameter R defines the tool radius, while the
MMU parameter defines the insert radius in case of toroidal tools.
Mandatory parameters:
pocket center coordinates (programmed through axes positions)
MMD: pocket diameter
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MMK: pass depth
MME: safety distance
D. ELECTRON 197
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
MMP MMJ=0
AA, AB
MMJ=1
MMD
R MMC
MMS MME
MMA
MMK
MMB
MMU MMN
198
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Pocket geometry:
- The pocket is defined with:
- Pocket center coordinates
- Length of the two sides (MML and MMH parameters)
- Angle rotation on the plane (MMG parameter)
- Pocket start position (MMA parameter)
- Pocket end position (MMB parameter)
- Pocket corners may be rounded (MMR parameter)
- The pocket may be conical (MMN parameter) In case of conical pocket, the connecting
radiuses may be handled like constant or variable connections (MMX parameter).
Emptying cycle:
- The pocket is emptied starting from the center and proceding with passes parallel to the
pocket sides.
- The machining feed on the plane corresponds to the F parameter
- The distance between passes on the plane depends on the paramater MMP, defining the
overlap between passes.
- Passes on the plane may be executed on counterclockwise or clockwise direction. If the
MMJ parameter is zero, passes are executed in counterclockwise direction (machining
concordant with the tool running in M3); if MMJ is 1, passes are executed in clockwise
direction (machining discordant with the tool running in M3).
- The last pass is executed with circular approach and detach.
- The MMS parameter the machining allowance:
-If the MMV parameter is equal to 1, at the end of the pocket, a further pass is executed,
removing the MMS allowance programmed. This optional pass is executed with circular
approach and retract.
Pass increment:
- The depth pass increment (MMK parameter) may be executed on pocket center in a pre-
hole, or with a ramp descent.
If MMW = 0, at the end of each pass, the tool retracts from the machined surface of a safety
distance (MME parameter), then it executes a rapid positioning to pocket center, and
executes the pass increment with MMF feed.
If MMW = 1. the pass increment is executed with a ramp descent. The parameter MMQ
specifies the maximum slope of the ramp. Depending on the pass increment and on the
maximum ramp slope MMQ, the descent is executed with a ZIG ZAG with a feed equal to
MMF. If MMQ is zero, the descent is executed with a single movement.
Cylindrical and toroidal tools may be used. The parameter R defines the tool radius, while the
MMU parameter defines the insert radius in case of toroidal tools.
List of parameters of the roughing macro for rectangular pockets with known pocket center:
Mandatory parameters:
pocket center coordinates (programmed through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
D. ELECTRON 199
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
MMH
MML
MMC
MMS MME
R MMA
MMK
MMB
MMU MMN
200
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
The machining cycle of this macro is very similar to the roughing macro where the pocket
center is known. The only difference is in the programmed coordinates: those of a pocket
corner, instead of pocket center.
In this case the AA and AB parameters represent une pocket corner, while MML and MMH
are the two pocket sides. The sign of MML and MMH must be assigned according to the
following figure:
MML>0
MMH>0 MMH<0
MML>0
MML<0
MMH>0 MMH<0
MML<0
List of parameters of the roughing macro for rectangular pockets with known corner:
Mandatory parameters:
corner coordinates (programmed through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
D. ELECTRON 201
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
MMP
MMG
MMR
MMH
MML
MMC
MMS MME
R MMA
MMK
MMB
MMU MMN
202
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Pocket geometry:
- The pocket is defined with:
- Pocket center coordinates
- Pocket diameter (MMD parameter)
- Pocket start position (MMA parameter)
- Pocket end position (MMB parameter)
- The pocket may be conical (MMN parameter)
Finishing cycle:
- The MMV parameter defines the side where profile approach and detach movements are
made. If MMV=0, approaches are executed on the right side of the pocket; while with
MMV=1 approaches happens on left side.
- Th MMQ parameter defines the approach and detach radius from the wall.
- The machining feed corresponds to the F parameter
Pass increment:
-The MMK parameter defines pass depth.
- The MMW parameter handles the spiral or constant position passe milling mode.
- If MMW=0, the finishing is executed with constant position passes. On each pass, a profile
approach and detach with radius MMQ and feed MMF is executed. The pass increment is
executed in rapid.
If MMW=1, also in case of conical pockets, the machining begins with a circular approach
with radius MMQ, up to the MMA pocket start position, then continues with a spiral
movement (at each turn the depth is increased by MMK), up to the end pocket position
MMB. At this point, the profile with constant position MMB is executed, and then the detach
with MMQ radius and MMF feed. In case of spiral finishing and conical pocket, the EC
parameter defines the chordal error used to subdivide in points the spiral movement.
At the end of machining a retract up to MMC position is executed.
Cylindrical, toroidal and spherical tools may be used. The parameter R defines the tool
radius, while the MMU parameter defines the insert radius in case of toroidal tools. If
MMU=R, the tool is spherical.
Mandatory parameters:
pocket center coordinates (programmed through axes positions)
MMD: pocket diameter
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
D. ELECTRON 203
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
MMJ=0
AA, AB
MMD MMJ=1
MMQ
R MMC
MMS MME
MMA
MMK
MMU MMB
MMN
204
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Pocket geometry:
- The pocket is defined with:
- Pocket center coordinates
- Length of the two sides (MML and MMH parameters)
- Angle rotation on the plane (MMG parameter)
- Pocket start position (MMA parameter)
- Pocket end position (MMB parameter)
- Pocket corners may be rounded (MMR parameter)
- The pocket may be conical (MMN parameter) In case of conical pocket, the connecting
radiuses may be handled like constant or variable connections (MMX parameter).
Finishing cycle:
- The MMV parameter defines the wall where profile approach and detach movements are
made. If MMV=0, approaches are executed on the right wall; while with MMV=1
approaches happens on left wall.
- Th MMQ parameter defines the approach and detach radius from the wall.
- The machining feed corresponds to the F parameter
Pass increment:
-The MMK parameter defines pass depth.
- The MMW parameter handles the spiral or constant position passes milling mode.
Spiral milling is only possible in case of cilindrical pockets (MMN=0).
- If MMW=0, the finishing is executed with constant position passes. On each pass, a profile
approach and detach with radius MMQ and feed MMF is executed. The pass increment is
executed in rapid.
If MMW=1, in case of cilindrical pockets, the machining begins with a circular approach with
radius MMQ, up to the MMA pocket start position, then continues with a spiral movement
(at each turn the depth is increased by MMK), up to the end pocket position MMB. At this
point, the profile with constant position MMB is executed, and then the detach with MMQ
radius and MMF feed.
Cylindrical, toroidal and spherical tools may be used. The parameter R defines the tool
radius, while the MMU parameter defines the insert radius in case of toroidal tools. If
MMU=R, the tool is spherical.
List of parameters of the finishing macro for rectangular pockets with known pocket center:
Mandatory parameters:
pocket center coordinates (programmed through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
D. ELECTRON 205
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
MMQ
MMG
MMR
AA, AB
MMH
MML
MMC
R MMS MME
MMA
MMK
MMB
MMU MMN
206
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
The machining cycle of this macro is very similar to the finishing macro where the pocket
center is known. The only difference is in the programmed coordinates: those of a pocket
corner, instead of pocket center.
In this case the AA and AB parameters represent une pocket corner, while MML and MMH
are the two pocket sides. The sign of MML and MMH must be assigned according to the
following figure:
MML>0
MMH>0 MMH<0
MML>0
MML<0
MMH>0 MMH<0
MML<0
List of parameters of the finishing macro for rectangular pockets with known corner:
Mandatory parameters:
corner coordinates (programmed through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
D. ELECTRON 207
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
MMQ
MMG
MMR
MMH
MML
MMC
R MMS MME
MMA
MMK
MMB
MMU MMN
208
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Eyelet geometry:
- Eyelet center coordinates
- Angle rotation of the eyelet (MMG parameter)
- Eyelet length (MML parameter)
- Eyelet width (MMD parameter)
Finishing (only if TL = 0 or TL = 2)
1. Rapid positioning on point A (or B, depending on the sign of MML)
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (finishing pass depth MMK) with feed equal to MMF.
4. Finishing contouring
5. Repetition of steps 3, 4 until the eyelet end position MMB is reached. If a very high pass
depth is programmed (greater that the eyelet depth), a single pass is executed to the
MMB position.
D. ELECTRON 209
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
eyelet center coordinates (programmed through axes positions)
MML: eyelet length
MMD: eyelet width
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
MMG
B A
MMD
AA, AB
MML
MMC
MMS MME
MMA
MMK, MMH
MMB
210
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Eyelet geometry:
- Eyelet center coordinates
- Angle rotation of the eyelet (MMG parameter)
- Eyelet length in degrees (MML parameter)
- Eyelet width (MMD parameter)
- Eyelet radius (MMR parameter)
Finishing:
1. Rapid positioning on point A (or B, depending on the sign of MML)
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (finishing pass depth MMK) with feed equal to MMF.
4. Finishing contouring
5. Repetition of steps 3, 4 until the eyelet end position MMB is reached. If a very high pass
depth is programmed (greater that the eyelet depth), a single pass is executed to the
MMB position.
D. ELECTRON 211
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
eyelet center coordinates (programmed through axes positions)
MML: eyelet length
MMD: eyelet width
MMR: eyelet curvature radius
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
MMR A
MMC
MMS MME
MMA
AA, AB MMG
MMK
MMH
MMB
MMD
MML
212
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Eyelet geometry:
- Curvature center cordinates
- Angle rotation of the eyelet (MMG parameter)
- Eyelet length in degrees (MML parameter)
- Eyelet width (MMD parameter)
- Eyelet radius (MMR parameter)
Finishing:
1. Rapid positioning on point A (or B, depending on the sign of MML)
2. Rapid descent up to the safety position (MMA+MME)
3. Descent to the computed depth (finishing pass depth MMK) with feed equal to MMF.
4. Finishing contouring
Repetition of steps 3, 4 until the eyelet end position MMB is reached. If a very high pass
depth is programmed (greater that the eyelet depth), a single pass is executed to the
MMB position.
D. ELECTRON 213
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Mandatory parameters:
curvature center coordinates (programmed through axes positions)
MML: eyelet length
MMD: eyelet width
MMR: eyelet curvature radius
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
A
MMR
MML
AA, AB MMG
MMC MMD
MMS MME
MMA
MMK
B
MMH
MMB
214
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
7.3.10 G802K10: HOLE THREAD MILLING WITH A SINGLE FLUTE END MILL
The program executes the threading of a hole with a single flute end mill.
The thread may be right or left, depending on the value of MMJ: right thread if MMJ=0, or left if
MMJ=1.
The machining may be concordant (from low to high) or discordant (from high to low), depending
on the values of MMA and MMB.
MMA represents the start thread position
MMB represents the thread end position
If MMA is lower than MMB, the machining is executed from low to high.
If MMA is higher than MMB, the machining is executed from high to low.
The cycle is designed to guard the lower Z position inside the workpiece (MMA or MMB). The
highest Z position may be greater than the value programmed, with the purpose to execute an
integer number of threads, plus a half thread (a quarter for entry and a quarter for exit).
Mandatory parameters:
hole center coordinates (programmed through axes positions)
MMD: bottom of thread diameter
MMQ: hole diameter
MMA: start machining position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMN polishing passes.
MMQ
MMB
D. ELECTRON 215
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
The program executes the threading of a hole with a comb end mill.
The thread may be right or left, depending on the value of MMJ: right thread if MMJ=0, or left if
MMJ=1.
The machining may be concordant (from low to high) or discordant (from high to low), depending
on the values of MMA and MMB.
MMA represents the start thread position
MMB represents the thread end position
If MMA is lower than MMB, the machining is executed from low to high.
If MMA is higher than MMB, the machining is executed from high to low.
The cycle is designed to guard the lower Z position inside the workpiece (MMA or MMB). The
highest Z position may be greater than the value programmed, with the purpose to execute an
integer number of threads, plus a half thread (a quarter for entry and a quarter for exit).
Mandatory parameters:
hole center coordinates (programmed through axes positions)
MMD: bottom of thread diameter
MMQ: hole diameter
MMA: start machining position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMN polishing passes.
MMH: comb height (mm or inches, depending on machine setup)
MMS: threads overlap (number of threads). If the area to be threaded is smaller than comb
height, the threading may be executed in a single turn (adding a fourth of turn approach
and a fourth of turn retract); if the area to be threaded is higher than comb height, the
threading is executed in more than one turn. After each turn, the comb is translated by a
quantity equal to comb height minus the programmed overlap.
Optional parameters for safety distance:
(MME): safety distance on thread top and bottom. The approach (and retraction) to the
thread is executed in a fourth of thread; the MME diameter indicates the starting diameter
initiating the fourth of thread approach to the machining. For example, if the internal
diameter is 50, tool radius is 10 and MME is 2, the approach point is at coordinates X0 Y13.
If MME=0 a default safety distance of 2mm is assumed.
Optional parameters for polishing passes:
(MMN): number of polishing passes.
Optional parameters for last roughing pass:
(MMW): last roughing pass depth. If MMW=0, all roughing passes have the same pass
increment, less than or equal to MMK. If MMW>0, the last roughing pass has a MMW
depth. MMD
MMA
Optional parameters for thread direction:
(MMJ): thread direction
MMJ = 0 : right thread MMP
MMJ = 1 : left thread
MMQ
MMB MMH
216
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
7.3.12 G802K12: STUD THREAD MILLING WITH A SINGLE FLUTE END MILL
The program executes the threading of a stud with a single flute end mill.
The thread may be right or left, depending on the value of MMJ: right thread if MMJ=0, or left if
MMJ=1.
The machining may be concordant (from low to high) or discordant (from high to low), depending
on the values of MMA and MMB.
MMA represents the start thread position
MMB represents the thread end position
If MMA is lower than MMB, the machining is executed from low to high.
If MMA is higher than MMB, the machining is executed from high to low.
The cycle is designed to guard the lower Z position inside the workpiece (MMA or MMB). The
highest Z position may be greater than the value programmed, with the purpose to execute an
integer number of threads, plus a half thread (a quarter for entry and a quarter for exit).
Mandatory parameters:
stud center coordinates (programmed through axes positions)
MMD: external diameter
MMQ: bottom of thread diameter
MMA: start machining position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMN polishing passes.
MMQ
MMB
D. ELECTRON 217
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
The program executes the threading of a stud with a comb end mill.
The thread may be right or left, depending on the value of MMJ: right thread if MMJ=0, or left if
MMJ=1.
The machining may be concordant (from low to high) or discordant (from high to low), depending
on the values of MMA and MMB.
MMA represents the start thread position
MMB represents the thread end position
If MMA is lower than MMB, the machining is executed from low to high.
If MMA is higher than MMB, the machining is executed from high to low.
The cycle is designed to guard the lower Z position inside the workpiece (MMA or MMB). The
highest Z position may be greater than the value programmed, with the purpose to execute an
integer number of threads, plus a half thread (a quarter for entry and a quarter for exit).
Mandatory parameters:
stud center coordinates (programmed through axes positions)
MMD: external diameter
MMQ: bottom of thread diameter
MMA: start machining position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMN polishing passes.
MMH: comb height (mm or inches, depending on machine setup)
MMS: threads overlap (number of threads). If the area to be threaded is smaller than comb
height, the threading may be executed in a single turn (adding a fourth of turn approach
and a fourth of turn retract); if the area to be threaded is higher than comb height, the
threading is executed in more than one turn. After each turn, the comb is translated by a
quantity equal to comb height minus the programmed overlap.
Optional parameters for safety distance:
(MME): safety distance on thread top and bottom. The approach (and retraction) to the
thread is executed in a fourth of thread; the MME diameter indicates the starting diameter
initiating the fourth of thread approach to the machining. For example, if the internal
diameter is 50, tool radius is 10 and MME is 2, the approach point is at coordinates X0 Y37.
If MME=0 a default safety distance of 2mm is assumed.
Optional parameters for polishing passes:
(MMN): number of polishing passes.
Optional parameters for last roughing pass:
(MMW): last roughing pass depth. If MMW=0, all roughing passes have the same pass
increment, less than or equal to MMK. If MMW>0, the last roughing pass has a MMW
depth.
MMD
Optional parameters for thread direction: MMA
(MMJ): thread direction
MMJ = 0 : right thread
MMJ = 1 : left thread MMP
MMH
MMQ
MMB
218
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
The program executes the face milling of a rectangular area defined through two opposite points
(vertices). The area to be milled is corrected with the tool radius dimensions.
The milling is executed with a zig-zag movement.
The distance between passes is defined with the MMP parameter, specifying the minimum
overlap.
The MMF parameter may be used to reduce the feed during the approach to the workpiece.
The pass increment is defined with the MMV parameter. If MMV = 0, the pass increment is
executed in G1 on the internal side of working rectangle. If MMV = 1, the pass increment is
executed in G0 on the external side of working rectangle of 2mm.
Mandatory parameters:
first vertex coordinates of rectangular area (programmed through axes positions)
MMX: working plane first axis coordinate of rectangular area second vertex.
MMY: working plane second axis coordinate of rectangular area second vertex.
MMA: rapid approaching position
MMB: facing position
MMC: high retraction position
MMV=1 AA, AB
MMV=0 MMP
MMX, MMY
MMC
MMA MMB
D. ELECTRON 219
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
7.4 EXAMPLES
Example 1:
220
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Example 2:
Usage of the G801K7 positioning macro, with a part-program stored in CMOS program 40
S2000 M3 F800
(Program P40 defines the figure to be moved on circle points)
--DEFINE P40
G0X0Y0
Z2
G1Z0
Z-1
G1X10
Y5
X-10
Y-5
X10
Y0
G0X0Y0
Z2G0
G26
--END DEFINE
PAR[1]3
(G801K7 recall to position the figure stored in CMOS program
number 40)
(MPF=40: positions program 40)
(MPR=1: rotate the figure)
(positioning macro recall)
G801K7 MPX10 MPY20 MPC100 MPA0 MPL0 MPN8 MPS1 MPW1 MPF40 MPR1
G0 Z50
G0 Z50
M2
D. ELECTRON 221
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Example 3:
Usage of the G801K7 positioning macro, with a part-program stored in CMOS program 40
S2000 M3 F800
This second part-program is different from the preceding only for positioning type (linear
movements) and the machining stored in file 40 is not rotated (MPR=0).
222
D. ELECTRON
CNC Z32 Programing Manual Chapter 7 - Z32 Canned cycles and macros
Example 4:
S2000 F1200 M3
G0 Z50
R5
(parameters and fixed cycle recall)
(MMA=0: upper pocket position)
(MMB=-20: lower pocket position)
(MMC=10: exit position at machining end)
(MMD=60: pocket diameter)
(X,Y: pocket center)
(MMK=3: pass depth)
(MME=2: safety distance)
G802 MMA0 MMB-20 MMC10 MMD80
G802K1 X10 Y10 MMK3 MME2
M2
D. ELECTRON 223
CNC Z32 Programming Manual Chapter 7 - Z32 Canned cycles and macros
Example 5:
Usage of the G802K1 machining macro (circular pocket roughing) as a fixed cycle:
S2000 F1200 M3
G0 Z50
R5
(parameters and fixed cycle recall)
(MMA=0: upper pocket position)
(MMB=-10: lower pocket position)
(MMC=10: exit position at machining end)
(MMD=30: pocket diameter)
(X,Y: pocket center)
(HX=1: use as fixed cycle)
(MMK=3: pass depth)
(MME=2: safety distance)
(MMW=1: ramp sinking)
(MMQ=4: maximum slope of sinking ramp)
224
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 – User Canned Cycles and Permanent Sub-Programs
CHAPTER 8
User’s The user canned cycles can be programmed directly by the end user, to suit his needs. When
canned the activated canned cycle number is 31 or higher the Z32 automatically searches the user canned
cycles cycle, which must be a subprogram resident in memory with a number equal to that of the activated
canned cycle.
For example with the instruction:
G27C100 the canned cycle in “file” number 100 is activated.
Rapid The user canned cycles do not stop the progressive number (unless G36H and G36S are used)
traverse and they do not stop line display: therefore a block search procedure inside a user canned cycle
can be performed (save for G36H/S).
The canned cycle sub-programs are, like all programs, sub-programs and tables, inserted in
memory through EDITOR or input from external sources.
Once a canned cycle is activated it is executed automatically after every programmed
TRAVERSE positioning. Even if a canned cycle is active, it will be not executed if movements are of
working type.
It is not possible to call a canned cycle inside a canned cycle, any traverse positioning inside the
canned cycle will not cause a canned cycle jump after their execution.
All the Z32 functions (traverse axes or working movements, stops, tool changes and auxiliary
functions...) can be programmed inside a ‘canned cycle’ sub-program.
D. ELECTRON 225
Chapter 8 – User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
226
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 – User Canned Cycles and Permanent Sub-Programs
D. ELECTRON 227
Chapter 8 – User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
228
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 – User Canned Cycles and Permanent Sub-Programs
Parameters:
HA hole start position
HB hole end position
HC exit position
TT dwell time
Program 175:
BORING WITH SPINDLE STOP%
N1 G0 AC<HA>
N2 G1 AC<HB> M5
N3 G4
N4 G0 AC<HC>
N5 M3 G26
D. ELECTRON 229
Chapter 8 – User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
INTERNAL MILLING%
N1 !IFHD<=2*R;EXCESSIVE TOOL RADIUS!
N2 G1 AC<HA>
N3 G2 AA<AA+HD/2-R> AB<AB> I<AA-HD/4+R/2> J<AB>
N4 AA<AA> AB<AB+.001> I<AA-HD/2+R> J<J>
N5 AA<I> AB<J> I<I+HD/4-R/2> J<J>
N6 G0 AC<HC> G26
NOTE:
N1 gives an error (field ! EXCESSIVE TOOL RADIUS! is an error of syntax) if the hole diameter
is not greater than the tool diameter. If instead the hole diameter is larger the incorrect field is not
executed and therefore the syntax error is not detected and work proceeds normally.
8.1.9 Example of Drill with working forward/reversal and stop at hole end
G27C9.... . Composition:
1) traverse movement to hole start
2) working to hole end
3) dwell
4) working to hole start
5) traverse to exit position
Parameters:
HA hole start position
HB hole end position
HC exit position
TT dwell time
Program 178:
DRILLING WITH PAUSE AND RETURN IN WORKING%
N1 G0 AC<HA>
N2 G1 G4 AC<HB>
N3 AC<HA>
N4 G0 AC<HC> G26
230
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 – User Canned Cycles and Permanent Sub-Programs
For the canned cycle the actual jump was obtained, after activation, by programming a
KG movement in G0; for the permanent sub-program the jump is obtained by programming (with sub-
executes program operating) the KG parameter in ISO line. For example:
spgr. ...
N10 G27P50
N11 X0 the sub-program is not executed
N12 KG1 executes
N13 X10 does not execute
N14 !KG=1! does not execute
N15 KG0 X50 executes
...
Contrary to what happens for canned cycles (for which the jump to the sub-program takes place
AFTER execution of the programmed traverse positioning), in the case of permanent sub-programs
the ISO line containing the KG that generates the jump is executed, but before the axis movements
there is a jump to the sub-program as parameters. Any movement must be ordered by the called
sub-program.
The reason for this is that the permanent sub-programs, as will be seen, are dedicated to the
special management of axis movement that can be manipulated inside the sub-program.
The value KG parameter, which generates the jump, may be any value. The value is passed to
the sub-program as it is programmed: KG can be controlled inside the sub-program and used to
perform execution variations.
The permanent sub-program can be inside any file, including protected files (over 128). The
canned cycle sub-programs can also be called as permanent sub-programs. In this case the
canned user cycles are called with the same number (over 30) whilst the canned system cycles are
called with the number of the sub-program (from 170 to 199) instead of the number of the canned
cycle (from 1 to 30).
During the execution of a permanent sub-program:
− the sub-program lines are not displayed but the line of the beginning program remains
displayed
− the progressive number is increased regularly (except for G36H) and so it is possible to
research a block inside a permanent program.
The jump to a permanent sub-program consumes one jump/return nesting level
A few possible applications:
− execution of repetitive profile segments
− modifying axes movements
− specialized plane geometry
− working in the space, 4 or 5 axes
− electroerosion machining, 5 axes
In the following paragraphs we give two examples on the use of permanent sub-programs. Note
that the same machining may be done in another way (for example with !GOP...! or with jump to
series of lines). The use of permanent sub-programs makes the program simpler and more legible.
D. ELECTRON 231
Chapter 8 – User Canned Cycles and Permanent Sub-Programs CNC Z32 Programming Manual
SUB-PROGRAM 20
%
N1 G1 X<X> Y<Y>
N2 Y<Y-30>
N3 !IFKG=2;GON7!
N4 !IFKG1;ERROR KG PRG.20
N5 X<X+20> (GETS PLANE BOTTON)
N6 !GON9!
N7 X<X+10> Y<Y-5> (GETS INCLINED PLANE)
N8 X<X+10> Y<Y+5>
N9 Y<Y+30> (GOES UP TO START POSITION)
N10 G26
Please note how the use of a canned cycle would not have been possible due to the presence of
radius compensation (there cannot be segments in G0).
232
D. ELECTRON
CNC Z32 Programming Manual Chapter 8 – User Canned Cycles and Permanent Sub-Programs
D. ELECTRON 233
CNC Z32 Programming Manual Chapter 9 – Permanent Formulae
CHAPTER 9
9. PERMANENT FORMULAE
9.1 GENERAL
One of the characteristics of Z32 is that it can program parameters and axes positions through
mathematical formulae, for example:
X<HA+Y*0,01>
assigns to ‘X’ , and to the programmed position on X axis, the value resulting from the
calculation enclosed in the acute brackets (HA parameter value plus one hundredth of Y parameter
value). The parameter values that a formula takes into consideration are the instantaneous values
when the CNC analyzes the line.
For the continuous axes only, it is possible to have Z32 recalculate a formula in a permanent
way, that is in real time, during the execution of programmed movements, taking as axes parameter
value the instantaneous interpolated point related to the active origin.
This function is obtained by programming the formula in double acute brackets in an ISO line on
the desired continuous axis. For example:
X<<X+0,1*Y>>
It is possible to program profiles, traverse movements etc. after the formula in an absolutely
normal way. The real axes movements will be changed by the formula introduced during their
execution. In the example case (for triad G25XYZ) the entire figure will have a 10% inclination on
the right.
Permanent formulae may be programmed in all continuous and alive axes, also in the axes not
directly involved in the movement. For example, if a machine has X, Y, Z and B axes and all axes
are alive (see the G28 functions) by programming on B axis a formula that unites its movement to
the other axes the four continuous axes can move simultaneously.
The permanent formulae are active both in working motions and in traverse motions.
The programmer must be careful when introducing a permanent formula. These precautions will
be explained in detail.
In the absence of permanent formulae, Z32 moves the axes after doing a series of calculations
that are:
1) programmed point analysis and their recalculation with roto-traslation, mirroring, scale
factor, if necessary.
2) determination of geometric paths and possible recalculation with radius compensation
3) verification that the calculated paths are inside the end position of the machine
4) determination of execution speed and possible slowing down in relation to programmed
speed, curvatures and edges of calculated paths
5) path interpolation in real time (calculation of next points calculation at a rhythm of about
500 times per second)
6) control of physical tracking errors (500 times per second) and of motion to all alive axes, to
keep the machine on path with minimum error.
The following figures were obtained with a few simple formulae realizing a part-program referred
to the normal figure (circle enclosing the lettering Z32) and introducing the formulae reproduced in
the figures.
D. ELECTRON 235
Chapter 9 – Permanent Formulae CNC Z32 Programming Manual
Between points 5 and 6, the introduction of a permanent formula requires that a further pass be
made 500 times per second:
5a) permanent formulae application on all alive axes involved, and point computation on the
deformed path equivalent to the calculated point on the origin path.
Speed
The difficulties that may derive from the introduction of a permanent formula are basically:
Problems − the path execution speed is constant and corresponds to the programmed speed on the
original path. The accelerations are calculated for original path. On the deformed path
the speed and acceleration are also deformed and therefore may be either lower or
greater. This entails a further control that the speed does not exceed the traverse speed
and can lead to tracking errors if the speed increases too much in critical profile points.
− The travel ends must not be controlled on the original path but on the deformed path
Travel ends which means the end of travel must be controlled in real time together with point 5a)
− during the introduction of the permanent formula there may be a considerable difference
between the original point and the deformed point: Z32 gives a line conversion of the
start connection for every axis where the formula is introduced. The same operation
must be done when disabling the permanent formulae.
Time limitations − Every permanent formula must be recalculated 500 times per second: that sets quite
stringent limitations to the complexity of formulae introduced.
236
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 – Permanent Formulae
+ addition
- subtraction
* multiplication
/ division
− brackets with nesting up to 10 levels
− numerical constants (sign, 5 integers, 3 decimals)
− ‘PI’ constant (PI Greek = 3,141592...)
− parameter addresses (e.g. R, HA etc.)
− axes addresses (e.g. X, Y etc.)
The syntax of a permanent formula is the same as that of a normal formula, except for complex
mathematical operations (for reasons of execution time) (RQ square root, SN sine, CS cosine, AT
arctangent).
Examples of formally correct formulae:
X<<X*0,9>> introduces a scale factor of 90% on X axis
X<<0>> keeps the axis stopped at zero
X<<X+1>> moves X origin +1mm: it makes heavier computer work unnecessary.
It is better to move the origin or introduce a traslation (DA)
X<<X+0,001*Y*Y>> introduces a parabolic deformation on X axis
D. ELECTRON 237
Chapter 9 – Permanent Formulae CNC Z32 Programming Manual
Permanent formulae activation is obtained with an ISO line containing even only one permanent
formula. Disabling is obtained by programming null formulae and variation by simply programming
the new formulae.
All permanent formulae to be cancelled must be programmed, for reasons which will be
explained better in the following paragraph.
Example:
N1 X<<X*0,96>> B<<B*RX/100>> enabling: from now on the formulae are operating
on the X and B axes
N50 X<<X*0,9>> Y<<Y*0.8>> B<<>> variation on X axis, disabling of B and enabling of Y
N100 X<<>> Y<<>> disabling on all axes with active formulae, that is X
and Y
If the programmer wants to add permanent formulae to formulae already operating, he may
program a formula with ‘!’ initial character.
For example:
N10 X<<X*.97>>
...
N12 Y<<!Y*.8>>
If a new formula is programmed on an axis which already has a permanent formula, the old
formula is disabled but not deleted from the memory: hence from the length point of view (and of
the alarm CN3814 <<FORMULA TOO LONG>>) the new formula is added to the previous one.
238
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 – Permanent Formulae
This characteristic permits, as shall be seen later, the connection associated to a permanent
formula to be avoided.
The situation is the same in the case of disabling or variation of a permanent formula. Also in
this case the machine point may be shifted due to the formula and therefore a connection has to be
introduced.
It should be noted that the presence of even a single permanent formula in an ISO line implies
the cancellation of all the formulae. Since the connection is calculated only for the formulae actually
programmed, is all the formulae previously activated are not “closed”, there can be CN0113 or
CN0013 alarms due to the resulting discontinuity of movement.
he following examples illustrate the behaviour of the Z32 with regard to connections in extreme
situations which in all probability will never occur in practice.
N. 1 Example
...
N10 OX1 OY1 OZ1 X0Y0Z0 F1000 disables origin 1 and axes move to origin
N20 X<<X*0.9>> permanent formula activation: the initial connection has
a null length because the old point (X = 0) coincides
with new point (X = 0*0.9 = 0).
N30 X100 move to X90 because of the formula
N40 X<<>> formula disabled and final connection from old point
calculated with the formula (X = 90) to new point (X = 100)
...
N. 2 Example
...
N10 X100Y100Z0OX1OY1OZ1 F1000
N20 X<<X*0.9>> Y<<Y*0.8>> parallel movement of X axis from 100 to 90 (F1000 speed)
and then parallel movement of Y axis from 100 to 80
N30 X200 X axis moves from 80 to 160
N40 X<<>> X formula disabled and final connection from 160 to
X200. It was an error not to have disabled also formula
Y: the consequences will be seen the first time axis Y is
programmed.
N50 X100 X axis moves from 200 to 100 correctly
N60Y100 CN0013 alarm due to not having disabled Y formula
...
N. 3 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
N20 Y<<Y*0.8>> X<<X*0.9>> the connection sequence is different from example 2
because the order of programming is different. Y
connection from 100 to 80 is done before X connection
from 100 to 90.
...
N. 4 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
D. ELECTRON 239
Chapter 9 – Permanent Formulae CNC Z32 Programming Manual
N. 5 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
N20 X50 X<<X*0.8>> the result is identical to the previous example, the initial
connection goes from X100 to X40
...
N. 6 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
N20 X<<X*0.8>> X50 an initial connection from X100 to X80, then the
programmed movement to X40 (equivalent to 50*0.8)
done with formula operating.
...
N. 7 Example
...
N10 X100Y100Z0 OX1OY1OZ1 F1000
N20 X50 X<<X*0.8>> X100 an initial connection to X40 then the programmed
movement to X80 (equivalent to 100*0.8)
...
N. 8 Example
...
N10 X100 Y100 Z0 OX1 OZ1 F100
N20 X50 Y40 X<<X*0.7>> Y<<Y*0.6>> X30 Y60
... first, connection in X from 100 to 35, then the
connection in Y from 100 to 24, then an inclined
movement in XY with formulae operating up to final
point resulting X21 Y36
The programmer should consider examples 6, 7 and 8 as a means to better understand how the
Z32 behaves: they are not examples to be followed as they complicate unnecessarily an already
complex line which contains the activation of permanent formulae. The movements programmed
after the permanent formulae can be realistically programmed in a SUBSEQUENT line.
240
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 – Permanent Formulae
into machine language during the analysis of the line that contains them. A formulae ‘compilation’
permits the fastest execution. During compilation the following operands may be encountered, apart
from the mathematical operators :
− constants and parameters
− axes names (unknowns)
The parameters are considered as constants and they are introduced in the compiled formula
with the value they have during the formula compilation.
The axes names instead must be considered as unknowns because they change continuously
during the movement. The function of the compiler is to optimise the formula by performing once
only, during the compilation, all the possible calculations and leaving (to be executed 500 times per
second) only the calculations that involve unknowns (axes names).
For example, the formulae:
X<<X*0,9>> and X<<3*X*0,3>>
are executed (at 500 times per second level) in exactly the same time: the second formula
needs only a little supplementary work (negligible because it is executed only once during the
compilation) to calculate the multiplication factor of the unknown X.
During the compilation, Z32 controls the compiled formula length and the time necessary for its
execution: if either exceed the maximum admitted Z32 gives message and error:
CN3814 <<FORMULA TOO LONG>>
D. ELECTRON 241
Chapter 9 – Permanent Formulae CNC Z32 Programming Manual
242
D. ELECTRON
CNC Z32 Programming Manual Chapter 9 – Permanent Formulae
The values obtained with the permanent formula, multiplied by two, also multiply feedrates and
accelerations: precautions must be taken to avoid excessive tracking errors (e.g. piece test to avoid
traverse).
The dynamic machine performances are not utilized completely if the multiplication factor is less
than 1.
In the case of a formula with * the machine settings related to the axis involved are modified
automatically (in practice traverse and maximum axis acceleration are divided by the multiplication
factor) to bring them back to the real machine on the real path.
The <<*>> formula is very useful when programmming cylindrical profiles obtained with one
rotating axis and one linear axis.
9.1.10 Applications
The permanent formulae, even with the objective difficulties and limits mentioned above, can be
useful in performing machining which would otherwise be difficult if not impossible.
Probably the most sensitive limit of the permanent formulae is that of axis feedrate, which
becomes different from the programmed feedrate. As a general recommendation, ensure, as far as
possible, that the formulae reduce rather than enlarge. For example, if an elliptic movement of the
milling machine is desired, multiply the shortest axis by a number smaller than 1 rather than the
longest axis by a number greater than 1.
G108 may be used for enlarging formulae to bring the acceleration and the feedrate within
tolerable limits.
Ellipses
As shown in the examples at the beginning of the chapter, a circle with axes in a different scale
factor becomes an ellipsis.
WARNING
When contouring an ellipsis the milling machine does NOT travel an
ellipsis path. If a different scale factor is applied to the two axes and
radius compensation is not active a true ellipsis will not be obtained. The
nearer the tool radius is to the radii of curvature of the profile, the greater
will be the error in shape.
D. ELECTRON 243
Chapter 9 – Permanent Formulae CNC Z32 Programming Manual
Z<<Z+HA*X+HB*Y>>
the vertical movement of axis Z is tied to the horizontal position of axes X and Y.
With suitable modification to the HA and HB coefficients the tool moves exactly on the inclined
plane.
244
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
CHAPTER 10
10. GEOMETRY
10.1 GENERAL
The Z32 has a complete set of instructions to resolve the calculus problems of a geometric
contour no matter how complex.
Contours consisting of rectilinear and circular segments, with linear and circular chamfers and
connections, are easily programmed.
With G12 it is possible to coordinate with a movement on the plane a movement in the third axis
(see paragraph “Profiles on three axes” further on in this chapter).
The programs realized with basic Z32 geometry with previous software may be executed also
with the new geometry without any changes.
D. ELECTRON 245
Chapter 10 – Geometry CNC Z32 Programming Manual
End positions
The end positions represent the end point coordinates to be reached on the working plane.
The end positions are programmed with the axis name (for example X, Y, Z...) or in equivalent
way with AA parameters (first axis), AB (second axis) and AC (third axis). AA AB and AC
parameters are used to create generic sub-programs, free from the actual working plane. The
explicit axes names, X for the first axis, Y for the second axis and Z for the third axis (spindle axes)
will be used in the future for the sake of brevity and for clarity.
The Cartesian plane is defined by the first horizontal axis and by the second vertical axis.
QF end inclination
This is the angle between the positive direction of X axis and the direction of the movement at its end.
It is programmed with QF parameter and it is expressed in sexagesimal degrees (1 turn=360
degrees) and by decimal fractions of degree (e.g. QF 10,5=10 degrees and 30').
QF is positive if, starting from X axis, the direction is reached moving counter-clockwise; the
same result is obtained by programming: QF 280 and QF -80
246
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
RB chamfer
A chamfer with RB parameter may be programmed at the end of a rectilinear segment.
RB programmed value determines the chamfer length in the first segment.
The chamfer length in the second segment is:
RB if QA is not programmed
RB*tg QA if QA is programmed
The next segment must still be rectilinear: the chamfer is admitted only between two rectilinear
segments. It is mandatory that RB and QA be programmed in the segment at the end of which the
chamfer is to be inserted. See paragraph on “Automatic Chamfers”
If RB is programmed in a step where it is not allowed it gives programming errors:
CN4214 RB at circle beginning
CN4314 RB at circle end
CN4514 RB/RR at starting point (continuous)
KA selection parameter
An open segment may be closed by the next segment for intersection of two geometric entities.
If at least one of these entities is a circle there are two solutions (or one if the entities do not
intersect).
D. ELECTRON 247
Chapter 10 – Geometry CNC Z32 Programming Manual
Bends to right By observing the movement with reference to the first programmed entity, it can be seen that
one of the solutions bends to the right and the other to the left.
Bends to left
One of the two solutions causes a short connection (connection length less than half circle) and
the other causes a long connection (connection length more than half circle) if the radius of RR
connection is programmed. See paragraph on “Automatic Connections”.
The choice of the solution is made with KA parameter (it is mandatory that it be programmed in
open step where we want to choose the intersection):
KA=0 short connection if RR programmed, bends to the left if RR not programmed
KA<>0 long connection if RR programmed, bends to the right if RR not programmed
If KA is programmed in a block where it is not allowed it does not give alarms: it simply has no
effect; KA=0 may be omitted.
KA=1 KA=Ø
QA auxiliary inclination
QA parameter permits to program an auxiliary angle like QF.
The first application regards the programming of the chamfers between two lines, another
regards the line-circle combinations G1 G2/G3..QA type. The meaning is specified in the paragraph
on “Line-Circle combinations”.
248
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
Preparatory functions
The functions involved are G1, G2, G3 which are modal and mutually exclusive.
An already active G may be not programmed; in the following this possibility will be indicated with
round brackets: (G1) or (G2/G3).
G2 and G3 programmed functions may be forced, i.e. the Z32 can change the direction of travel
whenever the circle arc is connected to the previous segment. In this way the tangency condition is
privileged and edges are avoided. In the following [G2/G3] notation will indicate this situation.
Z32 geometry includes powerful line-circle combinations consisting of a line followed by a
tangent circle. These combinations are identified by the composite preparatory functions G1G2 and
G1G3 depending on whether the circle is clockwise or counter-clockwise. G1G2 and G1G3 are not
modal and are active only in the block.
D. ELECTRON 249
Chapter 10 – Geometry CNC Z32 Programming Manual
250
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
The Z32 does not recognize different combinations and it gives the alarm message CN2C14
(INCOMPATIBLE PARAMETERS).
Some segments (G1, G1 QF, G2/G3 I J RA, G2/G3 RA, G1 G2/G3 I J RA, G1 G2/G3 I J RA
QA) are ‘open’ because the segment end positions are not determinable by programmed
parameters in the block.
The other segments are closed, because they have completely determined end positions.
Open segments may be:
1. line whose inclination and start point are defined
2. circle whose centre and start point are defined
3. circle whose centre and the radius are defined
4. circle whose radius and start point are defined
The parameters taken into consideration by Z32, to define a contour segment, are exclusively
those listed (XY axes position, I J circle centre, RA radius, QF inclination, QA auxiliary inclination,
RR connection, RB chamfer, G1 G2 G3 preparatory functions): other parameters or functions may
be programmed in the same line and if they are compatible, and will be handled without causing
errors.
G1 X.. Y..
Line 1 may come from definite point or from open circle, in this case the tangency condition is
forced to a continuous point. If the previous segment is an open line the error message CN3214 will
appear (previous block wrong).
If the end point is inside a previous circle the error message CN3314 will appear (inside circle)
...
G0 X35 Y0
G1 Y10 RB1
(G1) X20
(G1) Y20 RB2
(G1) X0 QF180
....
D. ELECTRON 251
Chapter 10 – Geometry CNC Z32 Programming Manual
....
G0 X0 Y0
G1 Y10
X-10 QF120
X-20 QF165
X-30 QF180
....
RR is negative because the connection is clockwise and KA is zero because the connection is
short.
252
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
.....
G0 X70 Y0
G1 Y10
X62
(G1) X25 Y21,63
G1
QF180 X0 Y28
.....
....
G0 X0 Y0
G1 Y10
G1 QF150
G2 I-20 J30 RA10
G1 X-50 Y30 QF180
.....
D. ELECTRON 253
Chapter 10 – Geometry CNC Z32 Programming Manual
254
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
....
G0 X0 Y20
G2 I10 J15 QF-60
G3 RA20 QF30
.....
......
G0 X0 Y10
G2 X10 Y0 I0 J0
G2 X50 Y0
I70 J0 X90 Y0
G3 X110 Y0
I120 J0 X130 Y0
.....
G2/G3 I J QA
The circle 7 may come from a defined point or an open straight line, in which case the tangency
condition is imposed with the previous section and is forced, only on block, in the sense of run so as
to avoid any sharp edges.
If the previous section is an open circle an error occurs CN3214 (previous block wrong)
By programming the parameters I,J,QA it is also possible to program the complete circle.
D. ELECTRON 255
Chapter 10 – Geometry CNC Z32 Programming Manual
Where:
QA is the length in degrees of the required arc. For QA only positive values of between 0 a
360.001 are permitted.
QA values of between 359.999 and 360.001 are interpreted as being of 360.000 degrees and
form a complete circle.
Tolerance of around 360 has been introduced in the case that this 360 has been obtained
from a calculation, which in floating point could cause uncertainty in the decimals and therefore
generate execution uncertainty (degreed or zero).
Examples:
G0 X20 Y10
Generates the arc of an anti-clockwise circle starting from point X20 Y10, with centre at in
X40 Y15 (therefore radius 20.6155) of 180 degrees length.
G0 X20 Y10
256
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
....
G0 X0 Y50
G1 QF-90 KA1
G3 I-2 J10 RA30 KA1
G1 X-40 Y11 QF180
Y45
X0
.....
G2/G3 RA...
Circle 10 must come from defined point and the inclination of the previous segment is
maintained in this point. It is a circle tangent to the previous segment. If the previous segment is
open the error message CN3414 will appear (previous block open).
.....
G3 I30 J0 X30 Y20
G2 RA10
G1 X0 Y40 QF160
.....
An RR connection may be programmed in every block and is executed at the end of the
segment.
D. ELECTRON 257
Chapter 10 – Geometry CNC Z32 Programming Manual
The alarm message CN3314 appears in the situations shown in the figures.
Accordant circles: none must be contained inside the other.
258
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
Discordant circles: the two circles must be exterior one to the other.
...
G0 X0 Y0
Y10
QF180 KA1
G3 I-20 J5 RA15 KA1
G1G3 I-50 J20 X-60 Y25 QA150 KA1
G1 QF180
G1 X-90 Y20 QF-90
....
G1 G2/G3 I.. J.. RA.. QA.. G1 G2/G3 I.. J.. RA.. QA.. QF..
Combinations 5 and 6 are similar to combination 4 but use different parameters.
D. ELECTRON 259
Chapter 10 – Geometry CNC Z32 Programming Manual
For example:
...
N10 G0 X0 Y0
N11 G2 Y0 X100 I50 J0
N12 X0 Y0 I50 J0
...
In this case pay attention during radius compensation because the second circle arc intersects
first arc and therefore the whole circle is eliminated (see chapter on “Radius Compensation”).
Complete circle programming may demand at least three arcs during radius compensation.
G200 HX4
force, for the subsequent lines the execution of the complete circle when the arc of the circle is
programmed with G2/G3 I J X Y and the end values are identical to the initial values.
Example:
N1 G200 HX4
N2 G0 X25.23 Y10.759
At line N3 a complete circle is executed with centre I40 J10 and departure and arrival at point
X20Y10.
The identical value condition is definitely obtained if the values are programmed with explicit
identical numbers, as in the above example, or if they are the result of identical formulas.
WARNING
Mathematical formulas which appear to be identical in substance but
different in form may generate different results, due to the mobile point
calculation features.. For example the expression 1.2*5 does not give the
result of exactly = 6, because the basic decimal number 1.2 cannot be exactly
represented in the binary system (as it is a periodic number such as for
example 1/3=0.33333... which is periodic in the decimal system) so that the
result is not an integer. It is therefore very difficult to predict the result, so
that when totally identical numbers are required as in this case, it is advisable
to program explicit numbers or totally identical formulas.
260
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X0 Y0
G1 X20 Y20 RB15 QA30
(G1) X40 Y0
or
G1 X20 QF45 RB15 QA30
(G1) Y0 QF-45
(QA30 =>tg30 = 8.66/15)
G0 X0 Y20
G1 X30 Y20 RB10
(G1) X40 Y0
G0 X0 Y20
G1 QF90
X40 Y20 QF0 RB15 QA30
(G1) Y0
(QA30 =>tg30 = 8.66/15)
D. ELECTRON 261
Chapter 10 – Geometry CNC Z32 Programming Manual
G0 X0 Y20
G1 X30 Y20 RB10
(G1) QF-90
or
G1 QF0 RB10
(G1) X30 Y0 QF-90
G0 X0 Y20
G1 X30 Y20 RB10
G1
alarm CN4514
RB/RR at starting point (continuous)
G0 X-5 Y-5
G1 X5 Y5
(G1) RB10
(G1) X40 Y0 QF-45
G0 X5 Y0
G1 Y20 RB10
G1G2 I30 J10 RA10
G1 X10 Y0
262
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X0 Y0
G1 QF60 RB15 QA30
G1G2 QA-30 I35 J0 X45 Y0
or
G1G2 QA-30 I35 J0 RA10 QF-90
(QA30 =>tg30 = 8.66/15)
G0 X0 Y0
G1 QF60 RB10 QA40,9
G1G2 QA-30 I35 J0 RA10
(QA40,9 =>tg40,9=8.66/10)
G0 X0 Y-25
G1 Y25 RB20
G1G2 I10 J0 RA20 QF-90
If the chamfer falls into the circle the Z32 will not give alarm message.
D. ELECTRON 263
Chapter 10 – Geometry CNC Z32 Programming Manual
G0 X0 Y0
G1 X20 Y20 RR-10
(G1) X40 QF-45
or
G1 X20 QF45 RR-10
(G1) Y0 QF-45
G0 X40 Y0
G1 X20 QF135 RR10
(G1) X0 QF-135
G0 X0 Y0
G1 X35
G1 QF0
(G1) X35 Y20 QF90 RR10
(G1) X0
G0 X0 Y0
G1 Y20 RR-10
(G1) QF0
G0 X0 Y20
G1 QF0 RR-10
(G1) X30 Y0 QF-90
264
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X30 Y0
G1 Y20 RR10
(G1) QF180
or
G1 QF90 RR10
(G1) X0 Y20 QF180
G0 X-5 Y-5
G1 X5 Y5
(G1) RR-10
(G1) X50 Y0 QF-45
G0 X0 Y10
G1 X20 Y10 RR-5
G3 I35 J10 X35 Y-5
G0 X0 Y10
G1 X20 Y10 RR5
G2 I35 J10 X35 Y25
or
G2 RA15 X35 Y25
G2 I35 J10 QF0
G0 X0 Y0
G1 QF60 RR-5 (KA0)
G3 I30 J10 X30 Y-5
(G3 I30 J10 RA15 QF0)
D. ELECTRON 265
Chapter 10 – Geometry CNC Z32 Programming Manual
G0 X0 Y0
G1 QF60 RR-5 KA1
G3 I30 J10 X15 Y10
(G3 I30 J10 RA15 QF-90)
G0 X25 Y40
G1 QF-120 RR18 (KA0)
G3 I30 J10 X45 Y10
(G3 I30 J10 RA15 QF90)
G0 X25 Y40
G1 QF-120 RR18 KA1
G3 I30 J10 X30 Y25
(G3 I30 J10 RA15 QF180)
G0 X0 Y10
G1 QF0 RR-3 KA1
G3 I30 J10 X30 Y25
G0 X0 Y10
G1 QF0 RR3 (KA0)
G3 I30 J10 X15 Y10
G0 X0 Y10
G1 QF0 RR-3 (KA0)
G3 I30 J10 X30 Y-5
266
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X0 Y10
G1 QF0 RR-3 KA1
G2 I30 J10 X30 Y25
G0 X0 Y10
G1 QF0 RR3 (KA0)
G2 I30 J10 X45 Y10
G0 X0 Y20
G1 X15 Y20
G2 X30 Y5 RR-5
G1 X0
G0 X0 Y20
G1 X15 Y20
G2 RA15 QF-90 RR5
G1 X0 Y5
G0 X25 Y0
G3 I10 J0 X10 Y15 RR-5
G1 X10 Y0
G1 X10 Y-5
G2 I10 J15 RR-5 (KA0)
G1 X40 Y15 QF0
D. ELECTRON 267
Chapter 10 – Geometry CNC Z32 Programming Manual
G0 X9 Y27,5
G1 QF0
G2 I10 J12,5 RA15 RR-5 KA1
G1 X40 Y15 QF0
G0 X9 Y27,5
G1 QF0
G2 I10 J12,5 RA15 RR5 (KA0)
G1 X40 Y15 QF0
G0 X1 Y-10
G1 QF180
G2 I0 J0 RA10 RR-20 KA1
G2 I20 J0 RA5 QF90
G0 X-10 Y18
G1 QF-90
G3 I0 J15 RA10 RR-10 (KA0)
G3 I20 J15 X25 Y15
G0 X0 Y10
G3 I0 J15 RR-10 KA1
G3 I20 J15 RA5 QF0
268
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X-10 Y15
G3 I0 J15 RR15 (KA0)
G2 I20 J15 X25 Y15
G0 X10 Y14
G1 QF90
G3 I0 J15 RA10 RR15 KA1
G2 I20 J15 X25 Y15
G0 X-10 Y14
G1 QF90
G2 I0 J15 RA10 RR15 (KA0)
G3 I20 J15 X25 Y15
G0 X-10 Y14
G1 QF90
G2 I0 J15 RA10 RR15 KA1
G3 I20 J15 X20 Y10
Secant circles
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR4 (KA0)
G2 I25 J0 X25 Y20
D. ELECTRON 269
Chapter 10 – Geometry CNC Z32 Programming Manual
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR-4 (KA0)
G3 I25 J0 X25 Y-20
G0 X15 Y1
G1 QF-90
G2 I0 J0 RA15 RR4 KA1
G2 I25 J0 X25 Y20
G0 X15 Y1
G1 QF-90
G2 I0 J0 RA15 RR-4 KA1
G3 I25 J0 X25 Y-20
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR-4 KA1
G2 I25 J0 X25 Y20
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR4 (KA0)
G3 I25 J0 X25 Y-20
270
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR-4 (KA0)
G2 I25 J0 X25 Y20
G0 X-15 Y-1
G1 QF90
G2 I0 J0 RA15 RR4 KA1
G3 I25 J0 X5 Y0
Internal circles
G0 X11,5 Y10
G1 QF0
G3 I12,5 J15 RA5 RR-8 (KA0)
G2 I25 J15 RA20 QF0
G0 X13,5 Y20
G1 QF180
G3 I12,5 J15 RA5 RR-8 KA1
G2 I25 J15 RA20 QF90
G0 X11,5 Y10
G1 QF0
G3 I12,5 J15 RA5 RR8 (KA0)
G3 I25 J15 RA20 QF0
D. ELECTRON 271
Chapter 10 – Geometry CNC Z32 Programming Manual
G0 X13,5 Y20
G1 QF180
G3 I12,5 J15 RA5 RR8 KA1
G3 I25 J15 RA20 QF0
G0 X26 Y-5
G1 QF180
G2 I25 J15 RA20 RR-8 (KA0)
G3 I12,5 J15 RA5 QF180
G0 X5 Y14
G1 QF90
G2 I25 J15 RA20 RR-8 KA1
G3 I12,5 J15 RA5 QF-90
G0 X26 Y35
G1 QF180
G3 I25 J15 RA20 RR8 (KA0)
G3 I12,5 J15 RA5 QF180
G0 X26 Y35
G1 QF180
G3 I25 J15 RA20 RR8 KA1
G3 I12,5 J15 RA5 QF-90
272
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
External circles
If the circles are external we will have (| .. | absolute value):
accordant circles/discordant connection |2xRR|>=D-RA1-RA2
accordant circles/accordant connection |2xRR|>=D+RA1+RA2
discordant circles/connection like the first |2xRR|>=D+RA2-RA1
discordant circles/connection like the second |2xRR|>=D+RA1-RA2
Secant circles
If the circles are secant we will have:
accordant circles/internal connection |2xRR|<=D-RA1+RA2-D
discordant circles/internal connection |2xRR|<=D-RA2+RA1
|2xRR|<=D-RA1+RA2
concordant circles/external concordant connection |2xRR|>=D+RA1+RA2
Internal circles
If the circles are internal we will have:
concordant circles RA2-D-RA1<|2xRR|<RA2+D-RA1
discordant circles RA2D+RA1<|2xRR|<RA2+D+RA1
D. ELECTRON 273
Chapter 10 – Geometry CNC Z32 Programming Manual
274
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
D. ELECTRON 275
Chapter 10 – Geometry CNC Z32 Programming Manual
276
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
D. ELECTRON 277
Chapter 10 – Geometry CNC Z32 Programming Manual
278
D. ELECTRON
CNC Z32 Programming Manual Chapter 10 - Geometry
D. ELECTRON 279
Chapter 10 – Geometry CNC Z32 Programming Manual
traslation of the tool centre. For safety reasons an increase of feedrate of the tool centre
is not provided for in case of external curvature.
The central part at constant feedrate may not exist if the resulting length of the acceleration and
deceleration is longer than the length of the whole segment.
280
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 – Rotation, Tanslation, Mirroring, Scale Factor
CHAPTER 11
The parameters used for these functions are modals, like all parameters, that is the
Execution programmed value remains until a new value replaces the previous one.
order The parameters are set to zero at reset, except for KP and KT which are set to 1 to have a
unitary scale factor.
If several transformations are operating the Z32 will work as follows:
1) Rotation: is applied to AA, to AB, to I and J circle centre, and to QF inclination.
2) Traslation: is applied to AA, AB and AC positions, to I and J circle centre, already
rotated if necessary.
D. ELECTRON 281
Chapter 11 – Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual
3) Mirroring: the centre of mirroring IS, JS, and the inclination of QS mirroring axis are
attributed to not roto-traslated origin. The mirroring is applied to AA and AB positions, to
I centre circle and to QF inclination, already roto-traslated. If G2/G3 and G41/G42
operating they are exchanged.
4) Scale factor: the dimensions resulting from the three previous transformations related to
unmodified origin are multiplied by the scale factor. Dimensions AA, AB, AC circle
centre I, J and RA radius are concerned.
The above calculi are performed only to determine the movements of the axes and do not
change the parameters. For example, if AA 100 is programmed and the changed position is 150
(because of roto-traslation, mirroring, scale factor), the AA parameter, used in the next calculus, will
keep 100 value and will not assume 150 value.
The G53 (origins and length compensation off) also suspends roto-traslation, mirroring and
scale factor.
That permits the programming of the machine movements in fixed points (tool change is typical)
without cancelling the dimensions transformations that may be restored by a subsequent G54.
11.2 ROTATION
The programmed figure is rotated by an angle QR (on sexagesimal degrees) around the centre
whose rotation (IR, JR) whose coordinates are referred to the active origin.
If QR is different from zero the rotation will be always possible (it does not need a particular ‘G’).
At reset QR = IR = 0
The rotation is applied to:
− (AA, AB) axes positions
− (I, J) circle centre
− (QF) inclination
282
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 – Rotation, Tanslation, Mirroring, Scale Factor
Up to instruction N3 the three programs are identical and take the axes into origin OX1 OY1.
With instruction N4 the parameters X and Y are both zero, i.e. they would identify the new origin
OX2 OY2. The movements obtained are those shown in the figure. Only if both axes are
programmed (progr. 3) will the new origin be reached, otherwise only the programmed axis moves.
If the rotation is operating (QR not zero) the programming of only one axis (motion parallel to an
axes of the unrotated figure) actually causes an inclined movement and hence will request also the
movement of the other axis.
Therefore, if QR is not zero, even if only one axis is programmed, the Z32 does not limit the
movement to the programmed axis alone, but moves both axes in order to reach the rotated point
with an inclined path. In the following example the behaviour of the machine is different from the
previous example:
NOTE:
N1 QR = IR = JR = 0 at reset
N3 does not produce axes motion because no position is programmed
N4 Y moves to the position 0 (parameter value), even if only X is programmed, because QR
is not zero
N6 being QR=0, although containing Y parameter having zero value, axis Y does not move
D. ELECTRON 283
Chapter 11 – Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual
11.3 TRASLATION
The programmed profile is traslated by the DA (first axis), DB (second axis), DC (third axis)
quantities.
If one or more of the three parameters DA, DB, DC are not zero, the traslation will be performed
(without need of particular ‘G’).
DA = DB = DC = 0 At reset.
The traslation is applied to:
− (AA, AB, AC) axes positions
− (I, J) circle centre
284
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 – Rotation, Tanslation, Mirroring, Scale Factor
11.4 MIRRORING
The programmed profile is changed in the mirror profile with respect to the mirroring axis located
by the point of coordinates (IS, JS) and by QS inclination.
The mirroring must be qualified by G56 (modal). G55 cancels G56 and hence the mirroring.
IS = JS = QS = 0 At reset, G35 is operating (mirroring not operating).
The mirroring (G56 operating) causes the exchange of G2 with G3 and of G41 with G42.
G56 may be operating in radius compensation (G41/G42) but cannot be programmed with
G41/G42 operating.
The mirroring axis is the line of inclination QS and passing through the point of coordinates IS,
JS, QS. IS, JS are referred to the active origin and are not roto-traslated.
The mirroring is applied to:
− (AA, AB) axes positions
− (I, J) circle centre
− (QF) inclination
D. ELECTRON 285
Chapter 11 – Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual
The programmer must take care because, during radius compensation, the scale factor can
transform the contour from compatible to incompatible and vice versa if there are undercuts greater
than the tool radius. Please refer to Chapter on “Tool Radius Compensation”.
286
D. ELECTRON
CNC Z32 Programming Manual Chapter 11 – Rotation, Tanslation, Mirroring, Scale Factor
WARNING:
As the line is analyzed, the modifying parameters are immediately enabled,
therefore the effect depends on their position on the line. If, in an ISO line,
the dimension of an axis is mentioned before the parameter modifying that
axis, then the programmed dimension is not modified.
The sequence used to apply the modifications is important as applying addition first and then
multiplication or vice versa yields different results. The sequence is:
1) Multiply by KM..
2) Add K..
3) Multiply by KT and KP
4) Add DA DB DC
The programming of very high KM or KD (resulting for example from an erroneous formula
where a division by zero is present) may bring to unpredictable results (depending on axes
characteristics) sith possible movement alarms CN0013. For this reason, the maximum allowed
value for KM or KD lower than 131072, a value certainly much higher than required by programming
needs, but small enough to not produce CNC internal computation errors. By programming values
higher or equal to 131072, the alarm CN2C14 INCOMPATIBLE PARAMETERS is issued.
D. ELECTRON 287
Chapter 11 – Rotation, Tanslation, Mirroring, Scale Factor CNC Z32 Programming Manual
288
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 – Tool Radius Compensation
CHAPTER 12
Note:
− Inner corners cannot be worked because of tool radius (‘X’ zones)
− A few connection segments are inserted around exterior corners (B and D)
− A few programmed segments are eliminated because of tool radius (segment 5)
Generally, if radius compensation is operated (with G41/G42) in a program, the Z32 will execute
in every segment of the programmed profile a series of operations to modify the path of the milling
centre.
The main operations Z32 performed on the programmed segments to obtain the path of the
milling centre are:
D. ELECTRON 289
Chapter 12 – Tool Radius Compensation CNC Z32 Programming Manual
This last performance requires to Z32 to explore profile ahead to obtain necessary information.
The next segments of programmed profile can in fact interfere with the actual segment and
therefore require a different end point for the actual segment.
Segment 9 interferes with segment 1 in the example of the figure: to resolve this case the CNC
should explore ahead for at least 9 segments in addition to the inserted connections around the
corners.
290
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 – Tool Radius Compensation
The number of explored segments has been limited because of physical limits, imposed by
memory size and by calculus times, also considering that no matter how many segments are
calculated by CNC, it is always possible to imagine a more complex profile.
Normal cases of profile can be solved with two segments forward: if the programmer does not
require different performance, the Z32 will explore ahead until it has defined two segments of the
profile following that under examination (three segments in all).
For example, considering the classical case of a step whose height is lower that the tool radius:
this is fully solved by Z32 by exploring three segments.
The segments that comprise the outline modified with tool radius are:
1. start horizontal segment
2. circular connection around programmed corner
3. vertical segment
4. end horizontal segment
D. ELECTRON 291
Chapter 12 – Tool Radius Compensation CNC Z32 Programming Manual
292
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 – Tool Radius Compensation
Segment 3. Segment 4 connects, the 5 does not connect and does not intersect: it is
eliminated. The 6 does not connect and does not intersect any segments (if it
had not moved to execution it would have intersected the 2): segment 6 is
eliminated. The 7 does not connect and it does not intersect: it is eliminated.
The procedure continues to the end of the radius compensation, because none of the
subsequent segments will connect with those examined, and so the control will give alarm:
‘INADMISSIBLE PROFILE’.
Various cases can be examined in a similar way: generally when there are undercuts in the
profile smaller than the tool diameter, the ‘INADMISSIBLE PROFILE’ cases may occur.
If the profile conditions demand a different number of explored segments, the programmer will
have the possibility to ask this of Z32. The G109 function must be followed by a letter from A to E to
specify the number of segments to be explored:
G109A three segments (active on reset)
G109B four segments
G109C five segments
G109D six segments
G109E seven segments
A case example solved completely with 7 segments (G109E) is indicated in the figure below.
Segment 1 intersects segment 8 (because the tool diameter is greater than the aperture). When
the CNC examines segment 1, segment 7 ahead already intersects segment 3 and segments 4, 5
and 6 are eliminated: the next 8 segment intersects segment 1 and so also segments 2 and 3 are
eliminated and segment 1 shortened.
If the same figure were executed with three segments (the normal G109A) the CNC would not
notice the narrower tool aperture and it would enter the profile.
It is also possible to program G109R function that forces the insertion of a connection around
inner corner eliminating ‘INADMISSIBLE PROFILE’ error.
G109N eliminates G109R, which can be programmed immediately before steps that cause
INADMISSIBLE PROFILE: so the situation that causes the alarm will be clearer.
The tool can go into the programmed outline with G109R operating and long connections can
remain on inner corners in case of complex profile.
D. ELECTRON 293
Chapter 12 – Tool Radius Compensation CNC Z32 Programming Manual
The advantage of this method is that if the inclination is programmed correctly, the tool will enter
on the profile along the tangent line and slightly ‘mark’ the profile.
There are two disadvantages on the other hand:
− QF calculus may not be very simple
− the connection to profile is not considered a profile element and so if it interferes with the
next profile segments it is not shortened.
294
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 – Tool Radius Compensation
The QF must be programmed accurately because if it is incorrect (in figure is 0 instead 54.46)
the tool could go into the profile.
These problems can be overcome with the other two following methods of connection to profile.
....
T2 M6 (RADIUS=10)
G0 X0 Y0
G41 X25 Y0
G1 X50 Y35
...
A fictitious segment of xx profile is added which takes the tool to start point of P1 profile: the tool
does not go into real profile but stops on the bisector of P1 corner.
......
T1 M6 (RADIUS 10)
G0 X0 Y0
G41 QF0
G1 X25 Y0
G1 X50 Y35
...
D. ELECTRON 295
Chapter 12 – Tool Radius Compensation CNC Z32 Programming Manual
G41/G42 - X... Y... I… J… programmed – linear approach along the orthogonal to the profile
In case of closed profiles, and if the circular profile approach (G41/G42 X Y QF) is not desired, it
is necessary to program twice (beginning and end) a profile segment with a length at least the same
as the tool radius, otherwise a mark is left on the finished profile.
The G41/G42 X Y I J executes a linear approach without need to overlap.
This mode considers a profile initiating in the programmed point (X Y) in the same direction
assumed by a circular segment with center I J. The profile approach movement is therefore a linear
element bringing the tool center on the line running from the center (I J) and the final point (X Y), at
a distance from the final point equal to the tool radius (R).
The following cases bay exist:
- if the first profile segment is a circle, I J may be its center
- if an orthogonal approach is desired, I J may be the tool center at the beginning of the profile
approach (thus coinciding with the previous final point)
- in every case I J may be any point lying on the line orthogonal to the profile in the approach
point, from the tool side.
296
D. ELECTRON
CNC Z32 Programming Manual Chapter 12 – Tool Radius Compensation
If the end positions of connection are not programmed the radius compensation will be stopped
directly on the end point of the programmed outline: the next block will have the coordinates of the
tool centre as start point.
If G40 is programmed at the end of a radius compensation accompanied by G0 and a position,
e.g. with
N30 G40 G0 Z20
the alarm CN1D14 will appear.
D. ELECTRON 297
Chapter 12 – Tool Radius Compensation CNC Z32 Programming Manual
recommended that tools with very small radius not be programmed (i.e. the physical tool radius is to
be programmed and not the compensation with respect to the theoretical radius).
298
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
CHAPTER 13
D. ELECTRON 299
Chapter 13 - Special Performances CNC Z32 Programming Manual
The following figure shows a speed diagram function of time, for a complete measuring
movement. The feedrate is calculated on the path, like in G0/G1.
300
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
It should be remembered that, if the braking distance from traverse to slow is greater than the
distance AB, the whole search (including the segment programmed as traverse) is performed a
slow search feedrate.
Generally the deceleration from traverse to slow can be executed completely or in part at slow
feedrate if the traverse is not completely reached.
In block search procedure G61 is ignored: the block is transformed into a movement block up to
the end positions. The parameters AM BM CM are not modified.
To restart the program without problems, even during block search, the programmer must save
in permanent memory (e.g. in the parameter section) the results of the various measurements in
order to be able to simulate the same in block search.
3 – value recording at the time of contact and return in the form of parameters
This mode is engaged by programming the parameter "J" in the line of G61:
Parameter J defines the search speed, expressed in mm/min o inches/min, therefore in the
example a speed of 100 mm/min is required (if the machine is in mm). The range of permitted
values for parameter J comes within a minimum of approx.0,23 mm/min and a maximum of 6000
mm/min.
The maximum value of 6000 mm/min is fixed and independent of the search speed values set in
calibration stage.
Values outside this range admitting that they are forced to the nearest limits, in particular
negative values, are forced to 0,23 mm/min.
During the measurement movement the machine axis must stop immediately when they
encounter the probe signal, this results in sudden accelerations which may not be compatible with
the dynamics of the machine axes, in particular in the event of rigid axis control (G113X).
Due to the fact that when J is programmed, the values permitted for the measurement
movement are very high (up to 6000 mm/min) it is necessary to force the G113P, the following
function table is therefore obtained:
Active mode before G61 Mode during normal G61 (w/o J) Mode during G61 with
programmed J
D. ELECTRON 301
Chapter 13 - Special Performances CNC Z32 Programming Manual
WARNING
The maximum search speeds permitted during G61 with J programming
are very high (up to 6000 mm/min). The user must check that the braking
spaces consequent to programmed speed are compatible with the over-
stroke permitted by the measurement probe used.
Remember that the measurement bit is controlled by Z32 every 2 millisec, so that there is a
measurement uncertainty which depends on the search speed, as shown in the following table:
30 1
100 3.3
200 6.7
300 10
It is also necessary to remember that at high speeds there may be considerable delays due to
the machine response to the probe, which have obviously not been taken into account in the above
table.
302
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
D. ELECTRON 303
Chapter 13 - Special Performances CNC Z32 Programming Manual
HC Z position (exit)
AP,AN,BP,BN,L probe correctors
Output parameters:
DI, DJ hole centre offset
OX* and OY* updated at hole centre
PROGRAM
%
G0 X0 Y0 (X AND Y POSITIONING AND DOWN MOVEMENT OF Z)
Z<HA>
G61 X<HR-AP+HT> DM<2*HT> (X MEASURING)
!IF AM>99000; GON9! DI=(DI+AM)/2!
G0 X0 (EXIT)
G61 X<-HR+AN-HT>
!IF AM>99000; GON9! DI=(DI+AM)/2!
G0 X (Y MEASURING)
G61 Y<HR-BP+HT>
!IF AM>99000: GON9! DJ=BM!
G0 Y0
G61 Y<-HR+BN-HT>
!IF AM>99000; GON9! DJ=(DJ+BM)/2!
!:ROX*=AM;AM=AM+DI;:WOX*=AM! (ORIGIN UPDATING)
!:ROY*=BM;BM=BM+DJ;:WOY*=BM!
G0 X0 Y0 (EXIT MOVEMENT)
Z<HC>
G26
(ERROR MESSAGE)
G9 NO CONTACT
Note the indirect addressing of origin in progress with character "*"
Also note the two traverse segments between the two X measurements and the two Y
measurements. In fact the probe is in contact with the piece after a G61: if another G61 is repeated
immediately without removing the probe there could be a CN0513 error.
304
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
//N9 !:RPM1=AM, M2=BM only in block search, read the memorized results
N10 G61 ... the parameters which are interesting are AM and
BM: in block search they are not modified
N11!: WPM1=AM, M2=BM! it memorizes the result for a next block search
... it measures to determine CM
//N30 !:RPM3=CM!
N31 G61 ...
N32 !:WPM3=CM!
N33 ... it measures to determine AM BM CM
//N63 !:RPM4=AM, M5=BM, M6=CM!
N64 G61 ...
N65 !:WPM4=AM, M5=BM, M6=CM!
...
M2
:PA
M1=0
M2=0
M3=0
M4=0
M5=0
M6=0
...
After the real program execution (not in block search) the results of the various measurements
made will be written in M1, M2, M3, M4, M5, M6, at the beginning they where =0.
D. ELECTRON 305
Chapter 13 - Special Performances CNC Z32 Programming Manual
306
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
Two programs differ only in the N30 line: when there is an interruption for example at position
Z=47,53 mm, in the first example N30 generates a movement parallel to axis X with Z=47,53 mm
constant position, and in the second example N30 generates a due axes movement up to the end
positions X-50 Z-100 (Z parameter keeps the programmed position -100).
G62 can be programmed also in G2 or in G3 movements, but it cannot be programmed either
for composite movements or in radius compensation.
The feedrate is taken to zero with controlled deceleration ramp and with axes in path (as with
FEED HOLD), when the control stop (0EC bit) is activated during G62 movement.
After the axes stop we move to the next program line. If before the stop the stop control ceases
(i.e. the 0EC bit returns to 0) the movement will start again with acceleration ramp up to the
programmed feedrate. In the programmable logic this characteristic (e.g. memorizing 0EC) must be
taken into account to avoid any oscillations (a worn tool sensor could stop detecting defects if the
feedrate drops to zero).
D. ELECTRON 307
Chapter 13 - Special Performances CNC Z32 Programming Manual
The physical state of the machine seen in block search may be different from that seen in
execution, both because the functioning of the logic is different in the two cases and because the
physical state may have been changed by the execution of the program itself.
13.3.3 G61 Measuring movements and G62 working movements with stop
The measuring result can influence the evolution of the program in many ways:
− piece identification and choice of sub-program
− stock value and choice of cuts or tool number
− ...
Analogously G62 working movements with stop.
The axes movements are generally excluded in block search procedure: so the measuring or
the control of logic bits cannot be done in a movement with stop. So the results are not significant.
It should be noted that executing measuring movements during block search, apart from being
extremely complex (e.g. when should the tracer head be mounted or put away?), does not solve the
general problem. For example, if the tracer head is used to measure the stock, the mere fact that a
part of the machining has been executed changes the result.
308
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
One transducer pitch of this B axis is at 0.001 degrees. This means that a complete revolution of
the counter (that is about 268 million for 28 bits) comprises about 745 revolutions of the B axis, that
is, about 268,000 degrees (exactly 268,435.456 degrees).
It can also reasonably be assumed that the stops of the B axis have been set at their maximum
(therefore practically eliminated).
because parameter C is not cyclic, and therefore after a time there will be problems due to
excessive number on the C parameter.
The correct way of programming an indefinite movement involves preventing parameter C from
indefinitely increasing, for example:
N1 C<C+179>
!IF C>360;C=C-360!
!GON1!
D. ELECTRON 309
Chapter 13 - Special Performances CNC Z32 Programming Manual
WARNING:
A cyclical continuous axes positioned using the shortest route could also
be used for circular interpolation but correct dimension (that should take
into account the revs accumulated) of the centre would be very difficult to
find. Basically, we can say that a cyclical continuous axis positioned using
the shortest route cannot be used for circular interpolation.
13.4.6 Programming cyclical axes through the shortest route with direction
In the machine settings of Z32, we can decide to program the motions of cyclical axes to reach
final position by the shortest route.
310
D. ELECTRON
CNC Z32 Programming Manual Chapter 13 - Special Performances
To assure compatibility with existing CAM software, another option was introduced to prevent
the motion from exceeding one revolution in any case but allows the direction of movement to
be chosen.
When this option is enabled, it forces the programmed character to a non-standard meaning.
The sign does not indicate a negative dimension any longer, but the direction of the motion.
Furthermore, the axis dimension is always deemed positive, from zero to the cycle value.
For example, if the B axis is cyclical, and if the positioning option for cyclical axes by the shortest
route with direction is enabled:
B-10
the B axes must be positioned on + 10, with negative direction of movement.
If the previously programmed dimension is confirmed (either by a positive or by a negative sign),
no movement occurs.
WARNING:
Forcing the meaning of the sign and the generation of the movements
implies some exceptions to the normal behaviour of Z32:
1) Since the meaning of the programmed sign is different from that of the arithmetical sign, the
programmed B parameter is forced to its absolute value. Therefore, after programming B-
10, the arithmetical content of the B parameter is no longer -10 but +10.
2) Using an expression (for instance B<HA-1>) to program B assigns an absolute value to
B and invalidates the negative sign. To maintain compatibility with possible future
modifications, we suggest not to program cyclical axes featuring direction selection by
means of such expressions.
3) As in the case of normal cyclical axes, disabled axes (ex. G29B) are not enabled during
movement if the programmed position is close to the current one and within the
positioning threshold. However, this means that a movement may not be made equal to
almost a complete revolution, if a position is programmed within the positioning
threshold, but with specification of a movement with an opposite sign. To assure
correct functioning, we suggest not to program cyclical axes featuring direction
selection when these are disabled.
4) A cyclical axis featuring specific positioning by the shortest route must belong to the
working triad. Z32 does not prompt any alarm, but in this case, the programmed
direction is likely to be ignored.
D. ELECTRON 311
Chapter 13 - Special Performances CNC Z32 Programming Manual
− The parameters in an evolved line field: W... contain up to five decimals. However, the
limit of six integers for a total of nine significant digits remains. For example, results may
be 1234, 56789 or 12345.6789. The maximum usable number is 999999.999; if the
number is higher, it is limited however to 999999.999.
If the machine is in inch mode:
− copying (G111) does not work
− macros (G110) do not work
These functions can be enabled on request at a later time.
312
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 – Obsolete features
CHAPTER 14
D. ELECTRON 313
Chapter 14 – Obsolete features CNC Z32 Programming Manual
Don’t G98 temporarily disables G0, G1, G2, G3, i.e. all positions programmed after G98, are always
operate interpreted as end positions of a linear segment, like in G1. G99 restores the situation existing
before G98.
During G98, the following is also suspended:
− rototranslation
− mirroring
− scale factor
When G98 is active, the programming of addresses I, J, QF, RA on a ISO line is allowed. In this
case however I, J, QF, RA don’t assume any special meaning as profile elements, but they are valid
only as parameters. When G98 is active, the programming of I30 on a ISO line is equivalent to
!I=30! on an evolved line.
The above discussion pinpoints that a big quantity of operations normally executed by Z32 are
avoided when G98 is active, based on the consideration that these control functions have been
executed by the computer generating the profile (radius correction, programmed positions
computations, geometrical computations). The possibility to execute evolved lines (and therefore
mathematical computations) allows to restore, under control of the programmer, at least a portion of
the features disabled.
314
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 – Obsolete features
D. ELECTRON 315
Chapter 14 – Obsolete features CNC Z32 Programming Manual
The velocity reference is integrated on each axis for a certain time (an integration cycle lasts 384
ms), and the corresponding theoretical axis displacement is computed.
The computed displacement is compared with the measured displacement and the error is
computed.
The allowed tolerance is computed by adding a series of components: 1/16 of actual velocity,
plus 1/256 of the rapid, plus a mm/min speed equal to the positioning error multiplied by 5000. For
example, if an axis is moving with a velocity of 4000 mm/min, the axis rapid is 20 m/min and the
positioning error is 0,015, the allowed velocity error is 4000/16 + 20000/256 + 0,015*5000 = 250 +
78,1 + 75 = 403,1 mm/min. In 0,384 seconds the maximum error accumulated by the axis may be
2.58 mm. If greater, the alarm is triggered.
Once the axis has be found behaving not correctly, the error is signaled to the machine logic,
and, if the failing axis is an alive axis controlled by part-program, the alarm CNDx13 is issued,
where x is the logical number of the failing axis.
This kind of control is useful also in case a position detector is blocked in a condition not
detected by the interface board, thus avoiding the issuing of error CNxx12.
The efficiency of this control may result not compatible on machines with rough axes; the control
may be disabled in machine setup.
316
D. ELECTRON
CNC Z32 Programming Manual Chapter 14 – Obsolete features
14.1.5 Examples
As G98 usage examples, two programs for the execution of an ellipse are show: with and
without radius correction.
The ellipse parametric equations are:
X = HA * cos HT Y = HB * sen HT
where HA and HB are the semiaxes in X and Y directions respectively, and HT is the angular
parameter which, incremented from 0 to 360 degrees, produces the desired coordinates.
The ellipse parametric equations with radius correction are:
HC = HA * sen HT
HD = HB * cos HT
X = HA * cos HT + R * HD / rquad (HC2 + HD2)
Y = HB * sen HT + R * HC / rquad (HC2 + HD2)
where HA and HB are the semiaxes, HT is the angular parameter ranging from 0 to 360, R is the
tool radius, HC and HD are two intermediate parameters used to shorten the computation.
D. ELECTRON 317
Chapter 14 – Obsolete features CNC Z32 Programming Manual
The programmer may note that instructions from N7 to N10, completely parameterized, may be
used to execute any ellipse.
With a positive tool radius R, the correction is made on the outside of the ellipse, if R is negative,
the correction is made in the internal side: in this latter case, the programmer must be certain that
the R value is not greater than the minimum curvature radius of the ellipse (i.e. the tool is
sufficiently small to contour all the ellipse from the internal side), otherwise, with this simple
program, the tool ‘enters’ in the profile.
If an ellipse in the space, placed on a plane slanted around Y axis, it is sufficient to insert also
the computation of Z point, in the movement block computing also the ellipse point, for example:
X<...> Y<...> Z<HG * X>
where HG is the slant.
318
D. ELECTRON