Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 723

Table of Contents

Advertisement

Precautions
• The subroutine number must be unique
for each subroutine. You cannot use the
same number for more than one
subroutine.
• Each subroutine must have a unique
subroutine number. Do not use the
same subroutine number for more than
one subroutine.
• Observe
the
when using differentiated instructions
(DIFU(013), DIFD(014), or up/down
differentiated
subroutines.
• The
operation
instructions in a subroutine is unpre-
dictable if a subroutine is executed
more than once in the same cycle.
In the following example, subroutine
1 is executed when CIO 0.00 is ON
and CIO
DIFU(013) when CIO
gone from OFF to ON. If CIO 0.01
is ON in the same cycle, subroutine
1 will be executed again but this
time DIFU(013) will turn CIO 1.00
OFF without checking the status of
CIO 0.01.
• In contrast, a differentiated instruc-
tion (UP, DOWN, DIFU(013) or
DIFD(014)) would maintain the ON
status if the instruction was exe-
cuted and the output was turned ON
but the same subroutine was not
called a second time.
• In the following example, subroutine
1 is executed if CIO 0.00 is ON.
Output CIO 1.00 is turned ON by
DIFU(013) when CIO
gone from OFF to ON. If CIO 0.00
is OFF in the following cycle, sub-
routine 1 will not be executed again
and output CIO 1.00 will remain ON
• SBS(091)
NOP(000) when it is within a pro-
gram section interlocked by IL(002)
and ILC(003).
CS/CJ/NSJ Series Instructions Reference Manual (W474)
following
precautions
instructions)
in
of
differentiated
1.00 is turned ON by
0.01 has
0.01 has
will
be
treated
as
0.00
1
0.01
1
1
Subroutine
0.01
1
1.00
0.00
1
1
0.01
1.00
3. Instructions
1
3
5
4
The subroutine
is executed
again.
2
1
3
The subroutine is
not executed in
following cycles.
2
687
3

Advertisement

Table of Contents
loading

Table of Contents