Definition Of User Variables (Def) - Siemens SINUMERIK 840D sl Programming Manual

Job planning
Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

Flexible NC programming
1.1 Variables
1.1.4

Definition of user variables (DEF)

Function
The
them apart from system variables, these are called user-defined variables or user variables
(user data).
According to the 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)
● Program-global user variables (PUD)
● Global user variables (GUD)
User variables must be defined before they can be used (read/write). The following rules
must be observed in this context:
● GUD have to be defined in a definition file, e.g. _N_DEF_DIR/_M_SGUD_DEF.
● PUD and LUD have to be defined in a definition section of the part program.
● The data must be defined in a dedicated block.
● Only one data type may be used for each data definition.
● Several variables of the same data type can be defined for each data definition.
Syntax
LUD and PUD
DEF <type> <phys_unit> <limit values> <name>[<value_1>, <value_2>,
<value_3>]=<init_value>
GUD
DEF <range> <pp_stop> <access_rights> <type> <phys_unit> <limit
values> <name>[<value_1>, <value_2>, <value_3>]=<init_value>
24
command is used to define user-specific variables and assign values to them. To set
DEF
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) 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) 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.
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Job Planning

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents