![background image](http://html1.mh-extra.com/html/omron/sysmac-cx-programmer-9/sysmac-cx-programmer-9_operation-manual_744241089.webp)
63
Function Block Applications Guidelines
Section 2-5
Note
(1) When Index Registers IR0 to IR15 are used within function blocks, using
the same Index Register within other function blocks or in the program
outside of function blocks will create competition between the two in-
stances and the program will not execute properly. Therefore, when using
Index Registers (IR0 to IR15), always save the value of the Index Register
at the point when the function block starts (or before the Index Register
is used), and when the function block is completed (or after the Index
Register has been used), incorporate processing in the program to return
the Index Register to the saved value.
(2) Always set the value before using Index Registers. Operation will not be
stable if Index Registers are used without the values being set.
IR
@
IR0
+5,IR0
a
MOVR(560)
Pointer
All I/O memory
areas
Index Register
I/O memory
Example: Spec5,IR0 using
constant offset specification, not
variable name
Function block
Instruction
Indirect
specifi-
cation
Specify address
in IR0
+5 offset
Specify ad-
dress at +5
offset from
IR0.
Value A
IR0
IR0
IR0
Value A
Value A
Value A
Value B
Value A
Example: Starting function block (or before using Index Register):
1. Save the value of IR (e.g., A).
Within function block:
2.Use IR.
At start of function block (or before Index Register is used):
3. Return IR to saved value (e.g., A)
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: ......