343
9.2 Subpr
ogr
a
ms
9.2 Subprograms
Operating sequence
1
The TNC executes the part program up to the block in which a
subprogram is called with CALL LBL.
2
The subprogram is then executed from beginning to end. The
subprogram end is marked LBL 0.
3
The TNC then resumes the part program from the block after the
subprogram call.
Programming notes
n
A main program can contain up to 254 subprograms.
n
You can call subprograms in any sequence and as often as desired.
n
A subprogram cannot call itself.
n
Write subprograms at the end of the main program (behind the block
with M2 or M30).
n
If subprograms are located before the block with M02 or M30, they
will be executed at least once even if they are not called.
Programming a subprogram
U
To mark the beginning, press the LBL SET key and
enter a label number.
U
Enter the subprogram number.
U
To mark the end, press the LBL SET key and enter the
label number “0”.
Calling a subprogram
U
To call a subprogram, press the LBL CALL key.
U
Label number:
Enter the label number of the
subprogram you wish to call.
U
Repeat REP:
Ignore the dialog question with the NO
ENT key. Repeat REP is used only for program section
repeats.
0 BEGIN PGM ...
CALL LBL1
L Z+100 M2
LBL1
LBL0
END PGM ...
CALL LBL 0 is not permitted (label 0 is only used to mark
the end of a subprogram).
Содержание TNC 426
Страница 3: ......
Страница 4: ......
Страница 8: ...IV...
Страница 10: ...VI...
Страница 26: ......
Страница 27: ...1 Introduction...
Страница 41: ...2 Manual Operation and Setup...
Страница 54: ......
Страница 55: ...3 Positioning with Manual Data Input MDI...
Страница 59: ...4 Programming Fundamentals of NC File Management Programming Aids Pallet Management...
Страница 122: ......
Страница 123: ...5 Programming Tools...
Страница 153: ...6 Programming Programming Contours...
Страница 201: ...7 Programming Miscellaneous functions...
Страница 226: ......
Страница 227: ...8 Programming Cycles...
Страница 366: ......
Страница 367: ...9 Programming Subprograms and Program Section Repeats...
Страница 381: ...10 Programming Q Parameters...
Страница 424: ......
Страница 425: ...11 Test run and Program Run...
Страница 443: ...12 MOD Functions...
Страница 472: ......
Страница 473: ...13 Tables and Overviews...
Страница 496: ......