Omron C200HX Operation Manual page 306

Hide thumbs Also See for C200HX:
Table of Contents

Advertisement

Subroutines and Interrupt Control
Precautions
Flags
288
In the following example, the contents of DM 0010 through DM 0013 are copied
to SR 290 through SR 293, the contents of DM 0020 through DM 0023 are co-
pied to SR 294 through SR 297, and subroutine 010 is called and executed.
When the subroutine is completed, the contents of SR 294 through SR 297 are
copied back to DM 0020 to DM 0023.
Note
1. Subroutines for macros are programmed just like other subroutines, except
that SR 290 to SR 297 contents are transferred in from the designated input
and output words.
2. Not only external I/O words, but internal I/O words can be used for I1 and O1.
3. SR 290 to SR 297 can be used as work bits when not used for macro pro-
grams.
4. MCRO(99) instructions can be nested, but be sure to preserve I/O data
since the instructions use the same 8 I/O words (SR 290 to SR 297).
MCRO(99) can be used only for program sections that can be written using four
or fewer consecutive input words and/or four or fewer consecutive output words.
It is thus generally necessary to consider system and program design together
to take full advantage of macro programming.
Be careful that the input and output words properly correspond to the macro in-
put and output words.
ER:
A subroutine does not exist for the specified subroutine number.
An operand has exceeded a data area boundary.
Indirectly addressed DM word is non-existent. (Content of DM word is
not BCD, or the DM area boundary has been exceeded.)
A subroutine has called itself.
An active subroutine has been called.
Main program
MCRO(99)
010
DM 0010
DM 0020
Main program
SBN(92)
010
Subroutine
RET(93)
END(01)
Section 5-23

Advertisement

Table of Contents
loading

This manual is also suitable for:

C200hgC200he

Table of Contents