![](/images/new-backgrounds/1256769/256769147x1.webp)
13 Part Program Configuration
main program |
| subprogram | comment |
O0010 |
|
| execution of |
...... |
|
| program O0010 |
...... |
|
|
|
M98 P0011 | O0011 | calling | |
|
|
| O0011 |
|
| ...... | execution of sub- |
|
| ...... | program O0011 |
|
| ...... |
|
next block | M99 | return to the calling | |
|
|
| program |
...... |
|
| resumption of program |
...... |
|
| O0010 |
The series of instructions
M98 P.... L....
will call the subprogram (specified at address P) repeteatedly in succession specified at address L. The limit of address L is 1 to 9999. Unless L is assigned a value, the
Instruction M98 P11 L6 means that subprogram 011 has to be called six times repeatedly.
It is also possible to call a subprogram from another subprogram. The subprogram calls can be "nested" to max. 4 levels.
main program
O0001
....
....
M98P11
....<
....
M02
subprogram
>O0011
....
....
M98P12
....<
....
M99
subprogram
>O0012
....
....
M98P13
....<
....
M99
subprogram
>O0013
....
....
M98P14
....<
....
M99
subprogram
>O0014
....
....
....
....
....
M99
LNotes:
–An error message 3069 LEVEL EXCESS is returned when the number of subprogram calls "nested" exceeds 4.
–An error message 3071 MISSING OR FAULTY P is returned when the value of address P exceeds 9999 or is not specified.
–An error message 3072 DEFINITION ERROR L is returned when the value of L is incorrect.
–An error message 3073 NOT EXISTING PROGRAM is returned when a program specified with an identifier at address P is not available in the memory.
13.3.2 Return from a Sub-program
The use of instruction
M99
in a
74