Subroutine techniques

Identical motion sequences and function flows that are repeated several times can be implemented as subroutines. There are two types of subroutines:

  1. Local subroutines
  2. Global subroutines or cycles

Several subroutines (local or global) nested in one another can be called. The number of subroutines used and the nesting depth are fixed [6]-24.

Variables are transferred from the main program to the subroutine indirectly using P parameters or directly in cycles by calling specific transfer parameters (@P...).

Overview of program definition and program call:

Main program

Definition:

%PROG_NAME or % PROG_NAME

The main program definition is only required when there are local subroutines.

Call:

From the operating console by specifying the complete file name (including file extension)

 

Local subroutine

Definition:

%L UP_NAME

Separator between "L" and program definition, otherwise it is assumed that a main program is defined

Call in NC program:

LL UP_NAME

Separator between "LL" and program call, otherwise it is assumed that a global subroutine is called

Global subroutine

Definition:

%PROG_NAME or % PROG_NAME

A subroutine definition is only required if there are local subroutines

Call in NC program:

L FILE_NAME

Specify the complete file name (including file extension). Separator between “L” and program call

Notice

notice

If the first character that is neither a separator nor a "%” is found in the file outside the comments, this character is evaluated as the first character of an unnamed main program. It also means that no block numbers may be programmed in front of "%".