30.07.2013 Views

User's Manual ISO TNC 360 (260020xx, 280490xx) - heidenhain

User's Manual ISO TNC 360 (260020xx, 280490xx) - heidenhain

User's Manual ISO TNC 360 (260020xx, 280490xx) - heidenhain

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6 Subprograms and Program Section Repeats<br />

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 from 0 to 254. Each label number (except 0) can<br />

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

G98.<br />

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

6.1 Subprograms<br />

Principle<br />

The (main) program is executed up to the block in<br />

which the subprogram is called with Ln,0 ( 1 ).<br />

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

end (G98 L0) ( 2 ).<br />

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

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

Operating limits<br />

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

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 />

N1 % ... *<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

.<br />

1<br />

L1, 0 *<br />

3<br />

Z + 100 M2 *<br />

G98 L1 *<br />

2<br />

G98 L0 *<br />

N9999 % ... *<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!