Omron SYSMAC C20K Operation Manual page 138

K-type programmable controllers
Hide thumbs Also See for SYSMAC C20K:
Table of Contents

Advertisement

Subroutines
Flags
Caution
!
SBS(91) may be used as many times as desired in the program (i.e., the
same subroutine may be called from different places in the program).
SBS(91) may also be placed into a subroutine to shift program execution
from one subroutine to another, i.e., subroutines may be nested. When the
second subroutine has been completed (i.e., RET(93) has been reached),
the first subroutine is returned to and completed before returning to the main
program. Nesting is possible to up to eight levels. A subroutine cannot call
itself, e.g., SBS(91) 00 cannot be programmed within the subroutine defined
with SBN(92).
The following diagram illustrates program execution flow for various execu-
tion conditions for two SBS(91). In actual execution, the PC actually executes
a sequential program, with the subroutines inserted in at the required loca-
tions.
A
SBS(91)
B
Main
program
SBS(91)
C
SBN(92)
D
RET(93)
SBN(92)
Subroutines
E
RET
END(01)
ER:
A subroutine does not exist for the specified subroutine number.
A subroutine has called itself.
Subroutines have been nested to more than eight levels.
SBS(91) will not be executed and the subroutine will not be called when ER is
ON.
00
OFF execution conditions for 00 and 01
A
01
ON execution condition for 00
A
00
ON execution condition for 01
A
ON execution conditions for 00 and 01
01
A
Section 5-17
B
C
D
B
C
B
E
C
D
B
E
C
127

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac c40kSysmac c60kSysmac c28k

Table of Contents