Siemens sinumerik 840d Programming Manual page 102

Hide thumbs Also See for sinumerik 840d:
Table of Contents

Advertisement

Subprograms, Macros
2
2.4 Calling subprograms
840D
840D
NCU 571
NCU 572
NCU 573
Example:
Subprogram
PROC SUB1 (INT VAR1, DOUBLE VAR2)
IF $P_SUBPAR[1]==TRUE
;Parameter VAR1 was not
;in the subprogram call
ELSE
;Parameter VAR1 was not
;programmed in the subprogram call
;and was preset by the system
;with default value 0
ENDIF
IF $P_SUBPAR[2]==TRUE
;Parameter VAR2 was not
;in the subprogram call
ELSE
;Parameter VAR2 was not
;programmed in the subprogram call
;and was preset by the system
;with default value 0.0
ENDIF
;Parameter 3 is not defined
IF $P_SUBPAR[3]==TRUE -> Alarm 17020
M17
Calling the main program as a subprogram
A main program can also be called as subprogram.
The end of program M2 or M30 set in the main
program is evaluated as M17 in this case (end of
program with return to the calling program).
Program the call by specifying the program name.
Example:
N10 MPF739 or
N10 SHAFT3
A subprogram can also be started as a main
program.
2-102
FM-NC
810D
840Di
Main program
N10 MPF739
or
N10SHAFT3
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA) − 04.00 Edition
12.98
2
Additional main
program
N10...
.
.
.
N50 M30
 Siemens AG 2000. All rights reserved

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik fm-ncSinumerik 840diSinumerik 810d

Table of Contents