C40K-CDR-A Omron, C40K-CDR-A Datasheet - Page 137

no-image

C40K-CDR-A

Manufacturer Part Number
C40K-CDR-A
Description
PROGRAMMABLE CONTROLLER CPU
Manufacturer
Omron
Datasheet

Specifications of C40K-CDR-A

Leaded Process Compatible
No
Peak Reflow Compatible (260 C)
No
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
Subroutines
5-17
5-17-1
Flags
5-17-2
126
Limitations
Description
Description
Subroutines
SUBROUTINE DEFINE and SUBROUTINE RETURN
SBN(92)/RET(93)
SUBROUTINE ENTRY – SBS(91)
Subroutines can be used for one of two different purposes: either to separate
off sections of large control tasks so that they can be handled as smaller
ones and to enable you to reuse a given set of instructions at different places
within one program or as a part of different programs. When the main pro-
gram calls a subroutine, control is transferred to the subroutine and the in-
structions in the subroutine are executed. The instructions within a subrou-
tine are written in the same way as main program code. When all the instruc-
tions in the subroutine have been executed, control returns to the main pro-
gram.
Each subroutine number can be used in SBN(92) once only, i.e., up to 16
subroutines may be programmed.
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 section). 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 0000 for the
next cycle. Subroutines will not be executed unless called by SBS(91).
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.
There are no flags directly affected by these instructions.
To execute a subroutine, it must be called from the main by programming
SBS(91) with the number of the desired subroutine. When SBS(91) is exe-
cuted (i.e., when the execution condition for it is ON), the instructions be-
tween 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.
Ladder Symbol
Ladder Symbol
SBN(92) N
SBS(91) N
Ladder Symbol
RET(93)
Definer Data Areas
Definer Data Areas
N: Subroutine number
N: Subroutine number
# (00 to 15)
# (00 to 15)
Section 5-17

Related parts for C40K-CDR-A