EasyManuals Logo

Siemens SINUMERIK 840D Programming Manual

Siemens SINUMERIK 840D
687 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #20 background imageLoading...
Page #20 background image
Flexible NC programming
1.2 Variable definition (DEF user-defined variables LUD, GUD, PUD)
Job planning
1-6 Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
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 ;Main program
DEF INT VAR1 ;PUD definition
... ;Subroutine call
SUB2
...
M30
PROC SUB2 ;Subroutine SUB2
DEF INT VAR2 ;LUD DEFINITION
...
IF (VAR1==1) ;Read PUD
VAR1=VAR1+1 ;Read & write PUD
VAR2=1 ;Write LUD
ENDIF ;Subroutine call
SUB3
...
M17
PROC SUB3 ;Subroutine SUB3
...
IF (VAR1==1) ;Read PUD
VAR1=VAR1+1 ;Read & write PUD
VAR2=1 ;Error: LUD from SUB2 not known
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.

Table of Contents

Other manuals for Siemens SINUMERIK 840D

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens SINUMERIK 840D and is the answer not in the manual?

Siemens SINUMERIK 840D Specifications

General IconGeneral
SeriesSINUMERIK 840D
AxesUp to 31
ChannelsUp to 10
Operating SystemWindows-based
Power Supply24 V DC
Control Unit TypeCNC
InterfaceEthernet, PROFIBUS
DisplayTFT color display
InterpolationSpline
PLCIntegrated PLC
Data StorageCompactFlash, USB

Related product manuals