31.07.2013 Views

User's Manual TNC 360 (from 259 900-11) - heidenhain

User's Manual TNC 360 (from 259 900-11) - heidenhain

User's Manual TNC 360 (from 259 900-11) - heidenhain

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6 Subprograms and Program Section Repeats<br />

6-2<br />

Subprograms and program section repeats enable you to program a<br />

machining sequence once and then run it as often as you wish.<br />

Labels<br />

Subprograms and program section repeats are marked by labels.<br />

A label carries a number <strong>from</strong> 0 to 254. Each label number (except 0) can<br />

only appear once in a program. Labels are assigned with the command<br />

LABEL SET.<br />

LABEL 0 marks the end of a subprogram.<br />

6.1 Subprograms<br />

Principle<br />

The program is executed up to the block in which<br />

the subprogram is called with CALL LBL ( 1 ).<br />

Then the subprogram is executed <strong>from</strong> beginning to<br />

end (LBL 0) ( 2 ).<br />

Finally, the main program is resumed <strong>from</strong> the<br />

block after the subprogram call ( 3 ).<br />

Operating limits<br />

• One main program can contain to 254 subprograms.<br />

• Subprograms can be called in any sequence and<br />

as often as desired.<br />

• A subprogram cannot call itself.<br />

• Subprograms should be located at the end of the<br />

main program (after the block with M2 or M30).<br />

• If subprograms are located in the program before<br />

the block with M02 or M30, they will be executed<br />

at least once even without being called.<br />

0 BEGIN PGM ...<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

1<br />

CALL LBL 1<br />

3<br />

L Z+100 M2<br />

LBL 1<br />

2<br />

LBL 0<br />

END PGM ...<br />

Fig. 6.1: Flow diagram for a subprogram.<br />

S = jump, R = return jump<br />

R<br />

S<br />

<strong>TNC</strong> <strong>360</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!