![Omron CJ1G-CPUxx Instructions Manual Download Page 756](http://html1.mh-extra.com/html/omron/cj1g-cpuxx/cj1g-cpuxx_instructions-manual_742491756.webp)
735
Subroutines
Section 3-19
An SBS(091) or GSBS(750) instruction can be written within a subroutine
region (SBN(092) to RET(093)) or global subroutine region (GSBN(751) to
GRET(752)) to “nest” subroutines. Subroutines can be nested up to 16 levels.
Global Subroutines and
Differentiation
Observe the following precautions when using differentiated instructions
(DIFU(013), DIFU(014), or up/down differentiated instructions) in subroutines.
The operation of differentiated instructions in a global subroutine is unpredict-
able if a subroutine is executed more than once in the same cycle. In the fol-
lowing example, global subroutine 0001 is executed when CIO 000000 is ON
and CIO 000100 is turned ON by DIFU(013) when CIO 000001 has gone
B
A
D
C
B
GSBS
n
000000
D
GSBS
m
000001
END
A
GSBN
n
C
GSBN
m
GRET
END
GRET
Execution
condition ON
Execution
condition ON
Cyclic or interrupt task
Interrupt task 0
Subroutine functions
divided by task.
GSBN 10
GSBS 11
GRET
GSBN 11
GSBS 12
GRET
GSBN 12
GRET
to
Interrupt task 0
to
to
to
to
Summary of Contents for CJ1G-CPUxx
Page 3: ...iv N o t i c e ...
Page 5: ...vi ...
Page 21: ...xxii Conformance to EC Directives 6 ...
Page 35: ......
Page 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...