Subprogram With Call-By-Reference Parameter Transfer (Proc, Var) - Siemens SINUMERIK 840D sl Programming Manual

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

Advertisement

<par_n>
<init_value>
Example
Definition of a subprogram SUB_PROG with three parameters of type REAL with default
values:
Program code
PROC SUB_PROG(REAL LENGTH=10.0, REAL WIDTH=20.0, REAL HIGHT=30.0)
...
N100 RET
Different call variants:
Program code
PROC MAIN_PROG
REAL PAR_1 = 100
REAL PAR_2 = 200
REAL PAR_3 = 300
; Call variants
SUB_PROG
SUB_PROG(PAR_1, PAR_2, PAR_3)
SUB_PROG(PAR_1)
SUB_PROG(PAR_1, , PAR_3)
SUB_PROG( , , PAR_3)
N100 RET
1.24.2.3

Subprogram with call-by-reference parameter transfer (PROC, VAR)

Function
A subprogram with call-by-reference parameter transfer is defined using the
followed by the name of the program and a complete list of all the parameters expected by
the subprogram, with the
in the first program line.
With call-by-reference parameter transfer, references to arrays can also be transferred.
Call-by-reference parameter transfer affects the calling program. The calling program
transfers a reference to the actual parameter to the subprogram, thereby providing the
subprogram with direct access to the corresponding variable.
Job Planning
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
:
Name of the parameter
:
Optional value for the initialization of the parameter
If no parameter is specified when calling the subprogram, the
parameter is assigned the initialization value.
keyword, type and name. The definition operation must appear
VAR
Flexible NC programming
1.24 Subprogram technique
keyword
PROC
163

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents