Mitsubishi Electric CR750-Q Instruction Manual page 196

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

Advertisement

4MELFA-BASIC V
CallP (Call P)
[Function]
This instruction executes the specified program (by calling the program in a manner similar to using GoSub
to call a subroutine). The execution returns to the main program when the End instruction or the final step in
the sub program is reached.
[Format]
CallP[] "<Program name> " [, <Argument> [, <Argument>
[Terminology]
<Program name>
<Argument>
[Reference Program]
(1) When passing the argument to the program to call.
Main program
1 M1=0
2 CallP "10" ,M1,P1,P2
3 M1=1
4 CallP "10" ,M1,P1,P2
:
10 CallP "10", M2,P3,P4
:
15 End
Sub program side
1 FPrm M01, P01,P02
2 If M01<>0 Then GoTo *LBL1
3 Mov P01
4 *LBL1
5 Mvs P02
6 End
* When step 2 and 4 of the main program are executed, M1, P1 and P2 are set in M01, P01 and P02 of
the sub program, respectively. When step 10 of the main program is executed, M2, P3 and P4 are set in
M01, P01 and P02 of the sub program, respectively.
(2) When not passing the argument to the program to call.
Main program
1 Mov P1
2 CallP "20"
3 Mov P2
4 CallP "20"
5 End
"200" sub program side
201 Mov P1
202 Mvs P002
203 M_Out(17)=1
204 End
4-176 Detailed explanation of command words
Designate the program name with a character string constant or character string variable.
For the standards for program names, please refer to
Designate the variable to be transferred to the program when the program is called. Up
to 16 variables can be transferred.
'Return to the main program at this point.
'P1 of the sub program differs from P1 of the main program.
'Return to the main program at this point.
Page 133, "(1) Program
name".

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents