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 #95 background imageLoading...
Page #95 background image
Subroutines, Macros
2.4 Call subroutines (L or EXTERN)
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
2-11
Example: Subroutine call with parameter transfer
N10 DEF REAL LENGTH,WIDTH,DEPTH
N20…
N30 LENGTH=15.3 WIDTH=20.2 DEPTH=5
N40 BORDER(LENGTH,WIDTH,DEPTH)
or
N40 BORDER(15.3,20.2,5)
1%25'(5
1%25'(5/(1*7+:,'7+'(37+
1/(1*7+ :,'7+ '(37+ 
RU
0DLQSURJUDP
Example: subroutine
PROC SUB1 (INT VAR1, DOUBLE VAR2)
IF $P_SUBPAR[1]==TRUE
;Parameter VAR1 was programmed in the subroutine call
ELSE
;Parameter VAR1 was not programmed in the subroutine call
;and initialized by the system with the default value 0
ENDIF
IF $P_SUBPAR[2]==TRUE
;Parameter VAR2 was programmed in the subroutine call
ELSE
;Parameter VAR2 was not programmed in the subroutine call
;programmed and initialized by the system with the default value 0.0
ENDIF
;Parameter 3 is not defined
IF $P_SUBPAR[3]==TRUE -> Alarm 17020
M17

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