Call-By-Value Parameters; Default Parameter Initialization - Siemens Sinumerik 840D sl Programming Manual

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

Advertisement

Motion synchronous actions
10.5 Technology cycles
10.5.2

Call-by-value parameters

Function
Technology cycles can be defined using call-by-value parameters. Simple data types such as
INT, REAL, CHAR, STRING, AXIS and BOOL can be used as parameters.
Note
Formal parameters that are transferred as call-by-value cannot be arrays.
Actual parameters can also comprise default parameters (see "Default parameter
initialization [Page 640]").
Syntax
ID=1 WHEN $AA_IW[X]>50 DO TEC(IVAL,RVAL,,SVAL,AVAL)
A default value is transferred for non-initialized actual parameters:
ID=1 WHEN $AA_IW[X]>50 DO TEC(IVAL,RVAL,,SYG_SS[0],AVAL)
10.5.3

Default parameter initialization

Function
Default parameters can also be provided with an initial value in the PROC instructions.
Syntax
Assign default parameters in the technology cycle:
PROC TEC (INT IVAL=1, REAL RVAL=1.0, CHAR CVAL='A', STRING[10]
SVAL="ABC", AXIS AVAL=X, BOOL BVAL=TRUE)
If a current parameter consists of a default parameter, the initial value is transferred from the
PROC instruction. This applies both in the part program and in synchronized actions.
Example
Program code
TEC (IVAL, RVAL, SVAL, AVAL)
640
Comments
;
For CVAL and BVAL, the initial value applies
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