Siemens SINUMERIK 840D sl Programming Manual page 95

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

Advertisement

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)
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
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
Subroutines, Macros
2.4 Call subroutines (L or EXTERN)
2-11

Advertisement

Table of Contents
loading

Table of Contents