Local subroutines (Call LL <string>) <string>)

A local subroutine is called by

LL <string> (Caution: Blank character between "LL" and <string> … is mandatory).

<string>

Name of local subroutine without quotation marks, maximum 83 characters

Local subroutines (LSUB) together with the main program are located in a common data file which must state all the subroutines before the actual main program.

It should be noted that local subroutines can only be called from the main program in the same data file.

Local subroutines begin with "%L" and a program designation. Between "L" and the program designation, there must be a minimum of one separator.

The end of the subroutine is marked by the functions M17 or M29. A program abort is also possible with M02 or M30. A warning is then issued.

If M17 or M29 is missing, the subroutine is ended by "%” (first character of the following main program of a further subroutine).

Programing Example

prg_example

Local subroutines (Call LL <string>) <string>)

Structure of a data file consisting of the NC main program and local subroutines:

%L UP1           (1st local subroutine)

N1 .....

N2 .....

N9 M17           (M17 can also be left out)

%L UP2           (2nd local subroutine)

N11 .....

N12 .....

N19 M29          (M29 can also be left out)

%MAIN            (Main program)

N100 .....

N105 .....

N200 LL UP1      (Call of 1st LSUB)

.

N250 LL UP2      (Call of 2nd LSUB)

.

N300 M30         (Main program end)

No NC commands are permitted before the definition of a program. This is an exception to the rule that the sequence in the NC block has no significance for program execution (see Section NC block structure).