EasyManua.ls Logo

Omron CP - PROGRAMMING MANUAL 05-2007 - Page 717

Omron CP - PROGRAMMING MANUAL 05-2007
1175 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
684
Subroutines Section 3-18
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 0.00 is ON and
CIO 100.00 is turned ON by DIFU(013) when CIO 0.01 has gone from OFF to
ON. If CIO 0.01 is ON in the same cycle, global subroutine 0001 will be exe-
cuted again but this time DIFU(013) will not detect the rising edge of CIO 0.01
and CIO 100.00 will be turned OFF.
In contrast, the output of a differentiated instruction (DIFU(013) or DIFD(014))
would remain ON if the instruction was executed and the output was turned
ON but the same global subroutine was not called a second time.
In the following example, global subroutine 0001 is executed if CIO 0.00 is
ON. Output CIO 100.00 is turned ON by DIFU(013) when CIO 0.01 has gone
from OFF to ON. If CIO 0.00 is OFF in the following cycle, subroutine 0001
will not be executed again and output CIO 100.00 will remain ON.
GSBS
1
0.00
GSBS
1
0.01
GSBN
1
DIFU
100.00
0.01
GRET
Subroutine 1
Cyclic task 1
Cyclic task 2
Interrupt task 0
Executed
again

Table of Contents

Related product manuals