Brief details of this edition and previous editions are listed below.
The status of each edition is shown by the code in the "Remarks" column.
Status code in the "Remarks" column:
A ....New documentation.
B ....Unrevised edition with new order no.
C ....Revised edition with new status.
If factual changes have been made on the page since the last edition, this is indicated by a
new edition coding in the header on that page.
0
EditionOrder No.Remarks
02.956FC5298-2AB00-0BP0A
08.976FC5298-4AB00-0BP0A
12.956FC5298-3AB00-0BP0C
03.966FC5298-3AB00-0BP1C
08.976FC5298-4AB00-0BP0C
12.976FC5298-4AB00-0BP1C
12.986FC5298-5AB00-0BP0C
08.996FC5298-5AB00-0BP1C
04.006FC5298-5AB00-0BP2C
10.006FC5298-6AB00-0BP0C
09.016FC5298-6AB00-0BP1C
11.026FC5298-6AB00-0BP2C
This manual is included in the documentation available on CD ROM (DOCONCD)
EditionOrder No.Remarks
11.026FC5298-6CA00-0BG3C
Trademarks
SIMATIC
trademarks of Siemens AG. Other names in this publication might be trademarks whose use by a third party for
his own purposes may violate the rights of the registered holder.
â
, SIMATIC HMIâ, SIMATIC NETâ, SIROTECâ, SINUMERIKâ and SIMODRIVEâ are registered
Further information is available on the Internet under:
http: //www.ad.siemens.de/si numer ik
This publication was produced with WinW ord V8.0
and Designer V4.0.
The reproduction, transmission or use of this document or its contents is not
permitted without express written authority. Offenders will be liable for damages.
All rights, including rights created by patent grant or registration of a utility model
or design, are reserved.
Other functions not described in this documentation might be executable in the
control. This does not, however, represent an obligation to supply such functions
with a new control or when servicing.
We have checked that the contents of this document correspond to the hardware
and software described. Nonetheless, differences might exist and therefore we
cannot guarantee that they are completely identical. The information given in this
publication is reviewed at regular intervals and any corrections that might be
necessary are made in the subsequent printings. We welcome suggestions for
improvement.
Subject to change without prior notice
Siemens Aktiengesellschaft
11.02Contents
0
Contents
Fundamental Geometrical Principles1-21
0
1.1Description of workpiece points ...................................................................................... 1-22
1.1.1Workpiece coordinate systems ................................................................................. 1-22
1.1.2Definition of workpiece positions............................................................................... 1-23
SINUMERIK documentation is organized on three
different levels:
• General Documentation
• User documentation
• Manufacturer/Service Documentation
Target group
This Manual is intended for machine-tool users. It
provides detailed information that the user requires to
program the SINUMERIK 840D/840Di/810D control
system.
Standard scope
This Programming Guide describes the functionality
afforded by standard functions. Differences and
additions implemented by the machine-tool
manufacturer are documented by the machine-tool
manufacturer.
More detailed information about other publications
relating to SINUMERIK 840D/840Di and publications
that apply to all SINUMERIK controls (e.g. Universal
Interface, Measuring Cycles...) can be obtained from
your local Siemens branch office.
Other functions not described in this documentation
might be executable in the control. This does not,
however, represent an obligation to supply such
functions with a new control or when servicing.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition0-11
Preface11.02
0
Structure of the manual
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
0
Applicability
This Programming Guide applies to the following
controls:
SINUMERIK 840D6
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition0-13
Preface11.02
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Fundamentals
This Programming Guide Fundamentals is intended for
use by skilled machine operators with the appropriate
expertise in drilling, milling and turning operations.
Simple programming examples are used to explain the
commands and statements which are also defined
according to DIN 66025.
Advanced
The Programming Guide "Advanced" is intended for
use by technicians with in-depth, comprehensive
programming knowledge. By virtue of a special
programming language, the SINUMERIK 840D/810D
control enables the user to program complex workpiece
programs (e.g. for sculptured surfaces, channel
coordination, ...) and greatly facilitates the programming
of complicated operations.
The commands and statements described in this Guide
are not specific to one particular technology.
They can be applied for a variety of technologies, such
as
All cycles and programming options have been
described according to the same internal structure as
far as this is meaningful and practicable. The various
levels of information have been organized such that you
can selectively access the information you need for the
task in hand.
1. A quick overview
If you look up a rarely used command or the
meaning of a parameter, you can see at a glance
how the function is programmed and find helpful
explanations of the commands and parameters.
This information is always displayed at the top of the
page.
Note:
Due to lack of space, it has not been possible to
show all the modes of representation afforded by the
programming language for individual commands and
parameters. For this reason, we have illustrated
those command programming schemes that are
used most frequently in practice in a workshop
situation.
810D
840Di
Drilling cycles and drilling patterns03.96
2
2.1 Drilling cycles
2.1.2 Drilling, centering – CYCLE81
Programming
CYCLE81 (RTP, RFP, SDIS, DP)
RTP
realRetraction plane (absolute)
RFP
realReference plane (absolute)
SDIS
realSafety clearance (enter without sign)
DP
realFinal drilling depth (absolute)
DPR
realFinal drilling depth relative to reference plane (enter without sign)
Function
The tool drills at the programmed spindle speed and
feedrate to the programmed final drilling depth.
Operating sequence
Position reached before the beginning of the
cycle:
The drilling position is the position in the two axes of
the selected plane.
The cycle implements the following motion
sequence:
•
Approach of the reference plane brought forward
by the safety clearance with G0
•
Travel to the final drilling depth at the feedrate
programmed in the calling program (G1)
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition0-15
Preface11.02
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
2. Detailed explanations
You will find detailed answers to the following
questions in the theory section:
Why is the command needed?
What does the command do?
How is it programmed and executed?
What do the parameters do?
What else do I need to know?
03.96Drilling cycles and drilling patterns
2
Explanation of parameters
RFP and RTP
Generally, the reference plane (RFP) and the
retraction plane (RTP) have different values. In the
cycle it is assumed that the retraction plane lies in
front of the reference plane. The distance between
the retraction plane and the final drilling depth is
therefore greater than the distance between the
reference plane and the final drilling depth.
SDIS
The safety clearance (SDIS) refers to the reference
plane. which is brought forward by the safety
clearance. The direction in which the safety
clearance is active is automatically determined by
the cycle.
DP and DPR
The drilling depth can be defined either absolute
(DP) or relative (DPR) to the reference plane.
If it is entered as an absolute value, the value is
traversed directly in the cycle.
Additional notes
If a value is entered both for the DP and the DPR,
the final drilling depth is derived from the DPR. If the
DPR deviates from the absolute depth programmed
via the DP, the message "Depth: Corresponds to
value for relative depth" is output in the dialog line.
2.1 Drilling cycles
Z
2
G1
G0
RTP
RFP+SDIS
RFP
X
DP=RFP-DPR
The theoretical sections are primarily intended as
learning material for the NC entry-level user. You
should work through the manual at least once to get
an idea of the functional scope and capability of your
SINUMERIK control.
You will find an application example for virtually
every command after the theoretical section.
retraction plane are identical, a relative depth must
not be programmed. The error message
61101 "Reference plane incorrectly defined" is
output and the cycle is not executed. This error
message is also output if the retraction plane lies
behind the reference plane, i.e. the distance to the
final drilling depth is smaller.
Programming example
Drilling_centering
You can use this program to make 3 holes using the
drilling cycle CYCLE81, whereby this cycle is called
with different parameter settings. The drilling axis is
always the Z axis.
Specification of the technology values
Traverse to retraction plane
Traverse to first drilling position
Cycle call with absolute final drilling
depth, safety clearance and incomplete
parameter list
Traverse to next drilling position
Cycle call without safety clearance
Specification of the technology values
Traverse to next position
Cycle call with relative final drilling depth
and safety clearance
End of program
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition0-17
Cross-references to other documentation or
sections
Notes and warnings
Machine manufacturer (MH n)
Ordering data option
n= number of the note per section to which
the machine manufacturer can refer.
Preface11.02
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Principle
Your SIEMENS 840D/840Di/810D has been
designed and constructed according to state-of-
the-art technology and approved safety
regulations and standards.
Additional equipment
The applications of SIEMENS controls can be
expanded for specific purposes through the addition of
special add-on devices, equipment and expansions
supplied by SIEMENS.
Personnel
Only appropriately trained, authorized and reliable
personnel may be allowed to operate this equipment.
The control must never be operated, even temporarily,
by anyone who is not appropriately skilled or trained.
The relevant responsibilities of personnel who set up,
operate and maintain the equipment must be clearly
defined; the proper fulfillment of these responsibilities
must be monitored.
Behavior
Before the control is started up, it must be ensured that
the Operator's Guides have been read and understood
by the personnel responsible. The operating company is
also responsible for constantly monitoring the overall
technical state of the control (visible faults and damage,
altered service performance).
Servicing
Repairs must be carried out according to the
information supplied in the service and maintenance
guide by personnel who are specially trained and
qualified in the relevant technical subject. All relevant
safety regulations must be followed.
Any application which does not comply with the rules
for proper usage described above.
If the control is not in technically perfect condition or
is operated without due regard for safety regulations
and accident prevention instructions given in the
Instruction Manual.
If faults that might affect the safety of the equipment are
not rectified before the control is started up.
Any modification, bypassing or disabling of items of
equipment on the control that are required to ensure
fault-free operation, unlimited use and active and
passive safety.
Improper usage gives rise to unforeseen dangers to:
• Life and limb of personnel,
• The control, machine or other assets of the owner
and the user.
The following special symbols and keywords have been
used in this documentation:
Notes
This symbol appears in this documentation whenever it
is necessary to draw your attention to an important item
of information.
In this documentation, you will find this symbol with a
reference to an ordering option. The function described
is executable only if the control contains the designated
option.
Warnings
The following warnings with varying degrees of severity
appear in this document.
Danger
Indicates an imminently hazardous situation which, if
not avoided, will result in death or serious injury or in
substantial property damage
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition0-19
Preface11.02
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Warning
Indicates a potentially hazardous situation which, if not
avoided, could result in death or serious injury or in
substantial property damage.
Caution
Used with the safety alert symbol indicates a potentially
hazardous situation which, if not avoided, may result in
minor or moderate injury or in property damage.
Caution
Used without safety alert symbol indicates a potentially
hazardous situation which, if not avoided, may result in
property damage.
Notice
Used without the safety alert symbol indicates a
potential situation which, if not avoided, may result in an
undesirable result or state.
1.4.11Link axes (SW 5 and higher) ................................................................................... 1-43
1.4.12Leading link axes (SW 6 and higher)....................................................................... 1-45
1.5Coordinate systems and workpiece machining............................................................... 1-48
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-21
Fundamental Geometrical Principles11.02
1
1.1Description of workpiece points
1
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
1.1Description of workpiece points
1.1.1 Workpiece coordinate systems
In order for the machine or control to operate with the
specified positions, these data must be made in a
reference system that corresponds to the direction of
motion of the axis slides. A coordinate system with
the axes X, Y and Z is used for this purpose.
DIN 66217 stipulates that machine tools must use
right-handed, rectangular (cartesian) coordinate
systems.
The workpiece zero (W) is the origin of the workpiece
coordinate system. Sometimes it is advisable or even
necessary to work with negative positional data.
Positions to the left of the origin are prefixed by a
negative sign (–).
To specify a position, imagine that a ruler is placed
along the coordinate axes. You can now describe
every point in the coordinate system by specifying the
direction (X, Y and Z) and three numerical values.
The workpiece zero always has the coordinates X0,
Y0 and Z0.
Example:
For the sake of simplicity, we will only use one plane
of the coordinate system in this example, i.e. the X/Y
plane. Points P1 to P4 then have the following
coordinates:
The infeed depth must also be described in millingoperations. To do this, we need to specify a
numerical value for the third coordinate (Z in this
case).
Example:
Points P1 to P3 are defined by the following
coordinates:
The coordinates used up to this point to specify points
in the coordinate system are called "Cartesian
coordinates".
However, there is another way to specify coordinates,
namely as "polar coordinates".
It is useful to use polar coordinates in cases where a
workpiece or part of a workpiece is dimensioned by
radius and angle. The origin of the dimensional
measurements is referred to as the "pole".
Example:
The points P1 and P2 can then be described – with
reference to the pole – as follows:
P1 corresponds to radius =100 plus angle =30°
P2 corresponds to radius =60 plus angle =75°
810D
840Di
Y
P2
P1
0
6
75°
Pole
30
15
0
0
1
30°
X
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-25
Fundamental Geometrical Principles11.02
1
1.1Description of workpiece points
1
840D
NCU 571
840D
NCU 572
NCU 573
1.1.4 Absolute dimension
With absolute dimensions, all the positional
parameters refer to the currently valid zero point.
Applied to tool movement this means:
The absolute dimensions describe the
position to which the tool is to travel.
Example for milling:
The positional parameters for points P1 to P3 in
absolute dimensions referring to the zero point are
the following:
P1 corresponds toX20 Y35
P2 corresponds toX50 Y60
P3 corresponds toX70 Y20
810D
840Di
Y
P2
P1
60
P3
35
20
X
20
50
70
Example for turning:
The positional parameters for points P1 to P4 in
absolute dimensions referring to the zero point are
the following:
P1 corresponds toX25 Z-7.5
P2 corresponds toX40 Z-15
P3 corresponds toX40 Z-25
P4 corresponds toX60 Z-35
Production drawings are frequently encountered,
however, where the dimensions refer not to the origin,
but to another point on the workpiece.
In order to avoid having to convert such dimensions, it
is possible to specify them in incremental dimensions.
Incremental dimensions refer to the positional data for
the previous point. Applied to tool movement this
means:
The incremental dimensions describe the distance the
tool is to travel.
Example for milling:
The positional data for points P1 to P3 in incremental
dimensions are:
P1 corresponds to X20 Y35;(with reference to the
P2 corresponds to X30 Y20 ;(with reference to P1)
P3 corresponds to X20 Y-35 ;(with reference to P2)
810D
840Di
zero point)
1520
20
Y
P2
P1
P3
X
20
30
20
Example for turning:
The positional data for points P1 to P4 in incremental
dimensions are:
G90 P1 corresponds to X25 Z-7.5
;(with reference to the
zero point)
G91 P2 corresponds to X15 Z-7.5
;(with reference to P1)
G91 P3 corresponds to Z-10;(with reference to P2)
G91 P4 corresponds to X20 Z-10;(with reference to P3)
When DIAMOF or DIAM90 is active, the path setpoint
is programmed as a radius dimension with G91.
P4
10
P3
10
P2
7.5
X
P1
Ø 60
Ø 40
Ø 25
Z
7.5
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-27
Fundamental Geometrical Principles11.02
1
1.1Description of workpiece points
1
840D
NCU 571
1.1.6 Plane designations
A plane is defined by means of two coordinate axes.
The third coordinate axis is perpendicular to this plane
and determines the infeed direction of the tool (e.g.
for 2½D machining).
When programming, it is necessary to specify the
working plane in order that the control can calculate
the tool offset values correctly. The plane is also
relevant to certain types of circular programming and
polar coordinates.
840D
NCU 572
NCU 573
810D
840Di
Milling:
G
Z
Y
1
8
G
1
9
G
1
7
X
Turning:
The working planes are specified as follows in the
NC program with G17, G18 and G19:
The various origins and reference positions are
defined on the NC machine. They are reference
points
• for the machine to approach and
• refer to programming the workpiece dimensions.
They are:
M= Machine zeroA = Blocking point. Can coincide with the
workpiece zero (turning machines only)
W= Workpiece zero = Program zeroB= Start point. Can be defined for each program.Start point of the first tool for machining.
R= Reference point. Position determined by cam and measuring system. The distance to
the machine zero M must be known, so
that the axis position can be set to exactly
this value at this position.
The diagrams show the zero points and reference
points for turning machines and drilling/milling
machines.
810D
840Di
Y
W1W2
M
X
R
B
M
X
A
W
Z
1.3Position of coordinate systems
1.3.1 Overview of various coordinate systems
We distinguish between the following coordinate
systems:
• The machine coordinate system with the machine
zero M
• The basic coordinate system (this can also be the
workpiece coordinate system W)
• The workpiece coordinate system with the
workpiece zero W
• The current workpiece coordinate system with the
current offset workpiece zero Wa
In cases where various different machine coordinate
systems are in use (e.g. 5-axis transformation), an
internal transformation function mirrors the machine
kinematics on the coordinate system currently
selected for programming.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-29
Fundamental Geometrical Principles11.02
1
1.3Position of coordinate systems
1
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
The individual axis identifiers are explained in the
Reference points and tool and pallet changing points
(fixed machine points) are defined in the machine
coordinate system.
Where the machine coordinate system is used for
programming (this is possible with some of the
G functions), the physical axes of the machine are
addressed directly. No allowance is made for
workpiece clamping.
The location of the coordinate system relative to the
machine depends on the machine type. The axis
directions follow the so-called "three-finger rule" of the
right hand (in accordance with DIN 66217).
Standing in front of the machine, the middle finger of
the right hand points away from the infeed direction of
the main spindle. The following then applies:
• The thumb points in the +X direction
• The index finger points in the +Y direction
• The middle finger points in the +Z direction
Zm
M
Ym
Xm
+Z
+Y
+X
In practice, this can look quite different on different
types of machine. The following are examples of
machine coordinate systems for various machines.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-31
coordinate system, which is mirrored by kinematic
transformation (for example, 5-axis transformation or
by using Transmit with peripheral surfaces) onto the
machine coordinate system.
If there is no kinematic transformation, the basic
coordinate system differs from the machine
coordinate system only in terms of the axes
designations.
The activation of a transformation can produce
deviations in the parallel orientation of the axes. The
coordinate system does not have to be at a right
angle.
Zero offset, scaling, etc. are always executed in the
basic coordinate system.
The coordinates also refer to the basic coordinate
system when specifying the working field limitation.
Basic coordinate system
for face end
X
Y
Basic coordinate system
for peripheral surface
Workpiece coordinate system
for turning plane
W
X
Z
Y
Z
Y
MCS
MCS
MCS = Machine coordinate system BCS = Basic coordinate system
BZS = Basic zero system SZS = Settable zero system
WCS = Workpiece coordinate system
Y
BCS
DRF shift, external zero offset
BCS
Kinematic transformation
Y
Y
BZS
SZS
Programmable FRAME
SZS
G54...G599 settable FRAMES
BZS
Base offset (base frame)
Y
WCS
WCS
X
X
MCS
BCS
X
BZS
X
X
WCS
SZS
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-33
Fundamental Geometrical Principles11.02
1
1.3Position of coordinate systems
1
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
1.3.4 Workpiece coordinate system
in the workpiece coordinate system. In other words,
the data in the NC program refer to the workpiece
coordinate system.
The workpiece coordinate system is always a
Cartesian coordinate system and assigned to a
specific workpiece.
Z
Y
X
1.3.5 Frame system
The frame is a self-contained arithmetic rule that
transforms one Cartesian coordinate system into
another Cartesian coordinate system.
It is a:
Spatial description of the workpiece coordinate
system
The following components are available within a
frame:
• Zero offset
• Rotate
• Mirror
• Scale
These components can be used individually or in any
combination.
appropriate fixtures to align the workpiece parallel to
the machine axes.
M
X
Zero offset
X
Z
Z
W
W
Z
1
Zero offset
M
1
Y
Another way is to generate a coordinate system which
is oriented to the workpiece. The coordinate system
can be moved and/or rotated with programmable
frames.
This enables you to
• move the zero point to any position on the
workpiece
• align the coordinate axes parallel to the desired
working plane by rotation
• and thus machine surface clamped in inclined
positions, produce drill holes at different angles.
• perform multiside machining operations.
Z
Y
Z
0
X
Y1
Z
1
X
1
X
0
X
Y
0
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-35
Fundamental Geometrical Principles11.02
1
1.3Position of coordinate systems
1
840D
NCU 571
Working plane, tool offsets
The conventions for the working plane and the tool
840D
NCU 572
NCU 573
810D
840Di
offsets must be observed – in accordance with the
machine kinematics – for machining operations in
inclined working planes. For further information,
please see Section 3.6 "Selection of working plane,
G17 to G19".
1.3.6 Assignment of workpiece coordinate system to machine axes
The location of the workpiece coordinate system in
relation to the basic coordinate system (or machine
ZM=Z
B
coordinate system) is determined by settable frames.
The settable frames are activated in the NC program
by means of commands such as G54.
M
YM=Y
Z
W
B
Y
W
1.3.7 Current workpiece coordinate system
Sometimes it is advisable or necessary to reposition
and to rotate, mirror and/or scale the originally
selected workpiece zero within a program.
The programmable frames can be used to reposition
(rotate, mirror and/or scale) the current zero point at a
suitable point in the workpiece coordinate system.
You will thus obtain the current workpiece coordinate
system.
Several zero offsets are possible in the same
program.
Current workpiece
coordinate system
Y
B
Frame 1
Z
1
Z
B
Frame 1...settable offset and rotation
Frame 2...programmable offset and rotation
A distinction is made between the following types of
axis when programming:
• Machine axes
• Channel axes
• Geometry axes
• Special axes
• Path axes
• Synchronized axes
• Positioning axes
• Command axes
(motion-synchronized axes)
• PLC axes
• Link axes
• Leading link axes.
Geometry, synchronized and positioning axes are
programmed.
Path axes traverse with feedrate F in accordance with
the programmed travel commands.
Synchronized axes traverse synchronously to path
axes and take the same time to traverse as all path
axes.
Positioning axes traverse asynchronously to all other
axes. These traversing movements take place
independently of path and synchronized movements.
Command axes traverse asynchronously to all other
axes. These traversing movements take place
independently of path and synchronized movements.
PLC axes are controlled by the PLC and can traverse
asynchronously to all other axes. The traversing
movements take place independently of path and
synchronized movements.
Geometry axesPositioning axes
Machine axes
Geometry axes
Channel axes
Path axesPLC axes
Synchr on.
axes
Positioning
axes
Kinematic
Machine axes
transformati on
Special axes
Command
axes
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-37
Fundamental Geometrical Principles11.02
1
1.4Axes
1
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
1.4.1 Main axes/Geometry axes
The main axes define a right-angled, right-handed
coordinate system. Tool movements are programmed
in this coordinate system.
In NC technology, the main axes are called geometry
axes. This is the term used in this Programming
Guide.
For turning machines:
Geometry axes X and Z are used, and sometimes Y.
For milling machines:
Geometry axes X, Y and Z are used.
A maximum of three geometry axes are used for
programming frames and the workpiece geometry
(contour).
Identifiers: X, Y, Z
The identifiers for geometry and channel
axes can be the same, as long as mirroring
is possible.
Geometry axis and channel axis names can be the
same in any channel in order that the same programs
can be executed.
The "Switchable geometry axes" function (see
Advanced) can be used to alter the geometry axes
grouping configured by machine data. Here any
geometry axis can be replaced by a channel axis
defined as a synchronous special axis.
relationship is defined between the special axes.
Example:
Turret position U, tailstock V
1.4.3 Main spindle, master spindle
The machine kinematics determine which spindle is
the main spindle. This spindle is declared the master
spindle in the machine data. As a rule, the main
spindle is declared the master spindle.
This assignment can be changed with the program
command SETMS (spindle number) (see Chapter 7).
Special functions such as thread cutting apply to the
master spindle.
Identifiers: S or S0
840D
NCU 572
NCU 573
810D
840Di
1.4.4 Machine axes
The axis identifiers can be set in the machine data.
Standard identifiers:
X1, Y1, Z1, A1, B1, C1, U1, V1
There are also standard axis identifiers that can
always be used:
AX1, AX2, …, AXn
1.4.5 Channel axes
All axes which traverse in a channel.
Identifiers: X, Y, Z, A, B, C, U, V
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-39
Fundamental Geometrical Principles11.02
1
1.4Axes
1
840D
NCU 571
1.4.6 Path axes
Path axes define the path and therefore the
movement of the tool in space.
The programmed feedrate is active for this path.
The axes involved in this path reach their position at
the same time. As a rule, these are the geometry
axes.
However, default settings define which axes are the
path axes and therefore determine the velocity. Path
axes can be specified in the NC program with
FGROUP (see Chapter 5).
840D
NCU 572
NCU 573
810D
840Di
1.4.7 Positioning axes
Positioning axes are interpolated separately, i.e. each
positioning axis has its own axis interpolator and its
own feedrate.
A distinction is made between positioning axes with
synchronization at the block end or over several
blocks.
POS axes: Block change occurs at the end of the
block when all the path and positioning axes
programmed in this block have reached their
programmed end point.
POSA axes: The movement of these positioning axes
can extend over several blocks.
POSP axes: The movement of these positioning axes
for approaching the end position takes place in
sections.
You will find further information on POS, POSA and
POSP in the section on "Traversing positioning axes,
POS, POSA, POSP".
Positioning axes become synchronized axes if they
are traversed without the special POS/POSA
identifier.
possible if the positioning axes (POS) reach their final
position before the path axes.
Path axes that are programmed with POS/POSA are
removed from the path axis grouping for the duration
of this block.
Positioning axes are traversed by the NC program or
the PLC.
If an axis is to be traversed simultaneously by the
NC program and the PLC, an error message appears.
Typical positioning axes are:
• Loaders for workpiece loading
• Loaders for workpiece unloading
• Tool magazine/turret.
840D
NCU 572
NCU 573
810D
840Di
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-41
Fundamental Geometrical Principles11.02
1
1.4Axes
1
840D
NCU 571
1.4.8 Synchronized axes
Synchronized axes traverse synchronously to the path
from the start position to the programmed end
position.
The feedrate programmed in F applies to all the path
axes programmed in the block, but does not apply to
synchronized axes. Synchronized axes take the same
time as the path axes to traverse.
A synchronized axis can be a rotary axis which is
traversed synchronously to the path interpolation.
1.4.9 Command axes
840D
NCU 572
NCU 573
810D
840Di
Command axes are started from synchronized
actions in response to an event (command). They can
be positioned, started and stopped fully asynchronous
to the parts program. An axis cannot be moved from
the parts program and from synchronized actions
simultaneously.
Command axes are interpolated separately, i.e. each
command axis has its own axis interpolator and its
own feedrate.
References: /FBSY/, Synchronized Actions
1.4.10 PLC axes
PLC axes are traversed by the PLC via special
function blocks in the basic program; their movements
can be asynchronous to all other axes. The traversing
movements take place independently of path and
synchronized movements.
Link axes are axes which are physically connected to
another NCU and whose position is controlled from
this NCU. Link axes can be dynamically assigned to
channels of a different NCU. Link axes are not local
axes from the perspective of a particular NCU.
The dynamic changing of an assignment to an NCU is
based on the axis container concept. Axis
substitution with GET and RELEASE is not available
for link axes from the parts program.
Preconditions:
• The participating NCUs, NCU1 and NCU2, must
be connected by means of high-speed
communication via the link module.
References:
/PHD/, Configuring Manual NCU 571-573.2,
Link Module
• The axis must be configured appropriately by
machine data.
• The link axis option must be installed.
NCU 1NCU 2611D 1
Channel 1
Channel 2
Link module (HW)Link module (HW)
Link communication
A1
A2
A3
Channel 1
611D 2
B1
B2
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-43
Fundamental Geometrical Principles11.02
1
1.4Axes
840D
NCU 573
1
Functionality
For further information about link axes, please refer to
An axis container is a circular buffer data structure in
In addition to the direct reference to local axes or link
• a container number and
The entry in a circular buffer location contains:
Axis container entries contain local machine axes or
The position control is implemented on the NCU on
which the axis is physically connected to the drive.
This NCU also contains the associated axis VDI
interface. The position setpoints for link axes are
generated on another NCU and communicated via the
NCU link.
The link communication must provide the means of
interaction between the interpolators and the position
controller or PLC interface. The setpoints calculated by
the interpolators must be transported to the position
control loop on the home NCU and, vice versa, the
actual values must be returned from there back to the
interpolators.
References: /FB/ B3, Multiple Operator Panels and
NCUs
Axis container (SW 5 and higher)
which local axes and/or link axes are assigned to
channels. The entries in the circular buffer can be
shifted cyclically.
axes, the link axis configuration in the logical machine
axis image also allows references to axis containers.
Such a reference consists of:
• a slot (circular buffer location within the container)
• a local axis or
• a link axis
link axes from the perspective of an individual NCU.
The entries in the logical machine axis image
MN_AXCONF_LOGIC_MACHAX_TAB of an
individual NCU are fixed.
The axis container function is described in
References: /FB/ B3, Multiple Operator Panels and
NCUs
A leading link axis is one that is interpolated by one
NCU and utilized by one or several other NCUs as the
master axis for controlling slave axes.
An axial position controller alarm is sent to all other
NCUs which are connected to the affected axis via a
leading link axis.
NCUs that are dependent on the leading link axis can
utilize the following coupling relationships with it:
- Master value (setpoint, actual value, simulated
master value)
- Coupled motion
- Tangential follow-up
- Electronic gear (ELG)
- Synchronous spindle
Preconditions:
• The dependent NCUs, i.e. NCU1 to NCUn (n
equals, max. of 8), must be interconnected via the
link module for high-speed communication.
References:
/PHD/, Configuring Manual NCU 571-573.2,
Link Module
• The axis must be configured appropriately by
machine data.
• The link axis option must be installed.
• The same interpolation cycle must be configured
for all NCUs connected to the leading link axis.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-45
1
Fundamental Geometrical Principles11.02
1.4Axes
840D
NCU 573
1
NCU 1
InterpolatorInterpolator
ServoServo
611 D
A1
Restrictions:
• A master axis which is leading link axis cannot be
a link axis, i.e. it cannot be operated by other
NCUs as their home NCU.
• A master axis which is leading link axis cannot be
a container axis, i.e. it cannot be addressed
alternately by different NCUs.
• A leading link axis cannot be the programmed
leading axis in a gantry grouping.
• Couplings with leading link axes cannot be
cascaded.
• Axis replacement can only be implemented within
the home NCU of the leading link axis.
Programming:
Master NCU:
Only the NCU which is physically assigned to the
master value axis can program travel motions for this
axis. The travel program must not contain any special
functions or operations.
NCUs of slave axes:
The travel program on the NCUs of the slave axes
must not contain any travel commands for the leading
link axis (master value axis). If it does, an appropriate
alarm will be generated.
The leading link axis is addressed in the usual way via
channel axis identifiers. The states of the leading link
axis can be accessed by means of selected system
variables.
conjunction with the channel axis identifiers of the
leading link axis:
$AA_LEAD_SP; Simulated master value position
SAA_LEAD_SV; Simulated master value velocity
NCU of the master axis, the new values are also
transferred to any other NCUs who wish to control
slave axes as a function of this master axis.
References: /FB/ B3, Multiple Operator Panels and
NCUs
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition1-47
Fundamental Geometrical Principles11.02
g
1
1.5Coordinate systems and workpiece machinin
1
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
1.5Coordinate systems and workpiece machining
Relationship between the travel commands from
workpiece coordinates and the resulting machine
movements
Axis movement programmed in the workpiece coordinate system
Description of the
workpiece geometry
using geometry axes
(e.g. X, Y, Z)
Frame calculation:
•
Translation (TRANS)
•
Rotation (ROT)
•
Scaling (SCALE)
Contour in Cartesian
coordinate system of
the channel (BCS)
Tool radius compensation
Movement of the tool
zeropoint in the BCS
Description of the tool
orientation by orientation
vector/Euler angle
Remaining traversing
instructions using special
axes (e.g. C, U, V)
Frame calculation:
• Offset
Scaling
•
Tool length compensation
Kinematic transformation (if active)
Movement of the machine axes of the channel abc
Rotary ax es with 5 axis transformator
Path calculations
The path calculation determines the distance to be
traversed in a block, taking into account all offsets
and compensations.
2.1Structure and contents of an NC program ...................................................................... 2-52
2.2Language elements of the programming language ........................................................ 2-53
2.3Programming a sample workpiece.................................................................................. 2-75
2.4First programming example for milling application.......................................................... 2-77
2.5Second programming example for milling application .................................................... 2-78
2.6Programming example for turning application ................................................................ 2-81
2
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-51
Fundamental Principles of NC Programming11.02
2
2.1Structure and contents of an NC program
2
840D
NCU 571
840D
NCU 572
NCU 573
810D840Di
2.1Structure and contents of an NC program
DIN 66025 is the guideline for designing a parts
program.
An (NC/part) program consists of a sequence of NC
blocks (see table below). Each data block represents
one machining step. Instructions are written in the
blocks in the form of words. The last block in the
execution sequence contains a special word for the
end of program: M2, M17 or M30.
BlockWordWordWord...;Comment
BlockN10G0X20...;1st block
BlockN20G2Z37...;2nd block
BlockN30G91......;...
BlockN40.........
BlockN50M30......;End of program (last block)
Program names
Each program has a different name; the name can be
chosen freely during program creation (except for
punch tape format), taking the following conditions into
account:
• The first two characters must be letters (or a letter
with an underscore character)
• Otherwise: letters or numerals
Example:_MPF100 orSHAFT orSHAFT_2
Only the first 24 characters of a program identifier are
displayed on the NC.
%_N_SHAFT123_MPF = parts program SHAFT123or%flange3_MPF= parts program flange3
For further information on downloading, creating and
storing parts programs, please refer to:
/BA/, Operator's Guide, in the sections on the
"Program" and "Services" user areas.
840D
NCU 572
NCU 573
0...9, A...Z, a...z or ____and may be up to
24 characters in length.
(_xxx).
externally or modified using an editor. The name of
a file which is stored internally in the NC memory
begins with "_N_".
A file in punch tape format begins with %<name>,
"%" must appear in the first column of the first line.
810D840Di
2.2Language elements of the programming language
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-53
Character set
The following characters are available for writing NC
programs:
Upper caseA, B, C, D, E, F, G, H, I, J, K, L, M,
N, (O), P, Q, R, S, T, U, V, W, X, Y, Z
Please note:
Take care to differentiate between the letter "O" and
the numeral "0".
Fundamental Principles of NC Programming11.02
2
2.2Language elements of the programming language
2
840D
NCU 571
Lower casea, b, c, d, e, f, g, h, i, j, k, l, m,
n, o, p, q, r, s, t, u, v, w, x, y, z
Numerals0, 1, 2, 3, 4, 5, 6, 7, 8, 9
No distinction is made between upper and lower case
letters.
Special characters%
(
)
[
]
<
>
:
=
/
*
+
"
´
$
_
?
!
.
,
;
&
L
F
Tab characterSpace character
Non-printable special characters are treated like
blanks.
840D
NCU 572
NCU 573
810D840Di
Program start character (used only for writing programs on an external PC)
For bracketing parameters or expressions
For bracketing parameters or expressions
For bracketing addresses or indexes
For bracketing addresses or indexes
Less than
Greater than
Main block, label suffix, chain operator
Assignment, part of equation
Division, block suppression
Multiplication
Addition
Subtraction, minus sign
Double quotation marks, identifier for character string
Single quotation marks, identifier for special numerical values: hexadecimal,
binary
Words
NC programs are made up of blocks and each block is
made up of words.
A word in the NC language consists of an address
character and a digit or sequence of digits
representing an arithmetic value.
The address character of the word is usually a letter.
The sequence of digits can contain a leading sign and
decimal point. The leading sign always appears
between the address letter and the sequence of digits.
The positive leading sign (+) does not have to be
specified.
Blocks and block format
An NC program consists of individual blocks. A block
generally consists of (several) words.
A block should contain all the data required for
performing an operation step and is terminated with
the character "L
" (LINE FEED = new line).
F
The characters "L
" character does not have to be
F
inserted manually, it is generated automatically when
you change lines.
Block length
A block may contain
• up to SW 3.x a maximum of 242 characters
• SW 4 and higher a maximum of 512 characters
(including the comment and
end-of-block character "L
F
").
WordWord
Digits
Address
Digits
Address
Word
Address
G01 X-50 S2000
Block
Digits
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-55
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
840D
NCU 571
840D
NCU 572
NCU 573
e elements of the programming language
810D
840Di
2
Three blocks of up to 66 characters each are normally
displayed in the current block display on the screen.
Comments are also displayed. Messages are
displayed in a separate message window.
Word sequence in blocks
In order to keep the block structure as clear as
possible, the words in a block should be arranged as
follows:
Example:
N10 G… X… Y… Z… F… S… T… D… M… H…
AddressN10GX,Y,ZFSTDMH
Some addresses can be used repeatedly within a
block (e.g.: G…, M…, H…).
Main block/subblock
There are two types of blocks:
• Main blocks and
• Subblocks.
The main block must contain all the words necessary
to start the operation sequence in the program section
beginning with the main block.
Main blocks can be contained in both main programs
and subprograms. The control does not check whether
a main block contains all the necessary information.
Block number
Main blocks are identified by a main block number. A
main block number consists of the character ":" and a
positive integer (block number). The block number
always appears at the start of a block.
Main block numbers must be unique within a program
to achieve an unambiguous result when searching.
Example::10 D2 F200 S900 M3
Subblocks are identified by a subblock number. A
subblock number consists of the character "N" and a
positive integer (block number). The block number
always appears at the start of a block.
Example:N20 G1 X14 Y35N30 X20 Y40
Subblock numbers must be unique within a program in
order to achieve an unambiguous result when
searching.
The order of the block numbers is arbitrary, however
increasing block numbers are recommended.
You can also program NC blocks without block
numbers.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-57
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
840D
NCU 571
840D
NCU 572
NCU 573
e elements of the programming language
810D
840Di
2
Addresses
Addresses are fixed or variable identifiers for axes (X,
Y, ...) spindle speed (S), feed (F), circle radius (CR),
etc.
Example:
N10 X100
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-59
These address names are available for a specific function.
Machine manufacturer (MH2.1)
"variable"
These addresses can be assigned another name via the
machine data.
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
840D
NCU 571
840D
NCU 572
NCU 573
e elements of the programming language
810D
840Di
2
Modal/non-modal addresses
Modal addresses remain valid with the programmed value
(in all subsequent blocks) until a new value is
programmed at the same address.
Non-modal addresses only apply in the block in which
they were programmed.
Example:
N10 G01 F500 X10N20 X10;Feed is effective until
Addresses with axial extension
In addresses with axial extension, an axis name is
inserted in square brackets after the address. The axis
name assigns the axis.
Example:FA[U]=400;
Axis-specific feed for U axis
Extended addresses
Extended address notation enables a larger number of
axes and spindles to be organized in a system. An
extended address is composed of a numeric extension or
a variable identifier enclosed in square brackets and an
arithmetic expression assigned with an "=" sign.
Example:
X7X4=20CR=7.3S1=470M3=5
a new value is entered.
;No "=" required, 7 is a value, but the "=" ;character is also possible here
;Axis X4 ("=" required)
;2 letters ("=" required)
;Speed for 1st spindle 470rpm
;Spindle stop for 3rd spindle
The extended address notation is only permitted for the following direct addresses:
X, Y, Z, …I, J, KSSPOS, SPOSAMHTF
Axis addresses
Interpolation parameters
Spindle speed
Spindle position
Miscellaneous functions
Auxiliary functions
Tool number
Feed
The number (index) in extended address notation can
be substituted by a variable for M, H and S addresses
and SPOS and SPOSA. The variable identifier is
enclosed in square brackets.
Example:
S[SPINU]=47
;Speed for the spindle whose number is stored in the variable SPINU
0
M[SPINU]=3T[SPINU]=7
;Clockwise rotation for the spindle whose number is stored in the variable SPINU
;Selection of the tool for the spindle whose number is stored in the variable SPINU
Fixed addresses
The following addresses are set permanently:
AddressMeaning (default setting)DFGHLMNPRST
:
Tool edge number
Feed
Preparatory function
Auxiliary function
Subprogram call
Special function
Subblock
Number of program passes
Arithmetic parameter
Spindle speed
Tool number
Main block
2
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-61
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
840D
NCU 571
840D
NCU 572
NCU 573
e elements of the programming language
810D
840Di
2
Example for programming:
N10 G54 T9 D2
When programming with the axis extension, the axis to be traversed is enclosed in square brackets.
all the operators can be specified by parentheses,
in order to override the normal priority rules.
Value assignments
Values can be assigned to the addresses. The method of
value assignment depends on the type of address
identifier.
An "=" sign must be inserted between the address
identifier and the value if
•the address identifier consists of more than one letter,
or
•the value consists of more than one constant.
The "="-sign can be omitted if the address identifier is a
single letter and the value consists of only one constant.
Leading signs are allowed and separators are permitted
after the address letter.
Examples:
X10X1=10
;Value assignment (10) to address X, "=" not required
;Value assignment (10) to address (X) with numeric extension (1), "="
required
;Axis names from passed parameters
;Axis name as an index when accessing axis data
;Indirect axis programming
;Value assignment by means of a numeric expression, "=" required
A numeric extension must always be followed by one of
the special characters "=", "(", "[")"]", "," or an operator in
order to distinguish an address name with numeric
extension from an address letter with a value.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-65
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
840D
NCU 571
840D
NCU 572
NCU 573
e elements of the programming language
810D
840Di
2
Identifiers
Identifiers can also be used to describe words (in
compliance with DIN 66025). The identifiers have the
same meaning as the words within an NC block.
Identifiers must be unique. Identical identifiers must not
be used for different objects.
Identifiers can stand for:
•Variables
- System variables
- User variables
•Subprograms
•Vocabulary words
•DIN addresses with several letters
•Jump labels
Structure
The identifiers are composed of up to 32 characters. The
following characters may be used:
•Letters
•Underscores
•Numerals
The first two characters must be letters or underscores,
separators must not be programmed between the
individual characters (see the following pages).
Example:CMIRROR, CDON
Reserved vocabulary words must not be used as
identifiers. Separators are not permitted between the
The following rules are provided in order to avoid
identifier collisions:
•All identifiers which begin with "CYCLE" or "_" are
reserved for SIEMENS cycles.
•All identifiers which begin with "CCS" are reserved for
SIEMENS compile cycles.
•User compile cycles begin with "CC".
• We recommend that users select identifier names
which either begin with "U" (User) or contain the
underscore symbol, because these are not used by
the system or compile cycles or SIEMENS cycles.
Further reserved identifiers
• The identifier "RL" is reserved for conventional turning
machines.
• All identifiers beginning with "E_ " are reserved for
EASYSTEP programming.
Variable identifiers
In variables used by the system, the first letter is replaced
by the "$" character. This character may not be used for
user-defined variables.
Examples (see Programming Guide "Advanced"):
$P_IFRAME, $P_F
Leading zeroes are ignored in variables with numeric
extensions (i.e. R01 is interpreted as R1). Separators are
allowed before a numeric extension.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-67
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Array identifiers
The rules for elementary variables also apply to array
identifiers. It is possible to address arithmetic variables
as arrays.
Example:R[10]=…
Data types
A variable can contain a numeric value (or several) or
a character (or several), e.g. an address letter.
The data type permitted for the variable is determined
when the variable is defined. The data type for system
variables and predefined variables is fixed.
Elementary variable types/data types are:
TypeDefinitionValue range
INTREAL
Integers with leading sign ±(231 - 1)
-300
Real numbers (fractions with decimal
±(10
… 10
point, LONG REAL according to
IEEE)
BOOL
Boolean values: TRUE (1) and
1, 0
FALSE (0)
CHAR
1 ASCII character specified by the
0 … 255
code
STRING
Character string, number of
Sequence of values with 0 … 255
characters in […], maximum of 200
characters
AXISFRAME
Axis names (axis addresses) only Any axis identifiers in the channel
Geometrical parameters for
translation, rotation, scale and mirror
Identical elementary types can be combined in arrays.
Up to two-dimensional arrays are possible.
Integer constants:
Integer with or without leading sign, e.g. for assigning
a value to an address
Examples:
X100X-100
;Assignment of the value +100 to address X
;Assignment of the value –100 to address X
Real constants:
Real number, e.g. with decimal point, with or without
leading sign, e.g. for assigning a value to an address
Example:
X10.25X-10.25X0.25X.25X=-.1EX-3
;Assignment of the value +10.25 to address X
;Assignment of the value –10.25 to address X
;Assignment of the value +0.25 to address X
;Assignment of the value +0.25 to address X without leading "0"
;Assignment of the value –0.1*10-3 to address X
If, in an address which permits decimal point input,
more decimal places are specified than actually
provided for the address, then they are rounded to fit
the number of places provided.
X0 cannot be replaced with X.
Example:Do not replace G01 X0 with G01 X!
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-69
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
840D
NCU 571
840D
NCU 572
NCU 573
e elements of the programming language
810D
840Di
2
Hexadecimal constants
Constants can also be interpreted in hexadecimal
format. The letters "A" to "F" stand for the digits 10 to
15.
Hexadecimal constants are enclosed in single
quotation marks and start with the letter "H", followed
by the value in hexadecimal notation. Separators are
allowed between the letters and digits.
Example for machine data (see also "Advanced"):
$MC_TOOL_MANAGEMENT_MASK='H3C7F'
The maximum number of characters is limited by the
value range of the integer data type.
Binary constants
Constants can also be interpreted in binary format. In
this case, only the digits "0" and "1" are used.
Binary constants are enclosed in single quotation
marks and start with the letter "B", followed by the
binary value. Separators are allowed between the
digits.
Example for machine data (see also "Advanced"):
$MN_AUXFU_GROUP_SPEC='B10000001'
The maximum number of characters is limited by the
value range of the integer data type.
Program section
A program section consists of a main block and
several subblocks.
Examples:
:10 D2 F200 S900 M3N20 G1 X14 Y35N30 X20 Y40N40 Y-10
...
N100 M30
Skipping blocks
Blocks which are not to be executed on every program
pass can be skipped (e.g. positioning program).
Blocks which are to be skipped are marked with an
oblique "/" in front of the block number. Several
consecutive blocks can also be skipped. The
instructions in the skipped blocks are not executed;
the program continues with the next block which is not
skipped.
Examples:
N10 ...
/N20 ...
N30 ...
/N40 ...
/N50 ...
/N60 ...
N70 ...
N80 ...
N90 ...
N100 ...
N110 ...
N120
Program execution
N10 …/N20 …N30 …/N40 …N70 …
;is executed
;skipped
;is executed
;skipped
;is executed
SW 5 and higher
Up to eight skip levels can be programmed. Only one
skip level can be specified per NC block:
/ ... ;Block is skipped (1st skip level)
/0 ... ;Block is skipped (1st skip level)
/1 N010... ;Block is skipped (2nd skip level)
/2 N020... ;Block is skipped (3rd skip level)
...
/7 N100... ;Block is skipped (8th skip level)
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-71
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
840D
NCU 571
840D
NCU 572
NCU 573
e elements of the programming language
810D
840Di
2
/8 N080... ;Block is skipped (9th skip level)
/9 N090... ;Block is skipped (10th skip level)
Label names are allocated with at least two and up to
SW 6.3 and higher
Up to ten skip levels can be programmed. Only one
skip level can be specified per NC block:
Machine manufacturer (MH2.2)
The number of skip levels that can be used depends
on a display MD.
Block skipping of levels /0 to /9 is activated by an
operator action (see /BA/ Operator's Guide, program
control menu in Machine operating area) or by the
programmable controller.
System and user variables can also be used in
conditional jumps in order to control program
execution.
Jump destinations (labels)
Labels can be defined to jump within a program.
You will find further information in the Programming
Guide Advanced.
32 characters (letters, digits, underscore). The first two
characters must be letters or underscores. The label
name is followed by a colon (":").
Labels must be unique within a program.
Labels always appear at the start of a block. If a
program number exists, the label appears immediately
after the block number.
Comments
To make NC programs easier to understand for other
users and programmers, it is advisable to insert
meaningful comments in the program.
Comments are appended to the end of a block and are
separated from the program section of the NC block
by a semicolon (";").
Examples:
N10 G1 F100 X10 Y20 ; Comments to explain the NC block
or
N10 ; G&S Co., order no. 12A71N20 ; Program written by Bob Miller, Dept. TV 4, on 21.11.94N50 ; Part no. 12, housing for pump type TP23A
Comments are stored and appear in the current block
display when the program is running.
Programming messages
Messages can be programmed to provide the user
with information about the current machining situation
during program execution.
A message in an NC program is generated when the
message text is typed after vocabulary word "MSG" in
round parentheses "()" and quotation marks.
A message can be cleared by programming "MSG ()".
Example:
N10 MSG ("Roughing the contour")N20 X… Y…N …N90 MSG ()
;Activate message
;Clear message from N10
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-73
guag
Fundamental Principles of NC Programming11.02
2
2.2Lan
Contents of variables can also be displayed in
Examples:
or
840D
NCU 571
A message text can be up to 124 characters long and
is displayed in two lines (2*62 characters).
message texts.
N10 R12=$AA_IW [X]N20 MSG (″check position of X axis″<<R12<<″″)N …N90 MSG ()
N20 MSG (″check position of X axis″<<$AA_IW[X]<<″″)
Setting alarms
You can also set alarms in addition to messages in an
NC program. Alarms are displayed in a separate field
on the screen display. An alarm is associated with a
reaction on the control which depends on the alarm
category.
Alarms are programmed by writing the vocabulary
word "SETAL" followed by the alarm number enclosed
in brackets.
The valid range for alarm numbers lies between
60,000 and 69,999, whereby 60,000 to 64,999 are
reserved for SIEMENS cycles and 65,000 to 69,999
are available to the user.
Alarms are always programmed in a separate block.
Example:
N100 SETAL (65000)
You will find a list of reactions associated with specific
alarms in the Installation and Start-up Guide.
The actual programming of the individual operation
steps in the NC language generally only represents a
small proportion of the work in the development of an
NC program.
Programming of the actual instructions should be
preceded by the planning and preparation of the
operation steps. And the more accurately you consider
how the NC program is to be structured and
organized, the faster and easier it will be to produce a
complete program which is clear and free of errors.
Clearly structured programs are a particular advantage
if you need to make changes at a later date.
Since different parts do not all look the same, it is
naturally inadvisable to develop every program
according to the same method. However, certain
procedures apply in most cases and these are
presented on the following pages in the form of a
checklist.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition2-75
g
Fundamental Principles of NC Programming11.02
2
2.3Pro
840D
NCU 571
1. Prepare the workpiece drawing
•Define the workpiece zero
•Sketch in the coordinate system
•Calculate any missing coordinates
2. Define machining sequence
•What tools are used when and to machine which
contour?
•In what order are the individual elements of the
workpiece manufactured?
•Which individual elements are repeated (or also
rotated) and should therefore be stored in a
subprogram?
•Do these or similar contour sections already exist in
other parts programs or subprograms which could
be used here?
Where is it advisable or necessary to perform zero
offset, rotation, mirroring or scaling (frame
concept)?
3. Create a machining plan
Define all the machining processes in steps, e.g.:
•Rapid traverse movements for positioning
•Tool change
•Tool retraction for recalibration
•Switching the spindle and coolant on and off
•Calling tool data
•Infeed
•Path correction
•Approach contour
•Retract from contour
•etc.
4. Translate the work steps into the programming
language
Enter each individual step in an NC block or blocks
3.5Zero offset (frame), G54 to G599................................................................................... 3-94
3.6Selecting the working plane, G17 to G19 ....................................................................... 3-99
3.7Programmable working area limitation, G25/G26 ........................................................ 3-102
3
3.8Reference point approach, G74 ................................................................................... 3-105
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-83
Positional Data11.02
3
3.1General information
3
840D
NCU 571
840D
NCU 572
NCU 573
3.1General information
In this section you will find a description of the
commands that normally appear at the beginning of
a NC program.
The way in which these functions are combined is
not intended to be a patent remedy. For example,
the choice of working plane may be made at another
point in the NC program.
The real purpose of this and all the following
sections is to illustrate the conventional structure of
an NC program.
Axis identifiers of the axes to be traversed
Absolute dimensions (non-modal)
Incremental dimensions (non-modal)
Function
The G90/91 commands and the non-modal
dimensions AC/IC are used to define the system for
describing the approach to setpoints.
Sequence
Absolute dimensions, G90
The dimensions refer to the origin of the active
coordinate system. You program the point to which
the tool is to travel, e.g. in the workpiece coordinate
system.
Incremental dimensions, G91
The dimensions refer to the last point approached.
You program how far the tool is to travel.
Non-modal absolute or incremental
dimensioning AC, IC
When G91 is active, AC can be used to allow entry
of absolute dimensions for individual axes in a
specific block. When G90 is active, IC can be used
to allow entry of incremental dimensions for
individual axes in a specific block.
85
G90
Y
35
G91
3020
1050
60
G90
X
G91
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-85
Positional Data11.02
3
3.2Absolute/incremental dimensions, G90/G91
3
840D
NCU 571
840D
NCU 572
NCU 573
810D840Di
Additional notes
The commands G90 and G91 generally apply to all
axes programmed in subsequent NC blocks.
Both commands are modal.
On conventional turning machines it is standard
practice to interpret incremental NC blocks in the
transverse axis as radius values, while diameter
dimensions are valid for absolute coordinates. This
conversion for G90/G91 is performed using the
commands DIAMON, DIAMOF or DIAM90.
You will find further information in "Special turning
functions" (Section 4.13) in this Programming Guide.
G91
G90
X
G91
G90
Ø 25
Z
7.5
Programming example
The traverse paths are entered in absolute
coordinates with reference to the workpiece zero.
The center point coordinates I and J for circular
interpolation are specified blockwise in absolute
coordinates, since the arc center is programmed
– independent of G90/G91 – in incremental
coordinates as standard.
Absolute dimensioning, rapid traverse to
XYZ
Tool infeed
Circle center point in absolute dimensions
Circle center point in incremental
dimensions
Retract
End of block
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-87
Positional Data11.02
3
3.2Absolute/incremental dimensions, G90/G91
3
840D
NCU 571
840D
NCU 572
NCU 573
810D840Di
3.2.1G91 extension (SW 4.3 and higher)
Programming
Incremental dimension data input G91 or
X=IC(…) Y=IC(…) Z=IC(…)
• without traversing through the active tool offset
SD 42442 TOOL_OFFSET_INCR_PROG = 0
• without traversing through the active zero offset
SD 42440 FRAME_OFFSET_INCR_PROG = 0
Explanation of the parameters
SD 42440
FRAME_OFFSET_INCR_PROG = 0
SD 42442 TOOL_OFFSET_INCR_PROG
= 0
Function
The active zero offset is not traversed.
The active tool offset is not traversed.
This can be set separately via SDs
For applications such as scratching, it is necessary
only to traverse the path programmed in the
incremental coordinates. The active zero offset or
tool offset is not traversed.
FRAME_OFFSET_INCR_PROG (zero point) and
TOOL_OFFSET_INCR_PROG (tool offset).
3.3Absolute dimensions for rotary axes, DC, ACP, ACN
3
840D
NCU 571
840D
NCU 572
NCU 573
810D840Di
3.3Absolute dimensions for rotary axes, DC, ACP, ACN
Programming
A=DC(…) B=DC(…) C=DC(…)
or
A=ACP(…) B=ACP(…) C=ACP(…)
or
A=ACN(…) B=ACN(…) C=ACN(…)
Explanation of the parameters
A B CDCACPACN
Function
Axis identifier for rotary axis to be traversed
Absolute dimensions, approach position directly
Absolute dimensions, approach position in positive direction
Absolute dimensions, approach position in negative direction
With the above parameters you can define the
desired approach strategy for positioning rotary
axes.
Sequence
Absolute dimensioning with
The rotary axis travels to the position programmed in
absolute coordinates along the shortest direct path.
The rotary axis traverses across an area of up to
180°.
Absolute dimensioning with ACP
The rotary axis travels to the positions programmed
in absolute coordinates in the positive direction of
axis rotation (counterclockwise).
Absolute dimensioning with ACN
The rotary axis travels to the positions programmed in
absolute coordinates in the negative direction of axis
rotation (clockwise).
DC
ACPACN
Maximum
traversing range
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-89
Positional Data11.02
3
3.3Absolute dimensions for rotary axes, DC, ACP, ACN
3
840D
NCU 571
840D
NCU 572
NCU 573
810D840Di
The traversing range between 0° and 360° must be
set in the machine data (modulo method) for
positioning with directional data (ACP, ACN). G91 or
IC must be programmed to traverse modulo rotary
axes by more than 360° in a block. You will find
more information on the previous pages.
The positive direction of rotation (clockwise or
counterclockwise) is set in the machine data.
Additional notes
All of the commands are modal.
You can also use DC, ACP and ACN for spindle
positioning from zero speed.
Example:
SPOS=DC(45)
Programming example
Machining on a rotary table: The tool is stationary,
the table rotates through 270° in clockwise
Depending on the dimensions in the production
drawing, you can program workpiece geometries
alternately in metric measures and inches.
In SW 5 and higher, the functionality of G70/G71 has
been extended with G700/G710. In addition to the
geometrical parameters, the technological parameters,
such as feed F, are interpreted during parts program
execution in the system of units set in G700/G710.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-91
G70 or G71
You can instruct the control to convert the following
geometrical dimensions (with necessary deviations)
into the system of units not set and then enter them
directly (see examples):
• Positional data X, Y, Z, …
• Intermediate point coordinates I1, J1, K1
Interpolation parameters I, J, K and circle radius
CR in circle programming
• Thread lead
• Programmable zero offset (TRANS)
• Polar radius RP
Positional Data11.02
p
3
3.4Metric/im
840D
NCU 571
840D
NCU 572
NCU 573
erial dimensions, G70/G71/G700/G710
810D
840Di
3
All other parameters such as feedrates, tool offsets
The representation of system variables and machine
The programmed feedrate value is modal and thus
If the feedrate in the G70/G71/G700/G710 context is to
or settable zero offsets are interpreted (when using
G70/G71) in the default system of units (MD 10240:
SCALING_SYSTEM_IS_METRIC).
data is also independent of the G70/G71 context.
G700 or G710
In SW 5 and higher, the controller interprets all
feedrates used with G700/G710 in the programmed
system of units, unlike G70/G71.
The G700/G710 codes are contained in the same
group as G70/G71.
For information about the action of G70/G71 and
G700/G710 on NC addresses, please refer to
Section 12.2. "List of addresses".
does not change automatically on subsequent
G70/G71/G700/G710 selections.
be activated, a new F value must be programmed
explicitly.
All length-related NC data, machine data and setting
data for G700/G710 are always read and written in the
programmed context of G700/G710.
Synchronized actions
If positioning tasks are performed in synchronized
actions and no G70/G71/G700/G710 command is
programmed in the synchronized action itself, the
G70/G71/G700/G710 context active at the time of
execution determines which system of units is used.
References:/PGA/ Chapter 10,
Motion-synchronous actions
/FBSY/ Synchronized Actions
Programming example
Change between metric and imperial input with basic
setting metric (G70/G71).
Enter destination positions in inches, G70
is active until deselected by G71 or end
of program
N50X1.18 Y3.54N60 G71 X 20 Y30N70G0 Z2 M30
Enter positions in mm
Retract in rapid traverse, end of program
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-93
Positional Data11.02
(
3
3.5Zero offset
840D
NCU 571
3.5Zero offset (frame), G54 to G599
840D
NCU 572
NCU 573
frame), G54 to G599
810D
840Di
3
Programming
CallG54 or G55 or G56 or G57 or G505 … G599DeactivateG53 or G500 or SUPA or G153
Explanation of the commands
G53
G54 to G57G153G500
SUPA
G505 ... G599
Non-modal deactivation of current settable zero offset and programmable
zero offset
Call the second to fifth settable zero offset/frame
Non-modal suppression of settable, programmable and total basic frame
• G500=zero frame, default setting,
(contains no offset, rotation, mirroring or scaling)
• Deactivation of settable zero offsets / frames (G54 to G599)
until the next call.
• Activation of the total basic frame ($P_ACTBFRAME).
• G500 is not 0
• Activation of first settable zero offset/frames ($P_UIFR[0]) and
• Activation of total basic frame ($P_ACTBFRAME), or a
modified basic frame is activated.
Non-modal deactivation, including programmed offsets, handwheel
offsets (DRF), external zero offset and PRESET offset.
Call the 6th to the 99th settable zero offset
The settable zero offset relates the workpiece zero
on all axes to the origin of the basic coordinate
system.
It is therefore possible to call up cross-program zero
points for different fixtures with a G command.
For turning, e.g. the offset value for tightening the
chuck is entered in G54.
Milling:
Z
Turning:
Z
4
5
G
Y
Y
X
X
X
Z
M
W
G54
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-95
Positional Data11.02
(
3
3.5Zero offset
frame), G54 to G599
3
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Sequence
Setting the offset values
On the operator panel or universal interface, enter
the following values in the internal control zero offset
table:
• Coordinates for the offset
• Angle for rotated clamping and
• Scale factors if necessary
Please see the Operator’s Guide for the procedure.
Y
Scale
Y
X
R
o
t
a
t
e
Offset
X
Activating the zero offset
In the NC program, the zero offset is moved from the
machine coordinate system to the workpiece
coordinate system by executing commands G54 to
G57.
In the next NC block with a programmed movement,
all of the positional parameters and thus the tool
movements refer to the workpiece zero which is now
valid.
Y
Y
Y
X
Y
X
X
The four available zero offsets can be used, e.g. for
multiple machining operations, to describe four
workpiece clamping positions simultaneously and
Further settable zero offsets, G505 to G599
Command numbers G505 to G599 are available for
this purpose. This enables you to create up to 100
settable zero offsets in total, in addition to the four
default zero offsets G54 to G57, by using the
machine data. They are stored in the zero point
memory.
Please refer to Chapter 4 for further information.
Deactivating a zero offset
Command G500 activates the first settable zero
offset including basic offset, i.e. when zero frame is
selected as the default, the current settable zero
offset is deactivated.
G53 suppresses the programmable and settable
offset non-modally.
G153 has the same effect as G53 and also
suppresses the total basic frame.
SUPA has the same effect as G153 and also
suppresses the DRF offset, overlaid motions and
external ZOs.
You will find more information on programmable
zero offsets in Chapter 6 (frames).
Additional notes
The basic setting at program start, e.g. G54 or G500,
can be set with machine data.
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-97
Positional Data11.02
(
3
3.5Zero offset
frame), G54 to G599
3
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Programming example
In this example, three workpieces, arranged on a
pallet according to the zero offset values G54 to
G56, are machined successively.
The machining sequence is programmed in
subprogram L47.
Approach
Call the first zero offset, spindle
clockwise
Run program, in this case as a
subprogram
Call the second zero offset Z via obstacle
Run program as subprogram
Call third zero offset
Run program as subprogram
Suppress zero offset, end of program
The axis assignment for G17, G18, G19 specified
above is based on the supposition that X is assigned
to the 1st geometry axis, Y to the second and Z to
the third in the machine data.
Function
The specification of the working plane, in which the
contour is to be machined also defines the following
functions:
• The plane for tool radius compensation
• The infeed direction for tool length compensation
• The plane for circular interpolation.
Working plane X/Y Infeed direction Z
Working plane Z/X Infeed direction Y
Working plane Y/Z Infeed direction X
Milling:
Z
Infeed
Y
X
depending on the tool type
I
n
f
e
d
e
e
f
n
I
Siemens AG, 2002. All rights reserved
SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition3-99
e
d
Positional Data11.02
g
3
3.6Selectin
840D
NCU 571
840D
NCU 572
NCU 573
the working plane, G17 to G19
810D
840Di
3
Sequence
It is advisable to define the working plane at the
beginning of the program.
The working plane must be specified when the tool
path compensation G41/G42 (see Section "Tool
offsets") is called so that the control can correct the
tool length and radius. In the initial setting, G17 (X/Y
plane) is defined for milling and G18 (Z/X plane) is
defined for turning.
Machining on inclined planes
Rotate the coordinate system with ROT (see Section
"Coordinate system offset") to position the
coordinate axes on the inclined surface. The working
planes rotate accordingly.
Turning:
G
Y
7
1
G
1
9
G
1
8
Z
X
Tool length compensation in inclined planes
The tool length compensation generally always
refers to the fixed, non-rotated working plane.