EasyManuals Logo

Omron SYSMAC CP Series Instruction & Reference Manual

Omron SYSMAC CP Series
467 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 #327 background imageLoading...
Page #327 background image
2-291
2 Instructions
CP1E CPU Unit Instructions Reference Manual(W483)
Subroutines Instructions
2
SBS
Function
SBS(091) calls the subroutine with the
specified subroutine number. The subrou-
tine is the program section between
SBN(092) and RET(093). When the sub-
routine is completed, program execution
continues with the next instruction after
SBS(091).
A subroutine can be called more than
once in a program.
Subroutines can be nested up to 16 lev-
els. Nesting is when another subroutine is
called from within a subroutine program,
such as shown in the following example,
which is nested to 3 levels.
B
SBS
n
A
B
A
SBN
n
RET
END
Main program
Subroutine
program
(SBN(092) to
RET(093))
Program end
Execution condition ON
SBN 10
to
to
to
to
to
SBS 11
RET
SBN 11
SBS 12
RET
RET
SBN 12
D
SBS
n
C
D
A
SBN
n
RET
A
SBS
m
B
SBN
m
RET
END
Main program
Subroutine
program n
Execution condition ON
Execution condition ON
C
B
Subroutine
program m
Program end
Two-level
nesting

Table of Contents

Other manuals for Omron SYSMAC CP Series

Questions and Answers:

Question and Answer IconNeed help?

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

Omron SYSMAC CP Series Specifications

General IconGeneral
BrandOmron
ModelSYSMAC CP Series
CategoryComputer Hardware
LanguageEnglish

Related product manuals