Calling Subprograms - Siemens sinumerik 840d Programming Manual

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

Advertisement

12.98
2
840D
840D
NCU 572
NCU 571
NCU 573
2.4

Calling subprograms

Subprogram call without parameter transfer
In the main program you call the subprogram either
with address L and the subprogram number or by
specifying the program name.
Example:
N10 L47 or
N10 SPIGOT_2
Subprogram with parameter transfer,
declaration with EXTERN
Subprograms with parameter transfer must be listed
with EXTERN in the main program before they are
called, e.g. at the beginning of the program.
The name of the subprogram and the variable types
are declared in the sequence in which they are
transferred.
You only have to specify EXTERN if the subprogram
is in the workpiece or in the global subprogram
directory.
You do not have to declare cycles as EXTERN.
EXTERN statement
EXTERN NAME(TYP1, TYP2, TYP3, ...) oder
EXTERN NAME(VAR TYP1, VAR TYP2, ...)
Example:
N10 EXTERN BORDER(REAL, REAL, REAL)
...
N40 BORDER(15.3,20.2,5)
N10 Declaration of the subprogram, N40
Subprogram call with parameter transfer.
 Siemens AG 2000. All rights reserved
SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced (PGA) − 04.00 Edition
FM-NC
810D
840Di
Subprograms, Macros

2.4 Calling subprograms

Main program
N10 L47
or
N10 journal_2
Main program
N10 EXTERN
BORDER(REAL,REAL,REAL)
.
.
N40 BORDER(15.3,20.2,5)
2
Subprogram
2-99

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik fm-ncSinumerik 840diSinumerik 810d

Table of Contents