Using Index Registers - Omron CX-PROGRAMMER V8.1 Operation Manual

Function blocks/ structured text
Table of Contents

Advertisement

Function Block Applications Guidelines
Instance for function block definition A.
&3
2-5-6

Using Index Registers

Note
62
• 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
Unit No.
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)
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.
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
&10 and stores in offset.
Unit No.
Offset
Stores the real I/O memory
MOVR
address for the relay in IR0.
Relay
IR0
Adds offset to IR0.
+L
IR0
Offset
IR0
2) Specify the designated bit in the CIO
Area (e.g., CIO word n+1, bit 02)
Turns ON CIO word n+1,
SETB
bit 02.
+1,IR0
&2
Section 2-5

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac ws02-cxpc1-v8Sysmac cx-programmer 8.1

Table of Contents