Siemens sinumerik 840d Programming Manual page 100

Hide thumbs Also See for sinumerik 840d:
Table of Contents

Advertisement

Subprograms, Macros
2
2.4 Calling subprograms
840D
840D
NCU 571
NCU 572
NCU 573
Subprogram call with parameter transfer
In the main program you call the subprogram by
specifying the program name and parameter
transfer. When transferring parameters you can
transfer variables or values directly (not for VAR
parameters).
Example:
N10 DEF REAL LENGTH,WIDTH,DEPTH
N20 ...
N30 LENGTH=15.3 WIDTH=20.2 DEPTH=5
N40 BORDER(LENGTH,WIDTH,DEPTH)
or
N40 BORDER(15.3,20.2,5)
Subprogram definition must match subprogram
call
Both the variable types and the sequence of transfer
must match the definitions declared under PROC in
the subprogram name. The parameter names can
be different in the main program and subprograms.
Example:
Definition in the subprogram:
PROC BORDER(REAL LENGTH, REAL WIDTH, REAL DEPTH)
Call in the main program:
N30 BORDER(LENGTH, WIDTH, DEPTH)
2-100
FM-NC
810D
840Di
Main program
N30 LENGTH=15.3 WIDTH=20.2 DEPTH=5
N40 BORDER(LENGTH,WIDTH;DEPTH)
or
N40BORDER(15.3,20.2,5)
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA) − 04.00 Edition
12.98
2
 Siemens AG 2000. All rights reserved

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik fm-ncSinumerik 840diSinumerik 810d

Table of Contents