1
04.00 Flexible NC Programming
1.2 Variable definition
1
840D
NCU 571
840D
NCU 572
NCU 573
FM-NC 810D 840Di
ï›™
Siemens AG 2000. All rights reserved
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA)
−
04.00 Edition
1-25
1.2 Variable definition
User-defined variables
In addition to the predefined variables, programmers
can also define their own variables and assign
values to them.
Local variables (LUD) are only valid in the program
in which they are defined.
Global variables (GUD) apply in all programs.
SW 4.4 and higher:
The local user variables (LUD) defined in the main
program are redefined to program global user
variables (PUD) via machine data.
Machine manufacturer
See machine manufacturer's specifications
If they are defined in the main program, they are also
valid in all levels of the subprograms called. They
are created with part program start and deleted with
part program end or reset.
Example:
$MN_LUD_EXTENDED_SCOPE=1
PROC MAIN ;main program
DEF INT VAR1 ;PUD definition
...
SUB2 ;subprogram call
...
M30
PROC SUB2 ;subprogram call SUB2
DEF INT VAR2 ;LUD DEFINITION
...
IF (VAR1==1) ;read PUD
VAR1=VAR1+1 ;read and write
;PUD
VAR2=1 ;write LUD
ENDIF
SUB3 ;subprogram call
...
M17
PROC SUB3 ;subprogram SUB3
...
12.98