Omron SYSMAC CP Series Instruction & Reference Manual page 332

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Flags
SBN/RET
There are no flags affected by this instruction.
Function
SBN
SBN(092) indicates the beginning of the sub-
routine 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 by SBS(091) .
RET
When program execution reaches RET(093), it is automatically returned to the next instruction after the
SBS(091) instruction that called the subroutine.
Precautions
• Place the subroutine program area (SBN(092) to RET(093)) in the same task as the SBS(091)
instruction of the same number. Subroutines in other tasks cannot be called.
2-296
Not allowed
OK
Task 1
Task
SBS
n
END
Task 2
SBN
n
RET
END
SBS
n
SBN
n
Subroutine
region
RET
SBS
n
SBN
n
RET
END
CP1E CPU Unit Instructions Reference Manual(W483)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents