EasyManua.ls Logo

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION - Using Index Registers

Omron CX-PROGRAMMER 5.0-FUNCTION BLOCK OPERATION
183 pages
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...
46
Function Block Applications Guidelines Section 2-4
3. Add the unit number offset to the real I/O memory address within the Index
Register (e.g., IR0).
Example 2: Specifying the Designated Bit in the CIO Area (e.g., CIO Word
n+a, Bit b)
Programs: Use either of the following methods.
Word addresses: Specify the constant offset of the Index Register using
an indirect specification (e.g., +a,IR0).
Bit addresses: Specify an instruction that can specify a bit address within
a word (e.g., &b in second operand of SETB instruction when writing and
TST instruction when reading).
Example: Special I/O Units
2-4-6 Using Index Registers
Index Registers IR0 to IR15 function as pointers for specifying I/O memory
addresses. These Index Registers can be used within function blocks to
directly specify addresses using IR0 to IR15 and not the variable names
(Index Register direct specification: IR0 to IR15; Index Register indirect speci-
fication: ,IR0 to ,IR15)
Note After storing the real I/O memory addresses in the Index Registers using the
MOVR(560) instruction, Index Registers can be indirectly specified using gen-
eral instructions. This enables all I/O memory areas to be specified dynami-
cally.
&3 Unit No.
&10
Unit No.
Offset
MOVR
Relay
IR0
+L
IR0
Offset
IR0
SETB
+1,IR0
&2
Instance for function block definition A.
1) Specify the first CIO Area word n (n = CIO 2000 + unit number × 10)
Used constants:
Unit number (input variable, INT data type)
Offset (internal variable, DINT data type)
Relay (internal variable, WORD data type, 400 array elements, AT
setting = 2000)
Multiplies unit number by
&10 and stores in offset.
Stores the real I/O memory
address for the relay in IR0.
Adds offset to IR0.
2) Specify the designated bit in the CIO
Area (e.g., CIO word n+1, bit 02)
Turns ON CIO word n+1,
bit 02.

Table of Contents

Related product manuals