13. Program Support Functions
13.3 Subprogram Control
291
Example of program 2
The G22 H_ ; G23 H_ ; commands designate the sequence Nos. in a program with a call
instruction.
G22H3;
N3___;
G23;
G22H__ ;
N100___;
G22L123;
N200_;
N300___;
N400___;
L123;
G23H200;
G23H__ ;
Search
Precautions
(1) Program error (P232) results when the designated L (program No.) is not located.
(2) Single block stop does not occur with the G22 L _ ; G23 ; block. If any address except L(O), N,
P, L or H is used, single block stop can be executed. (With X100. G22 L100 ;, operation
branches to L100 after X100. is executed.)
(3) When G23 is commanded by the main program, operation returns to the head. (This is same
for MDI.)
(4) Branching from tape and BTR operation to the subprogram with G22 L _ is possible, but the
return destination sequence No. cannot be designated with G23H_ ;. (H_ is ignored).
(5) Bear in mind that the search operation will take time when the sequence No. is designated by
G23H_ ;.
(6) When using a file name for the subprogram, specify the file name with 32 characters or less,
including the extension. If a file name exceeding 32 characters is specified, a program error
(P232) will occur.
(7) All the programs are registered as files. For example, when calling the file "0100" as a
subprogram, "0100" cannot be searched with G22L100 or G22L0100. When a value is
specified following L, reading 0 is omitted; therefore, it is assumed that the program No. (file)
"100" was specified in this case. When wishing the program like
″
0100
″
to be called, specify
the file name using the G22<0100> format.
13.3.2 Figure Rotation; G22 I_ J_ K_
Function and purpose
If the same pattern is used repeatedly on a concentric circle, one of the rotating machining patterns
can be registered as a subprogram. When the subprogram is called from the main program, if the
rotation center is designated, a path similar to the rotary phase can be easily created on the
concentric circle. This simplifies creation of the program.