Siemens sinumerik 802d sl Operation And Programming Manual page 184

Hide thumbs Also See for sinumerik 802d sl:
Table of Contents

Advertisement

Programming
8.9
Subroutine technique
Fig. 8-35
Subroutine name
The subprogram is given a unique name allowing it to be selected from several subroutines.
When you create the program, the program name may be freely selected provided the follo-
wing conventions are observed:
The same rules apply as for the names of main programs.
Example: LRAHMEN7
It is also possible to use the address word L... in subroutines. The value can have 7 decimal
places (integers only).
Please observe: With address L, leading zeros are meaningful for differentiation.
Example: L128 is not L0128 or L00128 !
These are 3 different subroutines.
Subroutine call
Subroutines are called in a program (main or subprogram) with their names. To do this, a
separate block is required.
Example:
N10 L785
N20 LRAHMEN7 ; Call of subroutine LRAHMEN7
Program repetition P...
If a subroutine is to be executed several times in succession, write the number of times it is
to be executed in the block of the call after the subroutine name under the address P. A ma-
ximum of 9,999 cycles are possible (P1 ... P9999).
8-184
Sequence
Main program
MAIN123
...
...
N20
L10 ; Call
N21 ...
Return
...
...
...
...
N80 L10 ; Call
...
Return
...
...
M2
Example of sequence when calling a subroutine twice
SINUMERIK 802D sl Operation and Programming Nibbling (BP-N), 06/2006 Edition
Subroutine
L10
N10 R1=34 ...
N20 X...Y...
...
...
M2
; Call of subroutine L785
6FC5 398-3CP10-0BA0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents