Siemens SINUMERIK 840D sl Programming Manual page 91

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

Advertisement

Second method of parameter transfer:
• Values are only transferred (call-by-value)
If the parameters transferred are changed as the subroutine runs this does not have any
effect on the main program. The parameters remain unchanged in it (see Fig.).
• Parameter transfer with data exchange (call-by-reference)
Any change to the parameters in the subroutine also causes the parameter to change in the
main program (see Fig.).
Example: variable array lengths
%_N_DRILLING_PLATE_MPF
DEF REAL TABLE[100,2]
EXTERN DRILLING_PATTERN (VAR REAL[,2],INT)
TABLE[0,0]=-17.5
...
TABLE[99.1]=45
DRILLING_PATTERN(TABLE,100)
M30
Job planning
Programming Manual, 03/2006 Edition, 6FC5398-2BP10-1BA0
2.3 Subroutines with parameter transfer (PROC, VAR)
Main program
;Define position table
;Define positions
;Subroutine call
Subroutines, Macros
2-7

Advertisement

Table of Contents
loading

Table of Contents