EasyManuals Logo
Home>Omron>Controller>SYSMAC CV Series

Omron SYSMAC CV Series User Manual

Omron SYSMAC CV Series
636 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #392 background imageLoading...
Page #392 background image
(156)
MCRO 010 0200 0300
0000
00
(150)
SBN 010
(152)
RET
Main program
Subroutine
(Subroutine)
(Other instructions)
380
5-30-3 MACRO: MCRO(156)
(156)
MCRO N S D
Ladder Symbol
Variations
↑MCRO(156)
Operand Data Areas
D: First output parameter word CIO, G, A, T, C, DM
S: First input parameter word CIO, G, A, T, C, DM
N: Subroutine number 000 to 999 or 000 to 099
Description MCRO(156) allows a single subroutine to replace several subroutines that have
identical structure but different operands. There are four input words, A200
through A203, and four output words, A204 through A207, allocated to
MCRO(156). These eight words are used in the subroutine and take their con-
tents from S through S+3 and then output their contents to D through D+3 after
the subroutine is executed.
When the execution condition is OFF, MCRO(156) is not executed. When the
execution condition is ON, MCRO(156) copies the contents of S through S+3 to
A200 through A203, and then calls and executes the subroutine specified in N.
When the subroutine is completed, the contents of A204 through A207 are then
transferred back to D through D+3 before MCRO(156) is completed.
Subroutines called by MCRO(156) are defined by SBN(150) and RET(152) just
like normal subroutines. For details concerning the use of subroutines, refer to
the sections in this manual explaining SBN(150), SBS(151), and RET(152).
Precautions Nesting is possible with MCRO(156), but the data must be saved before calling
another subroutine because there is only one processing area (A200 through
A207). Recursive calls are not possible, i.e., a subroutine cannot call itself.
N must be between 000 and 999 for the CV1000, CV2000, CVM1-CPU11-EV2,
or CVM1-CPU21-EV2 or between 000 and 099 for the CV500 or
CVM1-CPU01-EV2.
Note Refer to page 115 for general precautions on operand data areas.
Flags ER (A50003): Subroutine does not exist for the specified subroutine number.
A subroutine has called itself.
An active subroutine has been called.
Example When CIO 000000 is ON in the following example, the contents of CIO 0200
through CIO 0203 are copied to A200 through A203, and subroutine 10 is called
and executed. When the subroutine is completed, the contents of A204 through
A207 are copied back to CIO 0300 through CIO 0303.
Address Instruction Operands
00000 LD 000000
00001 MCRO(156) 010
0200
0300
(Other instructions)
00023 SBN(150) 010
(Subroutine)
00035 RET(152)
(CVM1 V2)
Subroutines Section 5-30

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron SYSMAC CV Series and is the answer not in the manual?

Omron SYSMAC CV Series Specifications

General IconGeneral
BrandOmron
ModelSYSMAC CV Series
CategoryController
LanguageEnglish

Related product manuals