![HEIDENHAIN TNC 426 B User Manual Download Page 255](http://html.mh-extra.com/html/heidenhain/tnc-426-b/tnc-426-b_user-manual_2118720255.webp)
9 Programming: Subprograms and Program Section Repeats
240
9.1 Mar
king Subpr
ogr
ams and Pr
ogr
am Section Repeats
9.2 Subprograms
9.1 Marking Subprograms and
Program Section Repeats
Subprograms and program section repeats enable you to program a
machining sequence once and then run it as often as desired.
Labels
The beginnings of subprograms and program section repeats are
marked in a part program by labels.
A label is identified by a number between 1 and 254. Each label can
be set only once with LABEL SET in a program.
If a label is set more than once, the TNC sends an error
message at the end of the LBL SET block. With very long
programs, you can limit the number of blocks to be
checked for repeated labels with MP7229.
LABEL 0 (LBL 0) is used exclusively to mark the end of a
subprogram and can therefore be used as often as desired.
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 with LBL 0.
3
The TNC then resumes the part program from the block after the
subprogram call.
Programming notes
■
A main program can contain up to 254 subprograms.
■
You can call subprograms in any sequence and as often as
desired.
■
A subprogram cannot call itself.
■
Write subprograms at the end of the main program (behind the
block with M2 or M30).
■
If subprograms are located before the block with M02 or M30,
they will be executed at least once even if they are not called.
0 BEGIN PGM ...
CALL LBL1
L Z+100 M2
LBL1
LBL0
END PGM ...
LKAP9.PM6
30.06.2006, 07:04
240
www.EngineeringBooksPdf.com
Summary of Contents for TNC 426 B
Page 3: ...BAUSKLA PM6 30 06 2006 07 03 2 www EngineeringBooksPdf com ...
Page 4: ...BAUSKLA PM6 30 06 2006 07 03 3 www EngineeringBooksPdf com ...
Page 6: ...CINHALT PM6 30 06 2006 07 03 2 www EngineeringBooksPdf com ...
Page 16: ...CINHALT PM6 30 06 2006 07 03 12 www EngineeringBooksPdf com ...
Page 17: ...Introduction 1 Dkap1 pm6 30 06 2006 07 03 1 www EngineeringBooksPdf com ...
Page 29: ...Manual Operation and Setup 2 Dkap2_3 pm6 30 06 2006 07 03 13 www EngineeringBooksPdf com ...
Page 83: ...Programming Tools 5 Fkap5 pm6 30 06 2006 07 03 67 www EngineeringBooksPdf com ...
Page 106: ...Fkap5 pm6 30 06 2006 07 03 90 www EngineeringBooksPdf com ...
Page 107: ...Programming Programming Contours 6 Gkap6 pm6 30 06 2006 07 04 91 www EngineeringBooksPdf com ...
Page 165: ...Hkap7 pm6 30 06 2006 07 03 150 www EngineeringBooksPdf com ...
Page 166: ...Programming Cycles 8 kkap8 pm6 30 06 2006 07 03 151 www EngineeringBooksPdf com ...
Page 253: ...kkap8 pm6 30 06 2006 07 04 238 www EngineeringBooksPdf com ...
Page 265: ...LKAP9 PM6 30 06 2006 07 04 250 www EngineeringBooksPdf com ...
Page 266: ...Programming Q Parameters 10 MKAP10 PM6 30 06 2006 07 04 251 www EngineeringBooksPdf com ...
Page 297: ...MKAP10 PM6 30 06 2006 07 04 282 www EngineeringBooksPdf com ...
Page 298: ...Test Run and Program Run 11 NKAP11 PM6 30 06 2006 07 04 283 www EngineeringBooksPdf com ...
Page 312: ...MOD Functions 12 Okap12 pm6 30 06 2006 07 04 297 www EngineeringBooksPdf com ...
Page 332: ...Tables and Overviews 13 Pkap13 pm6 30 06 2006 07 04 317 www EngineeringBooksPdf com ...