5 Understanding Programming
5-110
CJ2 CPU Unit Software User’s Manual
CJ-series 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.
Note Instructions that specify program areas cannot be used for programs in other tasks. Refer to 5-2-4 Designing
Tasks for details.
5-10-2 Special Program Sections
Program section Instructions Instruction condition Status
Subroutine SBS, SBN, and RET instructions
GSBS, GSBN, and GRET
instructions
Subroutine program is
executed.
The subroutine program sec-
tion between SBN and RET
instructions is executed.
IL - ILC section IL and ILC instructions Section is interlocked The output bits are turned OFF
and timers are reset. Other
instructions will not be exe-
cuted and previous status will
be maintained.
Step Ladder sec-
tion
STEP instructions
FOR-NEXT loop FOR instructions and NEXT
instructions
Break in progress. Looping
JMP0 - JME0 sec-
tion
JMP0 instructions and JME0
instructions
Jump
Block program sec-
tion
BPRG instructions and BEND
instructions
Block program is exe-
cuting.
The block program listed in
mnemonics between the BPRG
and BEND instructions is exe-
cuted.
Instruction Combinations
Subroutine
IL - ILC sec-
tion
Step ladder
section
FOR - NEXT
loop
JMP0 - JME0
section
Block pro-
gram sec-
tion
Subroutine Not possible. Not possible. Not possible. Not possible. Not possible. Not possible.
IL - ILC OK Not possible. Not possible. OK OK Not possible.
Step ladder section Not possible. OK Not possible. Not possible. OK Not possible.
FOR - NEXT loop OK OK Not possible. OK OK Not possible.
JMP0 - JME0 OK OK Not possible. Not possible. Not possible. Not possible.
Block program section OK OK OK Not possible. OK Not possible.