Mitsubishi Electric CR750-Q Instruction Manual page 304

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

Advertisement

4MELFA-BASIC V
Return (Return)
[Function]
(1) When returning from a normal subroutine returns to the next step after the GoSub.
(2) When returning from an interrupt processing subroutine, returns either to the step where the interrupt
was generated, or to the next step.
[Format]
(1) When returning from a normal subroutine:
Return
(2) When returning from an interrupt processing subroutine:
Return <Return Designation No.>
[Terminology]
<Return Designation No.> Designate the step number where control will return to after an interrupt has been
[Reference Program]
(1) The example of Return from the usual subroutine .
1 ' ***MAIN PROGRAM***
2 GoSub *SUB_INIT
3 Mov P1
:
10 ' ***SUB INIT***
11 *SUB_INIT
12 PSTART=P1
13 M100=123
14 Return
(2) The example of Return from the subroutine for interruption processing. Calls the subroutine on step 10
when the input signal of general-purpose input signal number 17 is turned on.
1 Def Act 1,M_In(17)=1 GoSub *SUB1 ' Definition of interrupt of Act 1.
2 Act 1=1
:
10 *SUB1
11 Act 1=0
12 M_Timer(1)=0
13 Mov P2
14 Wait M_In(17)=0
15 Act 1=1
16 Return 0
4-284 Detailed explanation of command words
generated and processed.
0: Return control to the line where the interrupt was generated.
1: Return control to the next line after the line where the interrupt was issued.
' Subroutine jumps to label SUB_INIT.
' Subroutine
' Returns to the step immediately following the step where the subrou-
tine was called from.
' Enable the Act 1.
' The subroutine for interrupt of Act 1.
' Disable the interrupt.
' Set the timer to zero.
' Move to P2.
' Wait until the input signal 17 turns off.
' Set up interrupt again.
' Returns control to the interrupted step.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr750Cr751-qCr751-dCr760-dCr760-qCr750-d

Table of Contents