Siemens SINUMERIK 840D sl Programming Manual page 20

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

Advertisement

Flexible NC programming
1.2 Variable definition (DEF user-defined variables LUD, GUD, PUD)
Example: Redefine local (LUD) and program-global user variables (PUD)
If they are defined in the main program, they will also be valid at all levels of the subroutines
called. They are created with parts program start and deleted with parts program end or
reset.
If machine data $MN_LUD_EXTENDED_SCOPE is set, it is not possible to define a variable
with the same name in the main and subroutines.
$MN_LUD_EXTENDED_SCOPE=1
PROC MAIN
DEF INT VAR1
...
SUB2
...
M30
PROC SUB2
DEF INT VAR2
...
IF (VAR1==1)
VAR1=VAR1+1
VAR2=1
ENDIF
SUB3
...
M17
PROC SUB3
...
IF (VAR1==1)
VAR1=VAR1+1
VAR2=1
ENDIF
...
M17
Variable names
A variable name consists of up to 31 characters. The first two characters must be a letter or
an underscore.
The "$" sign can not be used for user-defined variables because it is used for system
variables.
1-6
;Main program
;PUD definition
;Subroutine call
;Subroutine SUB2
;LUD DEFINITION
;Read PUD
;Read & write PUD
;Write LUD
;Subroutine call
;Subroutine SUB3
;Read PUD
;Read & write PUD
;Error: LUD from SUB2 not known
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Job planning

Advertisement

Table of Contents
loading

Table of Contents