Global sub-routines (Call L <string>)
The call of a global sub-routine is done with
L <string> or L <string>
<string> Name of global sub-routine
Global sub-routines (GUP) are present as independent program units in a separate data file. The call up of a global sub-routine does not take place via the sub-routine name, but via the designation of this data file, which again can consist of local sub-routines and a main program. The specification of a name of global sub-routine (%<Prog_Name>) is only necessary to indicate after the local sub-routines the beginning of the main program (here used as global sub-routine). Thus it can be omitted, in case no local sub-routines are present in the data file.
The calling main program is, likewise, stored as an independent program unit in another data file. Global sub routines can be called form all the main programs.
Programming example
Call of local and global sub-routines
%L LUP (Local sub-routine)
N11 .....
N12 .....
.
.
N19 M17 (M17 can be left out)
%333 (Main program)
N100 .....
N105 .....
N110 LL LUP (Call up of local sub-routines LUP)
.
N200 L GUP_FILE (Call up of global sub-routines via the name of the)
. (data file, in which this GUP is stored)
N300 M30
In the next example, the name of the global sub-routine can be omitted since the call take place via the name of the data file and in this data file no local sub-routines are present.
Programming example
Structure of data file GUP_FILE with global sub-routine:
(globale subroutine GUP)
N10 .....
.....
N90 M17 (Here an M17 or M29 is mandatory)
Survey of program definition and program call:
Main program
Definition: | %PROG_NAME or % PROG_NAME | Program definition is necessary only when local sub-routines are present |
Call: | By operating console by specifying the file name |
|
Global sub-routines
Definition: | Like main program |
Call from NC-program: | LFILE_NAME or L FILE_NAME |
Local sub-routines
Definition: | %L PROG_NAME | Blank between "L" and program definition, since otherwise the definition of a main program will be assumed |
Call from NC-program: | LL PROG_NAME | Blank between "LL" and program-call, since otherwise the call of a global sub-routine will be assumed |
If in a file outside the comments, a character is noticed as the first character that is neither a separating character nor a "%", then this character is evaluated as the first character of an unnamed main program. This also means that in front of "%", no block numbers may be programmed. |