Formal And Actual Parameters - Siemens Sinumerik 840D sl Programming Manual

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

Advertisement

1.25.1.5

Formal and actual parameters

Formal and actual parameters occur in conjunction with the definition and calling of
subprograms with parameter transfer.
Formal parameter
When a subprogram is defined, the parameters to be transferred to it (known as the formal
parameters) have to be defined with type and parameter name.
The formal parameters define, therefore, the interface of the subprogram.
Example:
Program code
PROC CONTOUR (REAL X, REAL Y)
N20 X1=X Y1=Y
...
N100 RET
Actual parameters
When a subprogram is called, absolute values or variables (known as actual parameters)
have to be transferred to it.
As such, the actual parameters assign up-to-date values to the interface of the subprogram
when the latter is called.
Example:
Program code
N10 DEF REAL WIDTH
N20 WIDTH=20.0
N30 CONTOUR(5.5, WIDTH)
...
N100 M30
Job planning
Programming Manual, 02/2011, 6FC5398-2BP40-1BA0
Comment
; Formal parameters: X and Y, both REAL type
; Traversing of axis X1 to position X and axis
Y1 to position Y
Comment
; Variable definition
; Variable assignment
; Subprogram call with actual parameters: 5.5
and WIDTH
Flexible NC programming
1.25 Subprogram technique
165

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840de slSinumerik 828d

Table of Contents