Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual page 867

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Subroutines
Global Subroutines and
Differentiation
828
Subroutine functions
divided by task.
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.
Interrupt task 0
GSBN 10
GSBS 11
Observe the following precautions when using differentiated instructions (UP,
DOWN, DIFU(013), DIFU(014), or up/down differentiated instructions) in sub-
routines.
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
Cyclic or interrupt task
000000
GSBS
n
B
000001
GSBS
m
D
END
Interrupt task 0
GSBN
n
A
GRET
GSBN
m
C
GRET
END
GSBN 11
GSBN 12
to
to
GSBS 12
to
to
GRET
GRET
Section 3-19
Execution
condition ON
B
Execution
condition ON
D
A
C
to
GRET

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents