EasyManuals Logo
Home>Siemens>Control Unit>SINUMERIK 810D

Siemens SINUMERIK 810D Programming Manual

Siemens SINUMERIK 810D
687 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 #89 background imageLoading...
Page #89 background image
Subroutines, Macros
2.3 Subroutines with parameter transfer (PROC, VAR)
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
2-5
2.3 2.3 Subroutines with parameter transfer (PROC, VAR)
Function
Program start, PROC
A subroutine that is to take over parameters from the calling program when the program runs
is designated with the keyword PROC.
Subroutine end M17, RET
The command M17 designates the end of subroutine and is also an instruction to return to
the calling main program. As an alternative to M17: The keyword RET stands for end of
subroutine without interruption of continuous path mode and without function output to the
PLC.
Programming
The parameters relevant for parameter transfer must be listed at the beginning of the
subroutine with their type and name.
Parameter transfer call-by-value
PROC PROGRAM_NAME(VARIABLE_TYPE1 VARIABLE1,VARIABLE_TYPE2
VARIABLE2,…)
Example:
PROC CONTOUR(REAL LENGTH, REAL WIDTH)
Parameter transfer call-by-reference, identification with keyword VAR
PROC PROGRAM_NAME(VAR VARIABLE_TYPE1 VARIABLE1,VAR VARIABLE_TYPE2
…,)
Example:
PROC CONTOUR(VAR REAL LENGTH, VAR REAL WIDTH)
Array transfer with call-by-reference, identification with keyword VAR
PROC PROGRAM_NAME(VAR VARIABLE_TYPE1 ARRAY_NAME1[array size],
VAR VARIABLE_TYPE2 ARRAY_NAME2[array size],
VAR VARIABLE_TYPE3 ARRAY_NAME3[array size1, array size2],
VAR VARIABLE_TYPE4 ARRAY_NAME4[ ],
VAR VARIABLE_TYPE5 ARRAY_NAME5 [,array size])
Example:
PROC PALLET (VAR INT ARRAY[,10])
Parameters
PROC First instruction in a program
PROGRAM NAME Subroutine name that should accept the relevant values of the
parameters
VARIABLE_TYPE
VARIABLE
Variable types with specification of the variable values.
Several values can be specified.
VAR Keyword for the type of the parameter transfer
FIELDNAME Elements of an array with the listed values for the field
array
Array size1 For a one-dimensional array
Array size2 For a two-dimensional array

Table of Contents

Other manuals for Siemens SINUMERIK 810D

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens SINUMERIK 810D and is the answer not in the manual?

Siemens SINUMERIK 810D Specifications

General IconGeneral
BrandSiemens
ModelSINUMERIK 810D
CategoryControl Unit
LanguageEnglish

Related product manuals