This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.
CAUTION
without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.
NOTICE
indicates that an unintended result or situation can occur if the corresponding information is not taken into account.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be
used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property
damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation for the specific task, in particular its warning notices and safety
instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying
risks and avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended or
approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be adhered to. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of the SiemensAG. The remaining trademarks in this
publication may be trademarks whose use by third parties for their own purposes could violate the rights of the
owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described.
Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this
publication is reviewed regularly and any necessary corrections are included in subsequent editions.
Siemens AG
Industry Sector
Postfach 48 48
90026 NÜRNBERG
GERMANY
You can find information on SINUMERIK under the following link:
www.siemens.com/sinumerik
Target group
This publication is intended for:
•Programmers
•Project engineers
Benefits
With the programming manual, the target group can develop, write, test, and debug programs
and software user interfaces.
Standard scope
Technical Support
This Programming Guide describes the functionality afforded by standard functions.
Extensions or changes made by the machine tool manufacturer are documented by the
machine tool manufacturer.
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.
Further, for the sake of simplicity, this documentation does not contain all detailed information
about all types of the product and cannot cover every conceivable case of installation,
operation or maintenance.
You will find telephone numbers for other countries for technical support in the Internet under
http://www.siemens.com/automation/service&support
Job planning
4Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Information on structure and contents
"Fundamentals" and "Advanced" Programming Manual
The description of the NC programming is divided into two manuals:
1. Fundamentals
This "Fundamentals" Programming Manual 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.
2. Job planning
The Programming Manual "Advanced" is intended for use by technicians with in-depth,
comprehensive programming knowledge. By virtue of a special programming language,
the SINUMERIK control enables the user to program complex workpiece programs (e.g.
for free-form surfaces, channel coordination, ...) and makes programming of complicated
operations easy for technologists.
Preface
Availability of the described NC language elements
All NC language elements described in the manual are available for the SINUMERIK 840Dsl.
The availability regarding SINUMERIK828D can be found in table"Operations: Availability for
SINUMERIK 828D [Page 877]" of the "".
2.3Structuring instruction in step editor (SEFORM) ..................................................................... 227
3Protection zones .....................................................................................................................................229
3.1Definition of the protection zones (CPROTDEF, NPROTDEF) ............................................... 229
3.2Activating/deactivating protection zones (CPROT, NPROT)................................................... 233
3.3Checking for protection zone violation, working area limitation and software limits
11.2Oscillation controlled by synchronized actions (OSCILL) ........................................................ 657
12Punching and nibbling .............................................................................................................................665
The use of variables, especially in conjunction with arithmetic functions and check structures,
enables part programs and cycles to be set up with extremely high levels of flexibility. For this
purpose the system makes three different types of variable available.
•System variables
System variables are variables with a fixed predefined meaning; they are defined in the
system and made available to the user. They are also read and written by the system
software. Example: Machine data
The meaning of a system variable is, to a large extent, predefined by the system and its
properties are fixed. However, minor modifications can be made to the properties by the
user in the form of redefinition. See "Redefinition of system variables, user variables, and
NC language commands (REDEF) [Page 31]".
•User variables
1
User variables are variables whose meaning is not known to the system; they are not
evaluated by the system. The meaning is defined exclusively by the user.
User variables are subdivided into:
-Predefined user variables
Predefined user variables are variables which have already been defined in the system
and whose number simply has to be parameterized by the user via specific machine
data. The user can make significant changes to the properties of these variables. See
"Redefinition of system variables, user variables, and NC language commands
(REDEF) [Page 31]".
-User-defined variables
User-defined variables are variables which are defined exclusively by the user and are
not created by the system until runtime. Their number, data type, visibility, and all other
properties are defined exclusively by the user.
See "Definition of user variables (DEF) [Page 25]".
Attribute: Physical unit (PHU) Attribute: Physical unit (PHU) [Page 39]
Attribute: Access rights (APR, APW, APRP, APWP, APRB, APWB) Attribute: Access rights
(APR, APW, APRP, APWP, APRB, APWB) [Page 41]
Overview of definable and redefinable attributes Overview of definable and redefinable
attributes [Page 46]
Definition and initialization of array variables (DEF, SET, REP) Definition and initialization of
array variables (DEF, SET, REP) [Page 47]
Data types Data types [Page 55]
1.1.2System variables
System variables are variables which are predefined in the system and provide access to the
actual parameter settings associated with the control, as well as machine, control, and
process statuses, in part programs and cycles.
Preprocessing variables
Preprocessing variables are system variables that are read and written in the context of
preprocessing; in other words, at the point in time at which the part program block in which
the system variable is programmed is interpreted. Preprocessing variables do not trigger
preprocessing stops.
Main run variables
Main run variables are system variables which are read and written in the context of the main
run; in other words at the point in time at which the part program block in which the system
variable is programmed is executed. The following are main run variables:
•System variables which can be programmed in synchronized actions (read/write)
•System variables which can be programmed in the part program and trigger preprocessing
stops (read/write)
•System variables which can be programmed in the part program and whose value is
calculated during preprocessing but not written until the main run (main run synchronized:
write only)
Job planning
18Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Prefix system
Flexible NC programming
1.1 Variables
In order that they can be specifically identified, the names of system variables are usually
preceded by a prefix comprising the $ sign followed by one or two letters and an underscore.
$ + 1. LetterSignificance: Data type
System variables which are read/written during preprocessing
$M
$S
Machine data
Setting data, protection zones
$TTool management data
$PProgrammed values
$CCycle variables of ISO envelope cycles
$OOption data
R
R-parameters (arithmetic parameters)
System variables which are read/written during the main run
$$M
$$S
Machine data
Setting data
$AUp-to-date main run data
$VServo data
$R
1)
When machine and setting data are used in the part program/cycle as preprocessing variables, the
R-parameters (arithmetic parameters)
prefix is written with one $ sign. When they are used in synchronized actions as main run variables,
the prefix is written with two $ signs.
2)
When an R-parameter is used in the part program/cycle as a preprocessing variable, the prefix is
omitted, e.g. R10. When it is used in a synchronized action as a main run variable, a $ sign is written
as a prefix, e.g. $R10.
Use of machine and setting data in synchronized actions
When machine and setting data are used in synchronized actions, the prefix can be used to
define whether the machine or setting data will be read/written synchronous to the
preprocessing run or the main run.
If the data remains unchanged during machining, it can be read synchronous to the
preprocessing run. For this purpose, the machine or setting data prefix is written with a $ sign:
Program code
ID=1 WHENEVER G710 $AA_IM[z] < $SA_OSCILL_REVERSE_POS2[Z]–6 DO $AA_OVR[X]=0
If the data changes during machining, it must be read/written synchronous to the main run.
For this purpose, the machine or setting data prefix is written with two $ signs:
Program code
ID=1 WHENEVER $AA_IM[z] < $$SA_OSCILL_REVERSE_POS2[Z]–6 DO $AA_OVR[X]=0
Note
Writing machine data
When writing an item of machine or setting data, it is important to ensure that the access
level which is active when the part program/cycle is executed permits write access and that
the data is set to take "IMMEDIATE" effect.
References
See also
A list of the properties of all system variables appears in:
List Manual, system variable
General information about variables General information about variables [Page 17]
Job planning
20Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
1.1.3Predefined user variables: Arithmetic parameters (R)
Function
Arithmetic parameters or R-parameters are predefined user variables with the designation R,
defined as an array of the REAL data type. For historical reasons, notation both with array
index, e.g. R[10], and without array index, e.g. R10, is permitted for R-parameters.
When using synchronized actions, the $ sign must be included as a prefix, e.g. $R10.
Syntax
When used as a preprocessing variable:
R<n>
R[<expression>]
When used as a main run variable:
$R<n>
$R[<expression>]
Flexible NC programming
1.1 Variables
Significance
R:Identifier when used as a preprocessing variable, e.g. in the part program
$R:Identifier when used as a main run variable, e.g. in synchronized actions
Type:REAL
Range of
values:
For a non-exponential notation:
± (0.000 0001 to 9999 9999)
Note:
A maximum of 8 decimal places are permitted.
For an exponential notation:
± (1*10
-300
to 1*10
+300
)
Note:
•Notation: <Mantisse>EX<exponent> e.g. 8.2EX-3
•A maximum of 10 characters are permitted including
sign and decimal point.
MAX_INDEX is calculated from the parameterized
number of R-parameters:
MAX_INDEX = (MD28050 $MN_MM_NUM_R_PARAM)
- 1
<expression>
:
Array index
Any expression can be used as an array index, as long as the result of
the expression can be converted into the INT data type (INT, REAL,
BOOL, CHAR).
Example
Assignments to R-parameters and use of R-parameters in mathematical functions:
Program codeComment
R0=3.5678;Assignment in preprocessing
R[1]=-37.3;Assignment in preprocessing
R3=-7;Assignment in preprocessing
$R4=-0.1EX-5;Assignment in main run: R4 = -0.1 * 10^-5
$R[6]=1.874EX8;Assignment in main run: R6 = 1.874 * 10^8
R7=SIN(25.3);Assignment in preprocessing
See also
R[R2]=R10;Indirect addressing using R-parameter
R[(R1+R2)*R3]=5;Indirect addressing using math. expression
X=(R1+R2);Traverse axis X to the position resulting from the
sum of R1 and R2
Z=SQRT(R1*R1+R2*R2);Traverse axis Z to the square root position (R1^2 +
R2^2)
General information about variables General information about variables [Page 17]
Job planning
22Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
1.1.4Predefined user variables: Link variables
Function
Link variables can be used in the context of the "NCU-Link" function for cyclic data exchange
between NCUs which are linked on a network. They facilitate data-format-specific access to
the link variables memory. The link variables memory is defined both in terms of size and data
structure on a system-specific basis by the user/machine manufacturer.
Link variables are system-global user variables which can be read and written in part
programs and cycles by all NCUs involved in a link if link communication has been
configured. Unlike global user variables (GUD), link variables can also be used in
synchronized actions.
On systems without an active NCU link, link variables can be used locally on the control as
additional global user variables alongside global user variables (GUD).
<index>:Address index in bytes, counted from the start of the link variable memory
Data type:INT
Range of values:0 - MAX_INDEX
Note
•MAX_INDEX is calculated from the
parameterized size of the link variables
memory: MAX_INDEX = (MD18700
$MN_MM_SIZEOF_LINKVAR_DATA) - 1
•Only indices may be programmed, so that the
bytes addressed in the link variables memory
are located on a data format limit ⇒
Index = n * bytes, where n = 0, 1, 2, etc.
– $A_DLB[i]: i = 0, 1, 2, etc.
– $A_DLW[i]: i = 0, 2, 4, etc.
– $A_DLD[i]: i = 0, 4, 8, etc.
– $A_DLR[i]: i = 0, 8, 16, etc.
Example
An automation system contains 2 NCUs (NCU1 and NCU2). Machine axis AX2 is connected
to NCU1. It is traversed as a link axis of NCU2.
NCU1 writes the actual current value ($VA_CURR) of axis AX2 cyclically to the link variables
memory. NCU2 reads the actual current value transmitted via link communication cyclically
and displays alarm 61000 if the limit value is exceeded.
The data structure in the link variables memory is illustrated in the following figure. The actual
current value is transmitted in the REAL value.
NCU1
NCU1 uses link variable $A_DLR[ 16 ] to write the actual current value of axis AX2 to the link
variables memory cyclically in the interpolation cycle in a static synchronized action.
Program code
N111 IDS=1 WHENEVER TRUE DO $A_DLR[16]=$VA_CURR[AX2]
Job planning
24Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
NCU2
NCU2 uses link variable $A_DLR[ 16 ] to read the actual current value of axis AX2 from the
link variables memory cyclically in the interpolation cycle in a static synchronized action. If the
actual current value is greater than 23.0 A, alarm 61000 is displayed.
Program code
N222 IDS=1 WHEN $A_DLR[16] > 23.0 DO SETAL(61000)
See also
General information about variables General information about variables [Page 17]
1.1.5Definition of user variables (DEF)
Function
Flexible NC programming
1.1 Variables
The DEF command is used to define user-specific variables and assign values to them. To set
them apart from system variables, these are called user-defined variables or user variables
(user data).
According to range of validity (in other words, the range in which the variable is visible) there
are the following categories of user variable:
•Local user variables (LUD)
Local user variables (LUD) are variables defined in a part program which is not the main
program at the time of execution. They are created when the part program is called and
deleted at the end of the part program or when the NC is reset. Local user variables can
only be accessed within the part program in which they are defined.
•Program-global user variables (PUD)
Program-global user variables (PUD) are user variables defined in a part program used as
the main program. They are created when the part program starts up and deleted at the
end of the part program or when the NC is reset. It is possible to access PUD in the main
program and in all subprograms of the main program.
•Global user variables (GUD)
Global user variables (GUD) are NC- or channel-global variables which are defined in a
data block (SGUD, MGUD, UGUD, GUD4 to GUD9) and are retained following shutdown
and restart. GUD can be accessed in all part programs.
DEF:Command for defining GUD, PUD, LUD user variables
<range>:Range of validity, only relevant for GUD:
NCK:NC-global user variable
CHAN:Channel-global user variable
<type>:Data type:
INT:Integer with sign
REAL:Real number (LONG REAL to IEEE)
BOOL:Truth value TRUE (1)/FALSE (0)
CHAR:ASCII character
STRING[<MaxLength>]:Character string of a defined length
AXIS:Axis/spindle identifier
FRAME:Geometric data for a static coordinate
transformation
See "Data types [Page 55]"
<PP_stop>:Preprocessing stop, only relevant for GUD (optional)
SYNR:Preprocessing stop while reading
SYNW:Preprocessing stop while writing
SYNRW:Preprocessing stop while reading/writing
Job planning
26Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Flexible NC programming
1.1 Variables
<init_time>:Point in time at which the variable is reinitialized (optional)
INIPO:PowerOn
INIRE:End of main program, NC reset or PowerOn
INICF:NewConfig or end of main program, NC reset or
PowerOn
PRLOC:End of main program, NC reset following local
change or PowerOn
See "Attribute: Initialization value [Page 34]"
<phys_unit>:Physical unit (optional)
PHU <unit>:
See "Attribute: Physical unit (PHU) [Page 39]"
<limit values>:Lower and upper limit value (optional)
LLI <limit value>:Lower limit value (lower limit)
ULI <limit value>:Upper limit value (upper limit)
See "Attribute: Limit values (LLI, ULI) [Page 37]"
<access rights>: Access rights for reading/writing GUD via part program or OPI
(optional)
APRP <protection level>: Read: Part program
APWP <protection level>: Write: Part program
APRB <protection level>: Read: OPI
APWB <protection level>: Write: OPI
See "Attribute: Access rights (APR, APW, APRP, APWP, APRB,
APWB) [Page 41]"
<name>: Name of variable
Note
•A maximum of 31 characters
•The first two characters must be a letter and/or an underscore.
•The $ sign is reserved for system variables and must not be
used.
[<value_1>,
<value_2>,
Specification of array sizes for 1- to max. 3-dimensional array
variables (optional)
<value_3>]:
<init_value>:Initialization value (optional)
See "Attribute: Initialization value [Page 34]"
For the initialization of array variables:
See "Definition and initialization of array variables (DEF, SET, REP)
In the context of the definition of global user variables (GUD), the following machine data has
to be taken into account:
No.Identifier: $MN_Significance
11140GUD_AREA_ SAVE_TABAdditional save for GUD blocks
1)
18118
18120
18130
18140
18150
18660
18661
18662
18663
18664
18665
MM_NUM_GUD_MODULESNumber of GUD files in the active file system
1)
MM_NUM_GUD_NAMES_NCKNumber of global GUD names
1)
MM_NUM_GUD_NAMES_CHANNumber of channel-spec. GUD names
1)
MM_NUM_GUD_NAMES_AXISNumber of axis-spec. GUD names
1)
MM_GUD_VALUES_MEMMemory location for global GUD values
1)
MM_NUM_SYNACT_GUD_REALNumber of configurable GUD of the REAL data
type
1)
MM_NUM_SYNACT_GUD_INTNumber of configurable GUD of the INT data
type
1)
MM_NUM_SYNACT_GUD_BOOLNumber of configurable GUD of the BOOL data
type
1)
MM_NUM_SYNACT_GUD_AXISNumber of configurable GUD of the AXIS data
type
1)
MM_NUM_SYNACT_GUD_CHARNumber of configurable GUD of the CHAR data
type
1)
MM_NUM_SYNACT_GUD_STRINGNumber of configurable GUD of the STRING
data type
1)
For SINUMERIK 828D, MD can only be read!
Program-global user variables (PUD)
NOTICE
Visibility of program-local user variables (PUD)
Program-local user variables (PUD) defined in the main program will only be visible in
subprograms if the following machine data is set:
MD11120$MN_LUD_EXTENDED_SCOPE = 1
If MD11120 = 0 the program-local user variables defined in the main program will only be
visible in the main program.
Cross-channel use of an NCK-global user variable of the AXIS data type
An NCK-global user variable of the AXIS data type initialized during definition in the data
block with an axis identifier can then only be used in other NC channels if the axis has the
same channel axis number in these channels.
Job planning
30Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Loading...
+ 914 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.