4-35
4 Understanding Programming
CP2E CPU Unit Software User’s Manual(W614)
4-8 Ladder Programming Precautions
4
4-8-1 Special Program Sections
4-8 Ladder Programming Precautions
For CP2E CPU Units, programs have special program sections that will control instruction conditions.
The following special program sections are available.
The following table shows which of the special instructions can be used inside other program sections.
Place all the subroutines together just after all of the main program and before the END instruction.
A subroutine cannot be placed in a step ladder, block program, or FOR-NEXT section.
If instructions other than those in a subroutine are placed after a subroutine (SBN to RET), those
instructions will not be executed.
4-8-1 Special Program Sections
Program sections Instructions
Instruction
conditions
Status
Subroutine sections SBS, SBN, and RET instruc-
tions
Subroutine program
is executed.
The subroutine program
section between SBN and
RET instructions is exe-
cuted.
IL-ILC sections IL and ILC instructions During IL The output bits are turned
OFF and timers are reset.
Other instructions will not be
executed and previous sta-
tus will be maintained.
Step ladder sections STEP instructions
FOR-NEXT sections FOR and NEXT instructions Break in progress. Looping
Instruction Combinations
Subroutine
sections
IL-ILC
sections
MILH and
MILR-MILC
sections
Step ladder
sections
FOR-NEXT
sections
Subroutine sections No No No No No
IL-ILC sections Ye s N o N o N o Ye s
MILH and MILR-MILC sections Ye s N o Ye s N o Ye s
Step ladder sections No Yes Yes No No
FOR-NEXT sections Ye s Ye s Ye s N o Ye s
Subroutines
Program
Subroutines