Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 731

Table of Contents

Advertisement

Flags
SBN/RET
There are no flags affected by this instruction.
Function
SBN
SBN(092) indicates the beginning of the
subroutine with the specified subroutine
number. The end of the subroutine is
indicated by RET(093).
The region of the program beginning at the
first SBN(092) instruction is the subroutine
region. A subroutine is executed only when it
has
been
called
MCRO(099).
RET
When program execution reaches RET(093), it is automatically returned to the next instruction after the
SBS(091) or MCRO(099) instruction that called the subroutine. When the subroutine has been called
by MCRO(099), the output data in A604 through A607 is written to D through D+3 before program
execution is returned.
Precautions
• Place the subroutine program area (SBN(092) to RET(093)) in the same task as the SBS(091) or
MCRO(099) instruction of the same number. Subroutines in other tasks cannot be called.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
by
SBS(091)
or
Not allowed
OK
Task 1
Task
Task 2
3. Instructions
SBS
MCRO
n
n
SBN
n
Subroutine
region
RET
3
695

Advertisement

Table of Contents
loading

Table of Contents