62
Function Block Applications Guidelines
Section 2-5
• 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-5-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.
Summary of Contents for SYSMAC CX-Programmer 9
Page 2: ......
Page 4: ...iv ...
Page 6: ...vi ...
Page 8: ......
Page 16: ...xvi ...
Page 20: ...xx ...
Page 26: ...xxvi Application Precautions 4 ...
Page 27: ...Part 1 Function Blocks ...
Page 28: ......
Page 154: ...128 Procedures Section 3 2 ...
Page 155: ...Part 2 Structured Text ST ...
Page 156: ......
Page 160: ...134 CX Programmer Specifications Section 4 2 ...
Page 206: ...180 Procedures Section 6 1 ...
Page 208: ...182 System defined external variables supported in function blocks Appendix A ...
Page 230: ...204 Revision History ...
Page 231: ......