Sub Programs
When subprograms used in the system are called, the selected program pauses at the running line and redirects to the first line of the relevant subprogram. Upon encountering the M99 command within the subprogram, the system returns to the line in the main program where it paused and continues execution from there. A group of operations that need to be repeated multiple times can be grouped into a subprogram, such as tool change subprogram, table change subprogram, or tool zeroing subprogram.
The filenames of the subprograms must be in the Oxxxx.cnc format. A numerical value should be written instead of xxxx. For example, the file O9001.cnc defines the subprogram numbered 9001.
Correct Subprogram Filename Examples:
O0001.cnc
O1234.cnc
O9001.cnc
O9009.cnc
Incorrect Subprogram Filename Examples:
0001.cnc
4.cnc
SUB1.cnc
ABC.cnc
The M99 command should be placed at the last line of the subprograms. A maximum of 2 nested subprograms can be called in the system. Macro commands can be used within subprograms. Other commands in the lines directed to the subprogram are not processed and are redirected to the subprogram.
