Mitsubishi Electric CR750-Q Instruction Manual page 197

Cr750/cr751/cr760 series
Hide thumbs Also See for CR750-Q:
Table of Contents

Advertisement

[Explanation]
(1) A program (sub program) called by the CallP instruction will return to the parent program (main pro-
gram) when the End instruction (equivalent to the Return instruction of GoSub) is reached. If there is no
End instruction, the execution is returned to the main program when the final step of the sub program is
reached.
(2) If arguments need to be passed to the sub program, they should be defined using the FPrm instruction
at the beginning of the sub program.
(3) If the type or the number of arguments passed to the sub program is different from those defined (by the
FPrm instruction) in the sub program, an error occurs at execution.
(4) If a program is reset, the control returns to the beginning of the top main program.
(5) Definition statements (Def Act, Def FN, Def Plt, and Dim instructions) executed in the main program are
invalid in a program called by the CallP instruction. They become valid when the control is returned to
the main program from the program called by the CallP instruction again.
(6) Tool data is valid in a sub program. Values of Accel, Spd, Ovrd, and JOvrd are invalid. The mode of Oadl
is valid.
(7) Another sub program can be executed by calling CallP in a sub program. However, a main program or a
program that is currently being executed in another task slot cannot be called. In addition, own program
cannot be called, either.
(8) Eight levels (in a hierarchy) of sub programs can be executed by calling CallP in the first main program.
(9) Variable values may be passed from a main program to a sub program using arguments, however, it is
not possible to pass the processing result of a sub program to a main program by assigning it in an argu-
ment. To use the processing result of a sub program in a main program, pass the values using external
variables.
[Related instructions]
FPrm (FPRM)
Detailed explanation of command words 4-177
4MELFA-BASIC V

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents