NCT Group 99M Microscope & Magnifier User Manual


 
13 Part Program Configuration
74
main program
O0010
......
......
subprogram comment
execution of (main-)
program O0010
M98 P0011 –––> O0011 calling sub-program
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 sub-program will be called
once, i.e., the control will assume L=1.
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.
L Notes:
– 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 sub-program means the end of that sub-program, and the program execution returns to the
block following the call in the calling program.
main program
subprogram subprogram subprogram subprogram
O0001 >O0011 >O0012 >O0013 >O0014
.... .... .... .... ....
....
.... .... .... ....
M98P11
M98P12 M98P13 M98P14 ....
....<
....< ....< ....< ....
.... .... .... .... ....
M02 M99 M99 M99 M99