EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 707

Omron CP - PROGRAMMING MANUAL 05-2007
1175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
674
Subroutines Section 3-18
Example 3: Nested Subroutines
When CIO 0.00 is ON in the following example, subroutine 1 is executed. If
CIO 0.01 is ON, subroutine 2 is executed from within subroutine 1 and pro-
gram execution returns to the next instruction after SBS(091) 2 when subrou-
tine 2 is completed. Execution of subroutine 1 continues and program
execution returns to the next instruction after SBS(091) 1 when subroutine 1
is completed.
3-18-2 MACRO: MCRO(099)
Purpose Calls the subroutine with the specified subroutine number and executes that
program using the input parameters in S to S+3 and the output parameters in
D to D+3.
Ladder Symbol
1
5
2
4
3
CIO 0.00 ON
CIO 0.01 ON
1
2
2
1
AS1-1S2S1-2B
AS1-1S1-2B
AB
AB
0.00
0.00
0.01
0.01
Subroutine 1
Subroutine 2
Order of execution
MCRO(099)
N
S
D
N: Subroutine number
S: First input parameter word
D: First output parameter word

Table of Contents

Related product manuals