2 subprograms, Operating sequence, Programming notes – HEIDENHAIN 530 (340 49x-07) ISO programming User Manual

Page 257: Programming a subprogram, Calling a subprogram, 2 subpr ogr a ms 8.2 subprograms

Advertising
background image

HEIDENHAIN iTNC 530

257

8.2 Subpr

ogr

a

ms

8.2 Subprograms

Operating sequence

1

The TNC executes the part program up to the block in which a
subprogram is called with Ln,0

2

The subprogram is then executed from beginning to end. The
subprogram end is marked G98 L0

3

The TNC then resumes the part program from the block after the
subprogram call Ln,0

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

U

Enter the subprogram number. If you want to use a

label name, press the LBL NAME soft key to switch
to text entry

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

Call subprogram /repeat

: Enter the label number of

the subprogram you wish to call. If you want to use a
label name, press the LBL NAME soft key to switch
to text entry If you want to enter the number of a
string parameter as target address: Press the QS soft
key; the TNC will then jump to the label name that is
specified in the string parameter defined.

% ...

L1,0

G00 Z+100 M2

G98 L1 *

G98 L0 *

N99999 % ...

1

2

3

R

S

G98 L 0

is not permitted (Label 0 is only used to mark the

end of a subprogram).

Advertising