NCT Group 2000M, 99M manual M98 P.... L, Return from a Sub-program, M99

Models: 2000M 99M

1 206
Download 206 pages 27.56 Kb
Page 74
Image 74

13 Part Program Configuration

main program

 

subprogram

comment

O0010

 

 

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.

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 sub-program means the end of that sub-program, and the program execution returns to the block following the call in the calling program.

74

Page 74
Image 74
NCT Group 2000M, 99M manual M98 P.... L, Return from a Sub-program, M99