Omron CS1G/H-CPUxxH Instructions Manual page 748

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxxH:
Table of Contents

Advertisement

Subroutines
Flags
Precautions
Example
1,2,3...
MCRO(099)
Execution of subrou-
tine between
SBN(092) and
RET(093).
MCRO(099)
MCRO(099) can be used to consolidate two or more subroutines with the
same structure but different input and output addresses into a single subrou-
tine program. When MCRO(099) is executed, the specified input and output
data is transferred to the specified subroutine.
Name
Label
Error Flag
ER
The following table shows relevant words in the Auxiliary Area.
Name
Macro area input
words
Macro area input
words
The four words of input data (words or bits) in A600 to A603 and the four
words of output data (words or bits) in A604 to A607 must be used in the sub-
routine called by MCRO(099). It is not possible to pass more than four words
of data.
It is possible to nest MCRO(099) instructions, but the data in the macro area
input and output words (A600 to A607) must be saved before calling another
subroutine because all MCRO(099) instructions use the same 8 words.
When CIO 000000 is ON in the following example, two MCRO(099) instruc-
tions pass different input and output data to subroutine 1.
1. The first MCRO(099) instruction passes the input data in CIO 0100 to
CIO 0103 and executes the subroutine. When the subroutine is complet-
ed, the output data is stored in CIO 0300 to CIO 0303.
The subroutine uses A600 to
A603 as inputs and A604 to
A607 as outputs.
ON if nesting exceeds 16 levels.
ON if the specified subroutine number doesn't exist.
ON if a subroutine calls itself.
ON if a subroutine being executed is called.
ON if the specified subroutine isn't defined in the current
task.
OFF in all other cases.
Address
A600 to
When MCRO(099) is executed the four words
A603
from S to S+3 are copied to A600 to A603. These
input words are passed to the subroutine.
A604 to
After the subroutine specified in MCRO(099) has
A607
been executed, the output data in these output
words and copied to D to D+3.
Section 3-19
Operation
Operation
727

Advertisement

Table of Contents
loading

Table of Contents