Parameter Transfer - Siemens Sinumerik 840D sl Programming Manual

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

Advertisement

Flexible NC programming
1.25 Subprogram technique
1.25.1.6

Parameter transfer

Definition of a subprogram with parameter transfer
A subprogram with parameter transfer is defined using the PROC keyword and a complete list
of all the parameters expected by the subprogram.
Incomplete parameter transfer
When the subprogram is called, not all the parameters defined in the subprogram interface
have to be transferred explicitly. If a parameter is omitted, the default value "0" is transferred
for it.
So that the parameter sequence can be uniquely identified, however, the commas used as
parameter separators always have to be included. The last parameter is an exception. If it is
omitted from the call, the last comma can also be left out.
Example:
Subprogram:
Program code
PROC SUB_PROG (REAL X, REAL Y, REAL Z)
...
N100 RET
Main program:
Program code
PROC MAIN_PROG
...
N30 SUB_PROG(1.0,2.0,3.0)
...
N100 M30
Examples for the subprogram call in N30 with incomplete parameter transfer:
N30 SUB_PROG( ,2.0,3.0)
N30 SUB_PROG(1.0, ,3.0)
N30 SUB_PROG(1.0,2.0)
N30 SUB_PROG( , ,3.0)
N30 SUB_PROG( , , )
166
Comment
;
Formal parameters: X, Y, and Z
Comment
; Subprogram call with complete parameter transfer:
X=1.0, Y=2.0, Z=3.0
; X=0.0, Y=2.0, Z=3.0
; X=1.0, Y=0.0, Z=3.0
; X=1.0, Y=2.0, Z=0.0
; X=0.0, Y=0.0, Z=3.0
; X=0.0, Y=0.0, Z=0.0
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Job planning

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de slSinumerik 828d

Table of Contents