Sharing Index And Data Registers Between Tasks - Omron SYSMAC CS/CJ Series Programming Manual

Table of Contents

Advertisement

Cycle Time/High-speed Processing
Programming Example 2

6-1-11 Sharing Index and Data Registers between Tasks

Note
250
This examples show background execution when index register output is
specified, as is possible for MAX(182), MIN(183), and SRCH(181).
Traditional Programming without Background Execution
As shown below, the actual memory map address of the word containing the
maximum value is output to an index register.
Execution condition
a
Programming with Background Execution
With background execution, the actual memory map address of the word con-
taining the maximum value is output to A595 and A596. MOVL(498) is then
used the actual memory map address to the index register.
Communications
Execution
Port Enabled Flag
condition
a
A20200
Communications
Execution
Port Enabled Flag
condition
b
A20200
Sharing Index and Data Registers (IR/DR) between tasks is supported only by
CS1-H, CJ1-H, or CJ1M CPU Units. The normal setting is for separate regis-
ters for each task. The current setting can be confirmed in A09914.
1. Shared Index and Data Registers can be used to eliminate the need to
store and load register contents between tasks when the same contents is
needed in two or more tasks. Refer to the section on index registers in the
MAX(182) is executed completely as
MAX
soon as the execution condition "a"
D00000
turns ON, and the actual memory map
D00100
address of the word containing the
D00200
maximum value is output to IR0
The contents of the I/O memory word
MOV
indicated by the memory map
,IR0
address in IR0 is copied to D00300.
D00300
MAX(182) execution is started if execution
MAX
condition "a" is ON and the Communications
D00000
Port Enabled Flag is ON. The actual memory
D00100
D00200
map address of the word containing the
maximum value is output to A595 and A596.
Execution condition "b" is turned ON to
SET
execute MOVL(498).
b
"a" is turned OFF so that MAX(182) will not
RSET
be executed the next cycle.
a
When execution condition "b"
MOVL
is ON and the
A595
Communications Port
IR0
Enabled Flag is ON,
MOVL(498) copies the actual
memory map address in
A595 and A596 to IR0.
The contents of the I/O memory word
MOV
indicated by the memory map address in IR0
,IR0
D00300
is copied to D00300.
RSET
b
Section 6-1
Extra
processing
required to
move
address.

Advertisement

Table of Contents
loading

Table of Contents