![background image](http://html1.mh-extra.com/html/omron/sysmac-c200h/sysmac-c200h_operation-manual_742423202.webp)
189
5-20-3
SUBROUTINE ENTER – SBS(91)
N: Subroutine number
# (00 to 99)
Ladder Symbol
Definer Data Areas
SBS(91) N
Description
A subroutine can be executed by placing SBS(91) in the main program at the
point where the subroutine is desired. The subroutine number used in
SBS(91) indicates the desired subroutine. When SBS(91) is executed (i.e.,
when the execution condition for it is ON), the instructions between the
SBN(92) with the same subroutine number and the first RET(93) after it are
executed before execution returns to the instruction following the SBS(91)
that made the call.
SBS(91)
00
SBN(92)
00
RET(93)
END(01)
Main program
Subroutine
Main program
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),
program execution returns to the original subroutine which is then completed
before returning to the main program. Nesting is possible to up to sixteen
levels. A subroutine cannot call itself (e.g., SBS(91) 00 cannot be pro-
grammed within the subroutine defined with SBN(92) 00). The following dia-
gram illustrates two levels of nesting.
SBN(92) 10
SBN(92) 11
SBN(92) 12
SBS(91) 11
RET(93)
SBS(91) 10
SBS(91) 12
RET(93)
RET(93)
Subroutines and Interrupt Control
Section 5-20
Содержание SYSMAC C200H
Страница 1: ...OPERATION MANUAL C200H CPU01 E 03 E 11 E SYSMAC Programmable Controllers Cat No W130 E1 05 ...
Страница 2: ...C200H Programmable Controllers CPU01 E 03 E 11 E Operation Manual Revised June 2003 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 8: ...TABLE OF CONTENTS ix Glossary 345 Index 363 Revision History 369 ...
Страница 342: ...336 Programmer Program Date Page Word Contents Notes Word Contents Notes Data Storage ...
Страница 374: ...Cat No W130 E1 05 C200H Programmable Controllers CPU01 E 03 E 11 E OPERATION MANUAL ...