![Omron SYSMAC C200H Скачать руководство пользователя страница 201](http://html1.mh-extra.com/html/omron/sysmac-c200h/sysmac-c200h_operation-manual_742423201.webp)
188
Whereas subroutine calls are controlled from within the main program, sub-
routines activated by interrupts are triggered when the interrupt signal is re-
ceived. Also, multiple interrupts from different Interrupt Input Units can occur
at the same time. To effectively deal with this, the PC employs a priority
scheme for handling interrupts.
In the case of the scheduled interrupt, the time interval between interrupts is
set by the user and is unrelated to the cycle timing of the PC. This capability
is useful for periodic supervisory or executive program execution.
INT(89) is used to control the interrupt signals received from the Interrupt
Input Units, and also to control the scheduling of the scheduled interrupt.
INT(89) provides such functions as masking of interrupts (so that they are
recorded but ignored) and clearing of interrupts.
5-20-2
SUBROUTINE DEFINE and RETURN – SBN(92)/RET(93)
N: Subroutine number
# (00 to 99)
Ladder Symbols
Definer Data Areas
SBN(92) N
RET(93)
Each subroutine number can be used in SBN(92) once only, i.e., up to 100
subroutines may be programmed. Subroutine numbers 00 through 31 are
used by Interrupt Input Units and subroutine number 99 is used for the
scheduled interrupt. Refer to 5-20-4 INTERRUPT CONTROL – INT(89) for
details.
SBN(92) is used to mark the beginning of a subroutine program; RET(93) is
used to mark the end. Each subroutine is identified with a subroutine number,
N, that is programmed as a definer for SBN(92). This same subroutine num-
ber is used in any SBS(91) that calls the subroutine (see next subsection).
No subroutine number is required with RET(93).
All subroutines must be programmed at the end of the main program. When
one or more subroutines have been programmed, the main program will be
executed up to the first SBN(92) before returning to address 00000 for the
next cycle. Subroutines will not be executed unless called by SBS(91) or acti-
vated by an interrupt.
END(01) must be placed at the end of the last subroutine program, i.e., after
the last RET(93). It is not required at any other point in the program. (Refer to
the next subsection for further details.)
Precautions
If SBN(92) is mistakenly placed in the main program, it will inhibit program
execution past that point, i.e., program execution will return to the beginning
when SBN(92) is encountered.
If either DIFU(13) or DIFU(14) is placed within a subroutine, the operand bit
will not be turned OFF until the next time the subroutine is executed, i.e., the
operand bit may stay ON longer than one cycle.
Flags
There are no flags directly affected by these instructions.
Limitations
Description
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 ...