Subroutine - Mitsubishi Electric CR750-Q Instruction Manual

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

Advertisement

4MELFA-BASIC V

(4) Subroutine

Subroutine and subprograms can be used.
By using this function, the program can be shared to reduce the No. of steps, and the program can be cre-
ated in a hierarchical structure to make it easy to understand.
*Command word
Command word
GoSub
On GoSub
Return
CallP
FPrm
*Statement example
Statement example
GoSub .......................................................
On GoSub...................................................
ON M1 GoSub *L1, *L2, *L3.......................
Return.........................................................
CallP "10" ...................................................
CallP "20", M1, P1 ......................................
FPrm M10, P10 ..........................................
*Related functions
Interrupt........................................................................................
Communication ............................................................................
Unconditional branching...............................................................
4-116 MELFA-BASIC V functions
Calls the subroutine at the designated step or designated label.
Calls the subroutine according to the designated variable number. The value conditions follow
the integer value order. (1,2,3,4,.......)
Returns to the step following the step called with the GoSub command.
Calls the designated program. The next step in the source program is returned to at the End
statement in the called program. Data can be transferred to the called program as an argument.
An argument is transferred with the program called with the CallP command.
Calls the subroutine from step.
Calls the subroutine from label GET.
If the numeric variable M1 value is 1, calls the subroutine at step *L1, if 2 calls the subroutine at step
*L2, and if 3 calls the subroutine at step *L3. If the value does not correspond, proceeds to next step.
Returns to the step following the step called with the GoSub command.
Calls the No. 10 program.
Transfers the numeric variable M1 and position variable P1 to the No. 20 program, and calls the
program.
Receives the numeric variable transferred with the CallP in M10 of the subprogram, and the position
variable in P10.
Function
Explanation
Explanation
Explanation page
Page 115, "(3) Interrupt"
Page 119, "4.1.5 Communication"
Page 113, "(1) Unconditional branching, conditional branching, waiting"

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents