EasyManuals Logo
Home>Siemens>Control Systems>SINUMERIK ONE MCP 2400.4c

Siemens SINUMERIK ONE MCP 2400.4c Programming Manual

Siemens SINUMERIK ONE MCP 2400.4c
1334 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #498 background imageLoading...
Page #498 background image
Examples
Example 1
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)
Example 2
Various call versions
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
See also
Subprogram call with parameter transfer (EXTERN) (Page 524)
3.2.2.3 Subprogram with call-by-reference parameter transfer (PROC, VAR)
A subprogram with call-by-reference parameter transfer is defined using the PROC keyword
followed by the name of the program and a complete list of all the parameters with the VAR
keyword, type, and name. The definition operation must appear in the first program line. As
parameters, references to arrays can also be transferred.
Call-by-reference
The calling program transfers not the value of a variable to the subprogram on a call-by-
reference parameter transfer, but a reference (pointer) to the variable. This gives the
subprogram direct access to the variable. In this way, not only the value visible in the
subprogram is modified when a parameter value is changed, but also the value of the variables
defined in the calling program. Call-by-reference parameter transfer therefore affects the
calling program, even after the subprogram has ended.
Work preparation
3.2 Subprogram technique
NC programming
498 Programming Manual, 12/2019, 6FC5398-2EP40-0BA0

Table of Contents

Other manuals for Siemens SINUMERIK ONE MCP 2400.4c

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens SINUMERIK ONE MCP 2400.4c and is the answer not in the manual?

Siemens SINUMERIK ONE MCP 2400.4c Specifications

General IconGeneral
BrandSiemens
ModelSINUMERIK ONE MCP 2400.4c
CategoryControl Systems
LanguageEnglish

Related product manuals