Omron CS1G/H-CPUxxH Instructions Manual page 743

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxxH:
Table of Contents

Advertisement

Subroutines
Subroutines and
Differentiation
722
Note A subroutine can be called more than once in a program.
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 subroutine is unpredictable if a
subroutine is executed more than once in the same cycle. In the following
example, subroutine 0001 is executed when CIO 000000 is ON and
CIO 000100 is turned ON by DIFU(013) when CIO 000001 has gone from
OFF to ON. If CIO 000001 is ON in the same cycle, subroutine 0001 will be
executed again but this time DIFU(013) will turn CIO 000100 OFF without
checking the status of CIO 000001.
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 subroutine wasn't called a second time.
In the following example, subroutine 0001 is executed if CIO 000000 is ON.
Output CIO 000100 is turned ON by DIFU(013) when CIO 000001 has gone
from OFF to ON. If CIO 000000 is OFF in the following cycle, subroutine
0001 won't be executed again and output CIO 000100 will remain ON.
1
1
3
1
1
Subroutine
0001
2
1
1
3
1
The subroutine is not executed
in following cycles.
000100
2
Section 3-19
5
The subroutine is
4
executed again.

Advertisement

Table of Contents
loading

Table of Contents