Selecting an NC program and calling it with SEL PGM and CALL SELECTED PGM
Application
The function SEL PGM allows selecting another separate NC program that you can call at a different position in the active NC program. The control executes the selected NC program at the position where you call it in the calling NC program using CALL SELECTED PGM.
Related topics
- Calling the NC program directly
Description of function
The control executes the NC program as follows:
- The control executes the NC program until another NC program is called with CALL PGM. When the control reads SEL PGM, it remembers the defined NC program.
- When the control reads CALL SELECTED PGM, it calls the NC program previously selected at this point.
- After that, the control executes the called NC program up to the last NC block.
- Then the control continues executing the calling NC program with the next NC block after CALL SELECTED 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 SEL PGM "reset.h" | ; Select an NC program for calling |
* - ... | |
21 CALL SELECTED PGM | ; Call the selected NC program |
SEL PGM
To navigate to this function:
Insert NC function All functions Selection SEL PGM
The NC function includes the following syntax elements:
Syntax element | Meaning |
---|---|
SEL PGM | Syntax initiator for selecting an NC program to be called |
Name or Parameter | Path of the NC program to be called Fixed or variable path Selection by means of a selection window |
CALL SELECTED PGM
To navigate to this function:
Insert NC function All functions Selection CALL SELECTED PGM
The NC function includes the following syntax elements:
Syntax element | Meaning |
---|---|
CALL SELECTED PGM | Syntax for calling the selected NC program |
Notes
- Within the SEL PGM NC function, the NC program can also be selected with QS parameters so that the program call can be variably controlled.
- If an NC program called by CALL SELECTED PGM is missing, the control interrupts the execution or simulation of the program with an error message. In order to avoid undesired interruptions during the program run, you can use the FN 18: SYSREAD (ID10 NR110 and NR111) NC function to check all paths at program start.
- 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.
- 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.