Calling an NC program with CALL PGM
Application
With the CALL PGM NC function, you can call another, separate NC program from within an NC program. The control executes the called NC program at the point where you called it in the NC program. This allows a machining operation to be executed with various transformations, for example.
Related topics
- Program call with Cycle 12 PGM CALL
- Program call following selection
Selecting an NC program and calling it with SEL PGM and CALL SELECTED PGM
- Executing multiple NC programs as a job list
Description of function
The control executes the NC program as follows:
- The control executes the calling NC program until you call another NC program with CALL PGM.
- After that, the control executes the called NC program up to the last NC block.
- The control then resumes the calling NC program, starting with the next NC block after CALL PGM.
The following conditions apply to program calls:
- The called NC program must not contain a CALL PGM call into the calling NC program. This creates an endless loop.
- The called NC program must not contain the miscellaneous function M30 or M2. If you defined subprograms in the called NC program using labels, then you can replace M30 or M2 with an unconditional jump function. This keeps the control from executing a subprogram.
If the called NC program contains the miscellaneous functions, the control generates an error message.
- The called NC program must be complete. If the NC block END PGM is missing, the control outputs an error message.
Input
NC programs contained in this User's Manual are suggestions for solutions. The NC programs or individual NC blocks must be adapted before being used on a machine.
Change the following contents as needed:
- Tools
- Cutting parameters
- Feed rates
- Clearance height or safe position
- Machine-specific positions (e.g., with M91)
- Paths of program calls
Some NC programs depend on the machine kinematics. Adapt these NC programs to your machine kinematics before the first test run.
In addition, test the NC programs using the simulation before the actual program run.
With a program test you determine whether the NC program can be used with the available software options, the active machine kinematics and the current machine configuration.
11 CALL PGM reset.h | ; Call NC program |
To navigate to this function:
Insert NC function All functions Selection CALL PGM
The NC function includes the following syntax elements:
Syntax element | Meaning |
---|---|
CALL PGM | Syntax initiator for calling an NC program |
File | Path of the called NC program Selection by means of a selection window |
Notes
- Reset used coordinate transformations in the same NC program
- Check the machining sequence using a graphic simulation if required
- The program call path including the name of the NC program may contain no more than 255 characters.
- If the called file is located in the same directory as the file you are calling it from, you can also enter just the file name without the path. If you select the file using the selection menu, the control automatically proceeds in this manner.
- If you want to program variable program calls in conjunction with string parameters, use the SEL PGM NC function.
Selecting an NC program and calling it with SEL PGM and CALL SELECTED PGM
- As a rule, variables are globally effective when called, such as with CALL PGM. Please note that changes to variables in the called NC program can also take effect on the calling NC program. If applicable, use QL or named parameters that take effect only in the active NC program.
- While the control is executing the calling NC program, editing of all called NC programs is disabled.